mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
add validation to port value parsing
only port configurations that are valid (not isNaN) after parseInt are considered to be used in port variable
This commit is contained in:
parent
2c8d5d28e9
commit
0053a29d10
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,9 @@ if (hostname) {
|
||||||
console.log("Custom hostname: " + hostname);
|
console.log("Custom hostname: " + hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
const port = parseInt(process.env.UPTIME_KUMA_PORT || process.env.PORT || args.port || 3001);
|
const port = [process.env.UPTIME_KUMA_PORT, process.env.PORT, args.port, 3001]
|
||||||
|
.map(portValue => parseInt(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 = process.env.UPTIME_KUMA_SSL_KEY || process.env.SSL_KEY || args["ssl-key"] || undefined;
|
||||||
|
|
Loading…
Reference in a new issue