summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-11-24 14:03:51 +0000
committerJohn McLear <john@mclear.co.uk>2015-11-24 14:03:51 +0000
commita913f5799493ba79894e84126f9d9e735b7a5c0e (patch)
tree1e6fc5e0626a25c43ff26de1284ed085a4cf541c
parenta419a3a87d34180e35a82616004bc8c2b0298fec (diff)
parenta8c2833759c1b9e0eb01e7fc78aaf99496fe3ae1 (diff)
downloadetherpad-lite-a913f5799493ba79894e84126f9d9e735b7a5c0e.zip
Merge pull request #2840 from ether/applySettings
allow settings to be applied from the filesystem
-rwxr-xr-xsrc/node/server.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/node/server.js b/src/node/server.js
index 2952da54..3cca9912 100755
--- a/src/node/server.js
+++ b/src/node/server.js
@@ -45,7 +45,7 @@ async.waterfall([
callback(er)
})
},
-
+
// load everything
function(callback) {
settings = require('./utils/Settings');
@@ -55,7 +55,7 @@ async.waterfall([
hooks.plugins = plugins;
callback();
},
-
+
//initalize the database
function (callback)
{
@@ -74,6 +74,15 @@ async.waterfall([
// Call loadSettings hook
hooks.aCallAll("loadSettings", { settings: settings });
+ // Call applySettings hook
+ hooks.aCallAll("applySettings", settings, function(err, newSettings){
+ if(!newSettings) return;
+ newSettings.forEach(function (settingsBlob){
+ for (var setting in settingsBlob){
+ settings[setting] = settingsBlob[setting];
+ };
+ });
+ });
callback();
},
@@ -81,6 +90,6 @@ async.waterfall([
function (callback)
{
hooks.callAll("createServer", {});
- callback(null);
+ callback(null);
}
]);