mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
change parsing priority for all passed arguments
update all passed args in server.js to prioritize command line, then use env.UPTIME_KUMA_ environment variables, then use the generic environment variable versions env.HOST, env.PORT, env.SSL_KEY, env.SSL_CERT and fall back to default values where applicable
This commit is contained in:
parent
0053a29d10
commit
0bbe157099
1 changed files with 5 additions and 5 deletions
|
@ -65,20 +65,20 @@ console.info("Version: " + checkVersion.version);
|
||||||
// Dual-stack support for (::)
|
// Dual-stack support for (::)
|
||||||
// Also read HOST if not FreeBSD, as HOST is a system environment variable in FreeBSD
|
// Also read HOST if not FreeBSD, as HOST is a system environment variable in FreeBSD
|
||||||
let hostEnv = FBSD ? null : process.env.HOST;
|
let hostEnv = FBSD ? null : process.env.HOST;
|
||||||
let hostname = process.env.UPTIME_KUMA_HOST || args.host || hostEnv;
|
let hostname = args.host || process.env.UPTIME_KUMA_HOST || hostEnv;
|
||||||
|
|
||||||
if (hostname) {
|
if (hostname) {
|
||||||
console.log("Custom hostname: " + hostname);
|
console.log("Custom hostname: " + hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
const port = [process.env.UPTIME_KUMA_PORT, process.env.PORT, args.port, 3001]
|
const port = [args.port, process.env.UPTIME_KUMA_PORT, process.env.PORT, 3001]
|
||||||
.map(portValue => parseInt(portValue))
|
.map(portValue => parseInt(portValue))
|
||||||
.find(portValue => !isNaN(portValue));
|
.find(portValue => !isNaN(portValue));
|
||||||
|
|
||||||
// SSL
|
// SSL
|
||||||
const sslKey = process.env.UPTIME_KUMA_SSL_KEY || process.env.SSL_KEY || args["ssl-key"] || undefined;
|
const sslKey = args["ssl-key"] || process.env.UPTIME_KUMA_SSL_KEY || process.env.SSL_KEY || undefined;
|
||||||
const sslCert = process.env.UPTIME_KUMA_SSL_CERT || process.env.SSL_CERT || args["ssl-cert"] || undefined;
|
const sslCert = args["ssl-cert"] || process.env.UPTIME_KUMA_SSL_CERT || process.env.SSL_CERT || undefined;
|
||||||
const disableFrameSameOrigin = !!process.env.UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN || args["disable-frame-sameorigin"] || false;
|
const disableFrameSameOrigin = args["disable-frame-sameorigin"] || !!process.env.UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN || false;
|
||||||
|
|
||||||
// 2FA / notp verification defaults
|
// 2FA / notp verification defaults
|
||||||
const twofa_verification_opts = {
|
const twofa_verification_opts = {
|
||||||
|
|
Loading…
Reference in a new issue