diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/node/utils/Settings.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 5382d819..888e86d3 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -27,7 +27,7 @@ var npm = require("npm/lib/npm.js"); var jsonminify = require("jsonminify"); var log4js = require("log4js"); var randomString = require("./randomstring"); - +var suppressDisableMsg = " -- To suppress these warning messages change suppressErrorsInPadText to true in your settings.json\n"; /* Root path of the installation */ exports.root = path.normalize(path.join(npm.dir, "..")); @@ -55,6 +55,11 @@ exports.ip = "0.0.0.0"; exports.port = process.env.PORT || 9001; /** + * Should we suppress Error messages from being in Pad Contents + */ +exports.suppressErrorsInPadText = false; + +/** * The SSL signed server key and the Certificate Authority's own certificate * default case: ep-lite does *not* use SSL. A signed server key is not required in this case. */ @@ -266,7 +271,11 @@ exports.reloadSettings = function reloadSettings() { { fs.exists(exports.abiword, function(exists) { if (!exists) { - console.error("Abiword does not exist at this path, check your settings file"); + var abiwordError = "Abiword does not exist at this path, check your settings file"; + if(!exports.suppressErrorsInPadText){ + exports.defaultPadText = exports.defaultPadText + "\nError: " + abiwordError + suppressDisableMsg; + } + console.error(abiwordError); exports.abiword = null; } }); @@ -275,11 +284,19 @@ exports.reloadSettings = function reloadSettings() { if(!exports.sessionKey){ // If the secretKey isn't set we also create yet another unique value here exports.sessionKey = randomString(32); - console.warn("You need to set a sessionKey value in settings.json, this will allow your users to reconnect to your Etherpad Instance if your instance restarts"); + var sessionWarning = "You need to set a sessionKey value in settings.json, this will allow your users to reconnect to your Etherpad Instance if your instance restarts"; + if(!exports.suppressErrorsInPadText){ + exports.defaultPadText = exports.defaultPadText + "\nWarning: " + sessionWarning + suppressDisableMsg; + } + console.warn(sessionWarning); } if(exports.dbType === "dirty"){ - console.warn("DirtyDB is used. This is fine for testing but not recommended for production."); + var dirtyWarning = "DirtyDB is used. This is fine for testing but not recommended for production."; + if(!exports.suppressErrorsInPadText){ + exports.defaultPadText = exports.defaultPadText + "\nWarning: " + dirtyWarning + suppressDisableMsg; + } + console.warn(dirtyWarning); } }; |