summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-11-24 14:02:37 +0000
committerJohn McLear <john@mclear.co.uk>2015-11-24 14:02:37 +0000
commit039a761eaf0dd06e942a0fb17a1d7289e3e147bf (patch)
treef09a35d40cffaa1614c3af7affde1082f21a0101 /src
parenta419a3a87d34180e35a82616004bc8c2b0298fec (diff)
downloadetherpad-lite-039a761eaf0dd06e942a0fb17a1d7289e3e147bf.zip
allow settings to be applied from the filesystem
Diffstat (limited to 'src')
-rwxr-xr-xsrc/node/server.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/node/server.js b/src/node/server.js
index 2952da54..f6cfbc31 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,16 @@ 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];
+ };
+ });
+ });
+ console.log(settings);
callback();
},
@@ -81,6 +91,6 @@ async.waterfall([
function (callback)
{
hooks.callAll("createServer", {});
- callback(null);
+ callback(null);
}
]);