remove nvmrc + validate input

This commit is contained in:
Malachi Soord 2023-11-05 13:50:25 +01:00
parent 727651b4ae
commit 8160930470
No known key found for this signature in database
GPG key ID: C61BEBD6CC542333
2 changed files with 4 additions and 2 deletions

1
.nvmrc
View file

@ -1 +0,0 @@
18.18.2

View file

@ -119,8 +119,11 @@ const cloudflaredToken = args["cloudflared-token"] || process.env.UPTIME_KUMA_CL
const ipsToAllow = process.env.UPTIME_KUMA_IPS_TO_ALLOW || args["ips-to-allow"] || undefined; const ipsToAllow = process.env.UPTIME_KUMA_IPS_TO_ALLOW || args["ips-to-allow"] || undefined;
if (ipsToAllow !== undefined) { if (ipsToAllow !== undefined) {
if (typeof ipsToAllow !== "string") {
log.error("server", "IPs to allow must be a string, " + typeof ipsToAllow + " provided");
process.exit(1);
}
log.info("server", "IPs to allow: " + ipsToAllow); log.info("server", "IPs to allow: " + ipsToAllow);
const ipfilter = require("express-ipfilter").IpFilter; const ipfilter = require("express-ipfilter").IpFilter;
app.use(ipfilter(ipsToAllow.split(","), { mode: "allow" })); app.use(ipfilter(ipsToAllow.split(","), { mode: "allow" }));
} }