From 81609304703c7a0000b63ad82fed43dd8c79f1f9 Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Sun, 5 Nov 2023 13:50:25 +0100 Subject: [PATCH] remove nvmrc + validate input --- .nvmrc | 1 - server/server.js | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 87ec8842b..000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18.18.2 diff --git a/server/server.js b/server/server.js index 8931d38e4..8c0af8d53 100644 --- a/server/server.js +++ b/server/server.js @@ -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; 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); - const ipfilter = require("express-ipfilter").IpFilter; app.use(ipfilter(ipsToAllow.split(","), { mode: "allow" })); }