From 782174069c64d3a86922b8c2de2454f97ac1a289 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 2 Dec 2015 14:54:26 +0000 Subject: [PATCH 1/4] Include olm in the webpack if it's been installed .. to make it easy to build a crypto-enabled vector --- webpack.config.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 929e57d71b..089f3fdf1b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,8 @@ var path = require('path'); var webpack = require('webpack'); +var olm_path = path.resolve('./node_modules/olm'); + module.exports = { module: { preLoaders: [ @@ -29,15 +31,36 @@ module.exports = { // 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'), + + // matrix-js-sdk will use olm if it is available, + // but does not explicitly depend on it. Pull it + // in from node_modules if it's there. + olm: olm_path, }, }, plugins: [ - new webpack.IgnorePlugin(/^olm/), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV) } - }) + }), + + // olm.js includes "require 'fs'", which is never + // executed in the browser. Ignore it. + new webpack.IgnorePlugin(/^fs$/, /node_modules\/olm$/) ], devtool: 'source-map' }; + +// ignore olm.js if it's not installed. +(function() { + var fs = require('fs'); + try { + fs.lstatSync(olm_path); + console.log("Olm is installed; including it in bundle"); + } catch (e) { + module.exports.plugins.push( + new webpack.IgnorePlugin(/^olm$/) + ); + } +}) (); From 56b7b659207c75d034ae4e71237c80b546e89044 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 3 Dec 2015 18:24:44 +0000 Subject: [PATCH 2/4] Notes on building a crypto-enabled version --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 91109f9688..d13a2cc994 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,10 @@ Deployment Just run `npm run build` and then mount the `vector` directory on your webserver to actually serve up the app, which is entirely static content. +Enabling encryption +=================== + +To build a version of vector with the (experimental) support for end-to-end +encryption, install the olm module with `npm i +https://matrix.org/packages/npm/olm/olm-0.1.0.tgz` before running `npm +start`. The olm library will be detected and used if available. From 759e35003bcd74d2574c17b9bc5477e9d0b50dac Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 4 Dec 2015 15:39:39 +0000 Subject: [PATCH 3/4] Put some warnings on the crypto stuff --- README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d13a2cc994..7417391c8d 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,27 @@ actually serve up the app, which is entirely static content. Enabling encryption =================== -To build a version of vector with the (experimental) support for end-to-end -encryption, install the olm module with `npm i -https://matrix.org/packages/npm/olm/olm-0.1.0.tgz` before running `npm -start`. The olm library will be detected and used if available. +End-to-end encryption in Vector and Matrix is not yet considered ready for +day-to-day use; it is experimental and should be considered only as a +proof-of-concept. + +To build a version of vector with support for end-to-end encryption, install +the olm module with `npm i https://matrix.org/packages/npm/olm/olm-0.1.0.tgz` +before running `npm start`. The olm library will be detected and used if +available. + +To enable encryption for a room, type + +``` +/encrypt on +``` + +in the message bar in that room. Vector will then generate a set of keys, and +encrypt all outgoing messages in that room. (Note that other people in that +room will send messages in the clear unless they also `/encrypt on`.) + +Note that historical encrypted messages cannot currently be decoded - history +is therefore lost when the page is reloaded. + +There is currently no visual indication of whether encryption is enabled for a +room, or whether a particular message was encrypted. From f8e5bbef0b75693c5525bcc5e8616ad70eafe4e6 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 8 Dec 2015 16:03:12 +0000 Subject: [PATCH 4/4] Add a link to E2E bug in the README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7417391c8d..529e7cdf0f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,8 @@ Enabling encryption End-to-end encryption in Vector and Matrix is not yet considered ready for day-to-day use; it is experimental and should be considered only as a -proof-of-concept. +proof-of-concept. See https://matrix.org/jira/browse/SPEC-162 for an overview +of the current progress. To build a version of vector with support for end-to-end encryption, install the olm module with `npm i https://matrix.org/packages/npm/olm/olm-0.1.0.tgz`