mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-12 10:13:46 +02: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
@ -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 New Issue
Block a user