From 7276f34d90e18397c3c4a6fa461c1d813a63c9cf Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 16 Oct 2021 00:57:26 +0800 Subject: [PATCH] fix reset-password --- server/config.js | 7 +++++++ server/model/monitor.js | 2 +- server/server.js | 7 ++----- 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 server/config.js diff --git a/server/config.js b/server/config.js new file mode 100644 index 000000000..24ccfaa14 --- /dev/null +++ b/server/config.js @@ -0,0 +1,7 @@ +const args = require("args-parser")(process.argv); +const demoMode = args["demo"] || false; + +module.exports = { + args, + demoMode +}; diff --git a/server/model/monitor.js b/server/model/monitor.js index 6ec97372c..4049a9937 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -11,7 +11,7 @@ const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalCli const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); const { Notification } = require("../notification"); -const { demoMode } = require("../server"); +const { demoMode } = require("../config"); const version = require("../../package.json").version; const apicache = require("../modules/apicache"); diff --git a/server/server.js b/server/server.js index c7615cbd1..8d994d3b6 100644 --- a/server/server.js +++ b/server/server.js @@ -1,6 +1,7 @@ console.log("Welcome to Uptime Kuma"); const args = require("args-parser")(process.argv); const { sleep, debug, getRandomInt, genSecret } = require("../src/util"); +const config = require("./config"); debug(args); @@ -8,10 +9,6 @@ if (! process.env.NODE_ENV) { process.env.NODE_ENV = "production"; } -// Demo Mode? -const demoMode = args["demo"] || false; -exports.demoMode = demoMode; - console.log("Node Env: " + process.env.NODE_ENV); console.log("Importing Node libraries"); @@ -84,7 +81,7 @@ const sslCert = process.env.UPTIME_KUMA_SSL_CERT || process.env.SSL_CERT || args */ const testMode = !!args["test"] || false; -if (demoMode) { +if (config.demoMode) { console.log("==== Demo Mode ===="); }