mirror of
https://github.com/zoriya/flood.git
synced 2026-05-22 15:11:39 +00:00
config: clarify the env variable option
This commit is contained in:
+8
-1
@@ -207,6 +207,13 @@ if (argv.noauth || argv.auth === 'none') {
|
||||
authMethod = 'none';
|
||||
}
|
||||
|
||||
let allowedPaths = [];
|
||||
if (typeof argv.allowedpath === 'string') {
|
||||
allowedPaths = allowedPaths.concat(argv.allowedpath.split(','));
|
||||
} else if (Array.isArray(argv.allowedpath)) {
|
||||
allowedPaths = allowedPaths.concat(argv.allowedpath);
|
||||
}
|
||||
|
||||
const CONFIG = {
|
||||
baseURI: argv.baseuri,
|
||||
dbCleanInterval: argv.dbclean,
|
||||
@@ -224,7 +231,7 @@ const CONFIG = {
|
||||
ssl: argv.ssl,
|
||||
sslKey: argv.sslkey || path.resolve(path.join(argv.rundir, 'key.pem')),
|
||||
sslCert: argv.sslcert || path.resolve(path.join(argv.rundir, 'fullchain.pem')),
|
||||
allowedPaths: argv.allowedpath ? [].concat(argv.allowedpath) : undefined,
|
||||
allowedPaths: allowedPaths.length > 0 ? allowedPaths : undefined,
|
||||
};
|
||||
|
||||
module.exports = CONFIG;
|
||||
|
||||
Vendored
+3
@@ -10,6 +10,9 @@
|
||||
// Plus, such duplications and conditionals are error-prone.
|
||||
//
|
||||
// Use CLI if you don't want to check and change the config.js whenever Flood is updated.
|
||||
// CLI also supports passing through arguments via environment variables. For example,
|
||||
// env variable FLOOD_OPTION_port=80 is equivalent to argument --port 80. Use ',' to split
|
||||
// for arguments that take multiple inputs such as --allowedpath.
|
||||
|
||||
import type {AuthMethod} from '@shared/schema/Auth';
|
||||
import type {ClientConnectionSettings} from '@shared/schema/ClientConnectionSettings';
|
||||
|
||||
Reference in New Issue
Block a user