Move sessionKey setting from settings.json to SESSIONKEY.txt
parent
1d44490dc4
commit
a3ed82ad06
|
@ -15,10 +15,6 @@
|
||||||
"ip": "0.0.0.0",
|
"ip": "0.0.0.0",
|
||||||
"port" : 9001,
|
"port" : 9001,
|
||||||
|
|
||||||
// Session Key, used for reconnecting user sessions
|
|
||||||
// Set this to a secure string at least 10 characters long. Do not share this value.
|
|
||||||
"sessionKey" : "",
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Node native SSL support
|
// Node native SSL support
|
||||||
// this is disabled by default
|
// this is disabled by default
|
||||||
|
|
|
@ -286,13 +286,15 @@ exports.reloadSettings = function reloadSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!exports.sessionKey){ // If the secretKey isn't set we also create yet another unique value here
|
if (!exports.sessionKey) {
|
||||||
exports.sessionKey = randomString(32);
|
try {
|
||||||
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";
|
exports.sessionKey = fs.readFileSync("./SESSIONKEY.txt","utf8");
|
||||||
if(!exports.suppressErrorsInPadText){
|
} catch(e) {
|
||||||
exports.defaultPadText = exports.defaultPadText + "\nWarning: " + sessionWarning + suppressDisableMsg;
|
exports.sessionKey = randomString(32);
|
||||||
|
fs.writeFileSync("./SESSIONKEY.txt",exports.sessionKey,"utf8");
|
||||||
}
|
}
|
||||||
console.warn(sessionWarning);
|
} else {
|
||||||
|
console.warn("Declaring the sessionKey in the settings.json is deprecated. This value is auto-generated now. Please remove the setting from the file.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(exports.dbType === "dirty"){
|
if(exports.dbType === "dirty"){
|
||||||
|
|
Loading…
Reference in New Issue