* Move idle config to user

* More 'config new' enhancements
This commit is contained in:
Bryan Ashby
2018-11-11 01:00:42 -07:00
parent f592da2645
commit e8e9df767f
4 changed files with 77 additions and 16 deletions

View File

@@ -441,8 +441,8 @@ Client.prototype.startIdleMonitor = function() {
const nowMs = Date.now();
const idleLogoutSeconds = this.user.isAuthenticated() ?
Config().misc.idleLogoutSeconds :
Config().misc.preAuthIdleLogoutSeconds;
Config().users.idleLogoutSeconds :
Config().users.preAuthIdleLogoutSeconds;
if(nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000)) {
this.emit('idle timeout');

View File

@@ -178,6 +178,9 @@ function getDefaultConfig() {
'sysop', 'admin', 'administrator', 'root', 'all',
'areamgr', 'filemgr', 'filefix', 'areafix', 'allfix'
],
preAuthIdleLogoutSeconds : 60 * 3, // 3m
idleLogoutSeconds : 60 * 6, // 6m
},
theme : {
@@ -906,14 +909,7 @@ function getDefaultConfig() {
}
},
misc : {
preAuthIdleLogoutSeconds : 60 * 3, // 3m
idleLogoutSeconds : 60 * 6, // 6m
},
logging : {
level : 'debug',
rotatingFile : { // set to 'disabled' or false to disable
type : 'rotating-file',
fileName : 'enigma-bbs.log',

View File

@@ -37,9 +37,13 @@ function getAnswers(questions, cb) {
const ConfigIncludeKeys = [
'theme',
'users.preAuthIdleLogoutSeconds', 'users.idleLogoutSeconds',
'users.newUserNames',
'paths.logs',
'loginServers',
'contentServers',
'fileBase.areaStoragePrefix',
'logging.rotatingFile',
];
const HJSONStringifyComonOpts = {