Merge pull request #470 from vector-im/rav/olm

HOWTO encryption
pull/499/head
Richard van der Hoff 2015-12-08 16:03:54 +00:00
commit 1d97a5f06b
2 changed files with 54 additions and 2 deletions

View File

@ -57,3 +57,31 @@ 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
===================
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. 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`
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.

View File

@ -2,6 +2,8 @@ var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var olm_path = path.resolve('./node_modules/olm');
module.exports = {
module: {
preLoaders: [
@ -32,18 +34,40 @@ 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)
}
}),
new ExtractTextPlugin("bundle.css", {
allChunks: true
})
}),
// 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 webpack bundle");
} catch (e) {
module.exports.plugins.push(
new webpack.IgnorePlugin(/^olm$/)
);
}
}) ();