summaryrefslogtreecommitdiff
path: root/src/node/utils
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-04-06 00:13:38 +0100
committerJohn McLear <john@mclear.co.uk>2015-04-06 00:13:38 +0100
commit3a969f8dd83062c0537d3e7e0eb005bb5a669ef7 (patch)
treec704ec6869e74759388b76bea63cc87c887a306d /src/node/utils
parentb26956be4b7cf9ba20029a690a9933927b421f52 (diff)
downloadetherpad-lite-3a969f8dd83062c0537d3e7e0eb005bb5a669ef7.zip
pass error messages to pad text if shown during startup
Diffstat (limited to 'src/node/utils')
-rw-r--r--src/node/utils/Settings.js25
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);
}
};