* 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 nowMs = Date.now();
const idleLogoutSeconds = this.user.isAuthenticated() ? const idleLogoutSeconds = this.user.isAuthenticated() ?
Config().misc.idleLogoutSeconds : Config().users.idleLogoutSeconds :
Config().misc.preAuthIdleLogoutSeconds; Config().users.preAuthIdleLogoutSeconds;
if(nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000)) { if(nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000)) {
this.emit('idle timeout'); this.emit('idle timeout');

View File

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

View File

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

View File

@ -52,11 +52,26 @@
boardName: XXXXX boardName: XXXXX
} }
paths: {
//
// Other paths can also be configured as well,
// but generally unnecessary
//
logs: XXXXX
}
logging: { logging: {
// //
// By default, the system will rotate logs. // Each block here represents a Bunyan style config.
// Remember you can pipe logs through bunyan to pretty-print: // See https://github.com/trentm/node-bunyan#streams
// > tail -F enigma/logs/enigma-bbs.log | enigma/node_modules/bunyan/bin/bunyan //
// Remember you can pipe logs through Bunyan to pretty-print:
// tail -F ./logs/enigma-bbs.log | bunyan
//
// (npm install -g bunyan to get the binary)
//
// We default to a rotating-file stream:
// https://github.com/trentm/node-bunyan#stream-type-rotating-file
// //
rotatingFile: { rotatingFile: {
// If you're having trouble, try setting this to "trace" // If you're having trouble, try setting this to "trace"
@ -156,7 +171,38 @@
// //
web: { web: {
// Set to your public FQDN // Set to your public FQDN
domain: XXXXX domain: another-fine-enigma-bbs.org
// Standard issue "www" folder. Place static content here
staticRoot: XXXXX
//
// This block configures password reset emails. Template files
// support the following variables:
// * %BOARDNAME% : Name of BBS
// * %USERNAME% : Username of whom to reset password
// * %TOKEN% : Reset token
// * %RESET_URL% : In case of email, the link to follow
// for reset. In case of landing page, URL to POST submit reset form.
//
resetPassword: {
}
http: {
port: XXXXX
}
https: {
port: XXXXX
enabled: XXXXX
//
// Note that web browsers will not trust self-signed certs. Look
// into Let's Encrypt and perhaps running ENiGMA behind another
// web server such as Caddy.
//
}
} }
// Ladies and gentlemen, a Gopher server! // Ladies and gentlemen, a Gopher server!
@ -268,14 +314,29 @@
// ENiGMA½ utilizes user groups similar to Windows and *nix. Built in groups // ENiGMA½ utilizes user groups similar to Windows and *nix. Built in groups
// include "users" (for regular users) and "sysops" for +ops. You can add other // include "users" (for regular users) and "sysops" for +ops. You can add other
// groups to the system as well by adding a 'groups' key in this section: // groups to the system as well by adding a 'groups' key in this section:
// groups: [ "leet", "lamerz" ] // groups: [
// "leet", "lamerz"
// ]
//
// //
// Set default group(s) new users should automatically be assigned to // Set default group(s) new users should automatically be assigned to
// defaultGroups : [ "lamerz" ] // defaultGroups : [
// "lamerz"
// ]
//
// Should new users require +op activation? // Should new users require +op activation?
requireActivation: false, requireActivation: false,
// How long pre-authenticated users (have not logged in) can idle
preAuthIdleLogoutSeconds: XXXXX
// How long authenticated users (logged in) can idle
idleLogoutSeconds: XXXXX
// Usernames reserved for applying to your system
newUserNames: []
} }
// Archive files and related // Archive files and related