From 039a761eaf0dd06e942a0fb17a1d7289e3e147bf Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 24 Nov 2015 14:02:37 +0000 Subject: [PATCH 1/2] allow settings to be applied from the filesystem --- src/node/server.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/node/server.js b/src/node/server.js index 2952da540..f6cfbc313 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); } ]); From a8c2833759c1b9e0eb01e7fc78aaf99496fe3ae1 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 24 Nov 2015 14:03:38 +0000 Subject: [PATCH 2/2] clean up --- src/node/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node/server.js b/src/node/server.js index f6cfbc313..3cca99120 100755 --- a/src/node/server.js +++ b/src/node/server.js @@ -83,7 +83,6 @@ async.waterfall([ }; }); }); - console.log(settings); callback(); },