From 53df9a36e32b6a948f8af0a6ccbb72c1a4ec25a5 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 11 Jan 2022 10:07:00 +0100 Subject: [PATCH 1/4] reintroduce exports.FBSD --- server/util-server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/util-server.js b/server/util-server.js index 35aeeb50..2264ebea 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -15,6 +15,7 @@ const nodeJsUtil = require("util"); exports.WIN = /^win/.test(process.platform); exports.LIN = /^linux/.test(process.platform); exports.MAC = /^darwin/.test(process.platform); +exports.FBSD = /^freebsd/.test(process.platform); exports.BSD = /bsd$/.test(process.platform); /** From 6bda5c6329851ce859e9ff67f1e73df30125b888 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 11 Jan 2022 13:39:45 +0100 Subject: [PATCH 2/4] update comment --- extra/healthcheck.js | 2 +- server/server.js | 2 +- server/util-server.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extra/healthcheck.js b/extra/healthcheck.js index 06c87394..c1a1057d 100644 --- a/extra/healthcheck.js +++ b/extra/healthcheck.js @@ -20,7 +20,7 @@ if (sslKey && sslCert) { // Dual-stack support for (::) let hostname = process.env.UPTIME_KUMA_HOST; -// Also read HOST if not FreeBSD, as HOST is a system environment variable in FreeBSD +// Also read HOST if not *BSD, as HOST is a system environment variable in FreeBSD if (!hostname && !BSD) { hostname = process.env.HOST; } diff --git a/server/server.js b/server/server.js index f4e2b72a..6e82e8dc 100644 --- a/server/server.js +++ b/server/server.js @@ -65,7 +65,7 @@ console.info("Version: " + checkVersion.version); // Dual-stack support for (::) let hostname = process.env.UPTIME_KUMA_HOST || args.host; -// Also read HOST if not FreeBSD, as HOST is a system environment variable in FreeBSD +// Also read HOST if not *BSD, as HOST is a system environment variable in FreeBSD if (!hostname && !FBSD) { hostname = process.env.HOST; } diff --git a/server/util-server.js b/server/util-server.js index 2264ebea..35aeeb50 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -15,7 +15,6 @@ const nodeJsUtil = require("util"); exports.WIN = /^win/.test(process.platform); exports.LIN = /^linux/.test(process.platform); exports.MAC = /^darwin/.test(process.platform); -exports.FBSD = /^freebsd/.test(process.platform); exports.BSD = /bsd$/.test(process.platform); /** From 0f822d3b2a5b6b84e37884003122afcda83692c0 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 11 Jan 2022 13:42:51 +0100 Subject: [PATCH 3/4] FBSD does not exists anymore --- server/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/server.js b/server/server.js index 6e82e8dc..25929fc2 100644 --- a/server/server.js +++ b/server/server.js @@ -66,7 +66,7 @@ console.info("Version: " + checkVersion.version); let hostname = process.env.UPTIME_KUMA_HOST || args.host; // Also read HOST if not *BSD, as HOST is a system environment variable in FreeBSD -if (!hostname && !FBSD) { +if (!hostname && !BSD) { hostname = process.env.HOST; } From ed64853125bac90df2198127822feef5c453d684 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 12 Jan 2022 01:44:01 +0800 Subject: [PATCH 4/4] Keep FBSD, BSD for ping only --- extra/healthcheck.js | 4 ++-- server/server.js | 6 +++--- server/util-server.js | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extra/healthcheck.js b/extra/healthcheck.js index c1a1057d..7c3a7eb4 100644 --- a/extra/healthcheck.js +++ b/extra/healthcheck.js @@ -1,7 +1,7 @@ /* * This script should be run after a period of time (180s), because the server may need some time to prepare. */ -const { BSD } = require("../server/util-server"); +const { FBSD } = require("../server/util-server"); process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; @@ -21,7 +21,7 @@ if (sslKey && sslCert) { let hostname = process.env.UPTIME_KUMA_HOST; // Also read HOST if not *BSD, as HOST is a system environment variable in FreeBSD -if (!hostname && !BSD) { +if (!hostname && !FBSD) { hostname = process.env.HOST; } diff --git a/server/server.js b/server/server.js index 25929fc2..868bbd5e 100644 --- a/server/server.js +++ b/server/server.js @@ -41,7 +41,7 @@ console.log("Importing this project modules"); debug("Importing Monitor"); const Monitor = require("./model/monitor"); debug("Importing Settings"); -const { getSettings, setSettings, setting, initJWTSecret, checkLogin, startUnitTest, BSD, errorLog } = require("./util-server"); +const { getSettings, setSettings, setting, initJWTSecret, checkLogin, startUnitTest, FBSD, errorLog } = require("./util-server"); debug("Importing Notification"); const { Notification } = require("./notification"); @@ -65,8 +65,8 @@ console.info("Version: " + checkVersion.version); // Dual-stack support for (::) let hostname = process.env.UPTIME_KUMA_HOST || args.host; -// Also read HOST if not *BSD, as HOST is a system environment variable in FreeBSD -if (!hostname && !BSD) { +// Also read HOST if not FreeBSD, as HOST is a system environment variable in FreeBSD +if (!hostname && !FBSD) { hostname = process.env.HOST; } diff --git a/server/util-server.js b/server/util-server.js index 35aeeb50..2264ebea 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -15,6 +15,7 @@ const nodeJsUtil = require("util"); exports.WIN = /^win/.test(process.platform); exports.LIN = /^linux/.test(process.platform); exports.MAC = /^darwin/.test(process.platform); +exports.FBSD = /^freebsd/.test(process.platform); exports.BSD = /bsd$/.test(process.platform); /**