diff --git a/CHANGELOG.md b/CHANGELOG.md index ee745baa1b..659a3742c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,106 @@ +Changes in [0.9.7](https://github.com/vector-im/riot-web/releases/tag/v0.9.7) (2017-02-04) +========================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.3...v0.9.7) + + * Update to matrix-js-sdk 0.7.5 (no changes from 0.7.5-rc.3) + * Update to matrix-react-sdk 0.8.6 (no changes from 0.8.6-rc.3) + +Changes in [0.9.7-rc.3](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.3) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.2...v0.9.7-rc.3) + * Update to latest Olm to fix key import/export and use of megolm sessions + created on more recent versions + * Update to latest matrix-react-sdk and matrix-js-sdk to fix e2e device + handling + +Changes in [0.9.7-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.2) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.1...v0.9.7-rc.2) + + * Update matrix-js-sdk to get new device change + notifications interface for more reliable e2e crypto + +Changes in [0.9.7-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.1) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6...v0.9.7-rc.1) + + * Better user interface for screen readers and keyboard navigation + [\#2946](https://github.com/vector-im/riot-web/pull/2946) + * Allow mxc: URLs for icons in the NetworkDropdown + [\#3118](https://github.com/vector-im/riot-web/pull/3118) + * make TopRightMenu more intuitive + [\#3117](https://github.com/vector-im/riot-web/pull/3117) + * Handle icons with width > height + [\#3110](https://github.com/vector-im/riot-web/pull/3110) + * Fix jenkins build + [\#3105](https://github.com/vector-im/riot-web/pull/3105) + * Add CSS for a support box in login + [\#3081](https://github.com/vector-im/riot-web/pull/3081) + * Allow a custom login logo to be displayed on login + [\#3082](https://github.com/vector-im/riot-web/pull/3082) + * Fix the width of input fields within login/reg box + [\#3080](https://github.com/vector-im/riot-web/pull/3080) + * Set BaseAvatar_image bg colour = #fff + [\#3057](https://github.com/vector-im/riot-web/pull/3057) + * only recalculate favicon if it changes + [\#3067](https://github.com/vector-im/riot-web/pull/3067) + * CSS tweak for email address lookup + [\#3064](https://github.com/vector-im/riot-web/pull/3064) + * Glue the dialog to rageshake: honour sendLogs flag. + [\#3061](https://github.com/vector-im/riot-web/pull/3061) + * Don't use hash-named directory for dev server + [\#3049](https://github.com/vector-im/riot-web/pull/3049) + * Implement bug reporting logic + [\#3000](https://github.com/vector-im/riot-web/pull/3000) + * Add css for bug report dialog + [\#3045](https://github.com/vector-im/riot-web/pull/3045) + * Increase the max-height of the expanded status bar + [\#3043](https://github.com/vector-im/riot-web/pull/3043) + * Hopefully, fix intermittent test failure + [\#3040](https://github.com/vector-im/riot-web/pull/3040) + * CSS for 'searching known users' + [\#2971](https://github.com/vector-im/riot-web/pull/2971) + * Animate status bar max-height and margin-top + [\#2981](https://github.com/vector-im/riot-web/pull/2981) + * Add eslint config + [\#3032](https://github.com/vector-im/riot-web/pull/3032) + * Re-position typing avatars relative to "is typing" + [\#3030](https://github.com/vector-im/riot-web/pull/3030) + * CSS for avatars that appear when users are typing + [\#2998](https://github.com/vector-im/riot-web/pull/2998) + * Add StartupWMClass + [\#3001](https://github.com/vector-im/riot-web/pull/3001) + * Fix link to image for event options menu + [\#3002](https://github.com/vector-im/riot-web/pull/3002) + * Make riot desktop single instance + [\#2999](https://github.com/vector-im/riot-web/pull/2999) + * Add electron tray icon + [\#2997](https://github.com/vector-im/riot-web/pull/2997) + * Fixes to electron desktop notifs + [\#2994](https://github.com/vector-im/riot-web/pull/2994) + * Auto-hide the electron menu bar + [\#2975](https://github.com/vector-im/riot-web/pull/2975) + * A couple of tweaks to the karma config + [\#2987](https://github.com/vector-im/riot-web/pull/2987) + * Deploy script + [\#2974](https://github.com/vector-im/riot-web/pull/2974) + * Use the postcss-webpack-loader + [\#2990](https://github.com/vector-im/riot-web/pull/2990) + * Switch CSS to using postcss, and implement a dark theme. + [\#2973](https://github.com/vector-im/riot-web/pull/2973) + * Update redeploy script to keep old bundles + [\#2969](https://github.com/vector-im/riot-web/pull/2969) + * Include current version in update check explicitly + [\#2967](https://github.com/vector-im/riot-web/pull/2967) + * Add another layer of directory to webpack chunks + [\#2966](https://github.com/vector-im/riot-web/pull/2966) + * Fix links to fonts and images from CSS + [\#2965](https://github.com/vector-im/riot-web/pull/2965) + * Put parent build hash in webpack output filenames + [\#2961](https://github.com/vector-im/riot-web/pull/2961) + * update README to point to new names/locations + [\#2846](https://github.com/vector-im/riot-web/pull/2846) + Changes in [0.9.6](https://github.com/vector-im/riot-web/releases/tag/v0.9.6) (2017-01-16) ========================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6-rc.1...v0.9.6) diff --git a/karma.conf.js b/karma.conf.js index 901832c78c..b0a48c92ba 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,13 +2,14 @@ var path = require('path'); var webpack = require('webpack'); +var webpack_config = require('./webpack.config'); /* * We use webpack to build our tests. It's a pain to have to wait for webpack * to build everything; however it's the easiest way to load our dependencies * from node_modules. * - * If you run karma in multi-run mode (with `npm run test:multi`), it will watch + * If you run karma in multi-run mode (with `npm run test-multi`), it will watch * the tests for changes, and webpack will rebuild using a cache. This is much quicker * than a clean rebuild. */ @@ -19,8 +20,41 @@ var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js'; process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; process.env.Q_DEBUG = 1; +/* the webpack config is based on the real one, to (a) try to simulate the + * deployed environment as closely as possible, and (b) to avoid a shedload of + * cut-and-paste. + */ + +// find out if we're shipping olm, and where it is, if so. +const olm_entry = webpack_config.entry['olm']; + +// remove the default entries - karma provides its own (via the 'files' and +// 'preprocessors' config below) +delete webpack_config['entry']; + +// add ./test as a search path for js +webpack_config.module.loaders.unshift({ + test: /\.js$/, loader: "babel", + include: [path.resolve('./src'), path.resolve('./test')], +}); + +// disable parsing for sinon, because it +// tries to do voodoo with 'require' which upsets +// webpack (https://github.com/webpack/webpack/issues/304) +webpack_config.module.noParse.push(/sinon\/pkg\/sinon\.js$/); + +// ? +webpack_config.resolve.alias['sinon'] = 'sinon/pkg/sinon.js'; + +webpack_config.resolve.root = [ + path.resolve('./src'), + path.resolve('./test'), +]; + +webpack_config.devtool = 'inline-source-map'; + module.exports = function (config) { - config.set({ + const myconfig = { // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], @@ -51,7 +85,7 @@ module.exports = function (config) { // available preprocessors: // https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'test/**/*.js': ['webpack', 'sourcemap'] + '{src,test}/**/*.js': ['webpack'], }, // test results reporter to use @@ -94,59 +128,20 @@ module.exports = function (config) { outputDir: 'karma-reports', }, - webpack: { - module: { - preLoaders: [ - // use the source-map-loader for javascript. This means - // that we have a better chance of seeing line numbers from - // the pre-babeled source. - { test: /\.js$/, loader: "source-map-loader" }, - ], - loaders: [ - { test: /\.json$/, loader: "json" }, - { - test: /\.js$/, loader: "babel", - include: [path.resolve('./src'), - path.resolve('./test'), - ] - }, - ], - noParse: [ - // don't parse the languages within highlight.js. They - // cause stack overflows - // (https://github.com/webpack/webpack/issues/1721), and - // there is no need for webpack to parse them - they can - // just be included as-is. - /highlight\.js\/lib\/languages/, + webpack: webpack_config, - // also disable parsing for sinon, because it - // tries to do voodoo with 'require' which upsets - // webpack (https://github.com/webpack/webpack/issues/304) - /sinon\/pkg\/sinon\.js$/, - ], + webpackMiddleware: { + stats: { + // don't fill the console up with a mahoosive list of modules + chunks: false, }, - resolve: { - alias: { - // alias any requires to the react module to the one in our path, otherwise - // we tend to get the react source included twice when using npm link. - react: path.resolve('./node_modules/react'), - - // same goes for js-sdk - "matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'), - - sinon: 'sinon/pkg/sinon.js', - }, - root: [ - path.resolve('./src'), - path.resolve('./test'), - ], - }, - plugins: [ - // olm may not be installed, so avoid webpack warnings by - // ignoring it. - new webpack.IgnorePlugin(/^olm$/), - ], - devtool: 'inline-source-map', }, - }); + }; + + // include the olm loader if we have it. + if (olm_entry) { + myconfig.files.unshift(olm_entry); + } + + config.set(myconfig); }; diff --git a/package.json b/package.json index 915056e636..6cfcd81ff0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron/src/electron-main.js", - "version": "0.9.6", + "version": "0.9.7", "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "repository": { @@ -46,7 +46,7 @@ "clean": "rimraf lib webapp electron/dist", "prepublish": "npm run build:compile", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", - "test:multi": "karma start" + "test-multi": "karma start" }, "dependencies": { "babel-polyfill": "^6.5.0", @@ -111,7 +111,6 @@ "karma-junit-reporter": "^0.4.1", "karma-mocha": "^0.2.2", "karma-phantomjs-launcher": "^1.0.0", - "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.7.0", "minimist": "^1.2.0", "mkdirp": "^0.5.1", @@ -134,7 +133,7 @@ "webpack-dev-server": "^1.16.2" }, "optionalDependencies": { - "olm": "https://matrix.org/packages/npm/olm/olm-2.1.0.tgz" + "olm": "https://matrix.org/packages/npm/olm/olm-2.2.1.tgz" }, "build": { "appId": "im.riot.app", diff --git a/scripts/jenkins.sh b/scripts/jenkins.sh index 0f4fac2513..5ce930b8cd 100755 --- a/scripts/jenkins.sh +++ b/scripts/jenkins.sh @@ -11,13 +11,18 @@ set -x npm install # apparently npm 3.10.3 on node 6.4.0 doesn't upgrade #develop target with npm install unless explicitly asked. -npm install matrix-react-sdk matrix-js-sdk +npm install matrix-react-sdk matrix-js-sdk olm # install olm. A naive 'npm i ./olm/olm-*.tgz' fails because it uses the url # from our package.json (or even matrix-js-sdk's) in preference. -tar -C olm -xz < olm/olm-*.tgz -rm -r node_modules/olm -cp -r olm/package node_modules/olm +# +# disabled for now, to avoid the annoying scenario of a release doing something +# different to /develop. Instead, add it to the 'npm install' list above. +# -- rav 2016/02/03 +#tar -C olm -xz < olm/olm-*.tgz +#rm -r node_modules/olm +#cp -r olm/package node_modules/olm + # we may be using dev branches of js-sdk and react-sdk, in which case we need to build them (cd node_modules/matrix-js-sdk && npm install) diff --git a/scripts/rageshake.go b/scripts/rageshake.go new file mode 100644 index 0000000000..cd62b4f9ed --- /dev/null +++ b/scripts/rageshake.go @@ -0,0 +1,111 @@ +// Run a web server capable of dumping bug reports sent by Riot. +// Requires Go 1.5+ +// Usage: go run rageshake.go PORT +// Example: go run rageshake.go 8080 +package main + +import ( + "bytes" + "compress/gzip" + "encoding/json" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "path/filepath" + "strconv" + "time" +) + +var maxPayloadSize = 1024 * 1024 * 55 // 55 MB + +type LogEntry struct { + ID string `json:"id"` + Lines string `json:"lines"` +} + +type Payload struct { + Text string `json:"text"` + Version string `json:"version"` + UserAgent string `json:"user_agent"` + Logs []LogEntry `json:"logs"` +} + +func respond(code int, w http.ResponseWriter) { + w.WriteHeader(code) + w.Write([]byte("{}")) +} + +func gzipAndSave(data []byte, fpath string) error { + fpath = filepath.Join("bugs", fpath) + + if _, err := os.Stat(fpath); err == nil { + return fmt.Errorf("file already exists") // the user can just retry + } + var b bytes.Buffer + gz := gzip.NewWriter(&b) + if _, err := gz.Write(data); err != nil { + return err + } + if err := gz.Flush(); err != nil { + return err + } + if err := gz.Close(); err != nil { + return err + } + if err := ioutil.WriteFile(fpath, b.Bytes(), 0644); err != nil { + return err + } + return nil +} + +func main() { + http.HandleFunc("/api/submit", func(w http.ResponseWriter, req *http.Request) { + if req.Method != "POST" && req.Method != "OPTIONS" { + respond(405, w) + return + } + // Set CORS + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS") + w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") + if req.Method == "OPTIONS" { + respond(200, w) + return + } + if length, err := strconv.Atoi(req.Header.Get("Content-Length")); err != nil || length > maxPayloadSize { + respond(413, w) + return + } + var p Payload + if err := json.NewDecoder(req.Body).Decode(&p); err != nil { + respond(400, w) + return + } + // Dump bug report to disk as form: + // "bugreport-20170115-112233.log.gz" => user text, version, user agent, # logs + // "bugreport-20170115-112233-0.log.gz" => most recent log + // "bugreport-20170115-112233-1.log.gz" => ... + // "bugreport-20170115-112233-N.log.gz" => oldest log + t := time.Now().UTC() + prefix := t.Format("bugreport-20060102-150405") + summary := fmt.Sprintf( + "%s\n\nNumber of logs: %d\nVersion: %s\nUser-Agent: %s\n", p.Text, len(p.Logs), p.Version, p.UserAgent, + ) + if err := gzipAndSave([]byte(summary), prefix+".log.gz"); err != nil { + respond(500, w) + return + } + for i, log := range p.Logs { + if err := gzipAndSave([]byte(log.Lines), fmt.Sprintf("%s-%d.log.gz", prefix, i)); err != nil { + respond(500, w) + return // TODO: Rollback? + } + } + respond(200, w) + }) + + port := os.Args[1] + log.Fatal(http.ListenAndServe(":"+port, nil)) +} diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 0b3281d683..668ca5462b 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -20,6 +20,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'BottomLeftMenu', @@ -121,10 +122,10 @@ module.exports = React.createClass({ var homeButton; if (this.state.teamToken) { homeButton = ( -