From ec7b3fc787bee9ea11547d1e8e5d8e160fdfc18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= Date: Wed, 22 Apr 2015 20:29:19 +0200 Subject: [PATCH 1/5] Adding support for providing intermediate CA certificates when running etherpad-lite with ssl through Node/expressjs --- settings.json.template | 1 + src/node/hooks/express.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/settings.json.template b/settings.json.template index 39c383eda..7d9c62cc6 100644 --- a/settings.json.template +++ b/settings.json.template @@ -25,6 +25,7 @@ "ssl" : { "key" : "/path-to-your/epl-server.key", "cert" : "/path-to-your/epl-server.crt" + "ca": ["/path-to-your/epl-intermediate-cert1.crt", "/path-to-your/epl-intermediate-cert2.crt"] }, */ diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 3abe41f89..1752f5d0f 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -46,6 +46,13 @@ exports.restartServer = function () { key: fs.readFileSync( settings.ssl.key ), cert: fs.readFileSync( settings.ssl.cert ) }; + if (settings.ssl.ca) { + options.ca = []; + for(var i = 0; i < settings.ssl.ca.length; i++) { + var caFileName = settings.ssl.ca[i]; + options.ca.push(fs.readFileSync(caFileName)); + } + } var https = require('https'); server = https.createServer(options, app); From b4163fc8626a6671e9b80d2f372e2a601c5ab907 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 23 Apr 2015 17:27:54 +0100 Subject: [PATCH 2/5] fix docs --- doc/api/hooks_client-side.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/hooks_client-side.md b/doc/api/hooks_client-side.md index f9ad9147c..aa027337d 100644 --- a/doc/api/hooks_client-side.md +++ b/doc/api/hooks_client-side.md @@ -198,7 +198,7 @@ Things in context: 1. cc - the contentcollector object 2. state - the current state of the change being made 3. tname - the tag name of this node currently being processed -4. style - the style applied to the node (probably CSS) +4. styl - the style applied to the node (probably CSS) -- Note the typo 5. cls - the HTML class string of the node This hook is called before the content of a node is collected by the usual methods. The cc object can be used to do a bunch of things that modify the content of the pad. See, for example, the heading1 plugin for etherpad original. From b349a4f226825b16620b2f9a59d300b8fb4046c1 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 23 Apr 2015 17:49:08 +0100 Subject: [PATCH 3/5] probably fixes #2625 --- src/static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 1120b2c12..a32c565b6 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -612,7 +612,7 @@ function Ace2Inner(){ // So this has to be set to pre-wrap ;( // We need to file a bug w/ the Chromium team. if(browser.chrome){ - $("#innerdocbody").css({"white-space":"pre-wrap"}); + $("#innerdocbody, body.doesWrap > div").css({"white-space":"pre-wrap"}); } } From a6a8c4d909a38f6b07390e12f5f2d1007fcd8350 Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 24 Apr 2015 07:07:18 +0100 Subject: [PATCH 4/5] provide a script that cleans up before running to save people doing rm rf src node_modules --- bin/cleanRun.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 bin/cleanRun.sh diff --git a/bin/cleanRun.sh b/bin/cleanRun.sh new file mode 100755 index 000000000..55bcf8a75 --- /dev/null +++ b/bin/cleanRun.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +#Move to the folder where ep-lite is installed +cd `dirname $0` + +#Was this script started in the bin folder? if yes move out +if [ -d "../bin" ]; then + cd "../" +fi + +ignoreRoot=0 +for ARG in $* +do + if [ "$ARG" = "--root" ]; then + ignoreRoot=1 + fi +done + +#Stop the script if its started as root +if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then + echo "You shouldn't start Etherpad as root!" + echo "Please type 'Etherpad rocks my socks' or supply the '--root' argument if you still want to start it as root" + read rocks + if [ ! $rocks = "Etherpad rocks my socks" ] + then + echo "Your input was incorrect" + exit 1 + fi +fi + +#Clean the current environment +rm -rf src/node_modules + +#Prepare the enviroment +bin/installDeps.sh $* || exit 1 + +#Move to the node folder and start +echo "Started Etherpad..." + +SCRIPTPATH=`pwd -P` +node $SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js $* From 254edffa9ca4deebef189c10b7846adca72024db Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 24 Apr 2015 14:17:49 +0100 Subject: [PATCH 5/5] fixes #2547 --- src/node/hooks/express.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 1752f5d0f..17910e4b2 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -69,6 +69,9 @@ exports.restartServer = function () { res.header("Strict-Transport-Security", "max-age=31536000; includeSubDomains"); } + // Stop IE going into compatability mode + // https://github.com/ether/etherpad-lite/issues/2547 + res.header("X-UA-Compatible", "IE=Edge,chrome=1"); res.header("Server", serverName); next(); });