From ed64853125bac90df2198127822feef5c453d684 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 12 Jan 2022 01:44:01 +0800 Subject: [PATCH] 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 c1a1057d3..7c3a7eb42 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 25929fc26..868bbd5ef 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 35aeeb500..2264ebea9 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); /**