fix reset-password

This commit is contained in:
Louis Lam 2021-10-16 00:57:26 +08:00
parent f4b8da0a5c
commit 7276f34d90
3 changed files with 10 additions and 6 deletions

7
server/config.js Normal file
View File

@ -0,0 +1,7 @@
const args = require("args-parser")(process.argv);
const demoMode = args["demo"] || false;
module.exports = {
args,
demoMode
};

View File

@ -11,7 +11,7 @@ const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalCli
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const { BeanModel } = require("redbean-node/dist/bean-model"); const { BeanModel } = require("redbean-node/dist/bean-model");
const { Notification } = require("../notification"); const { Notification } = require("../notification");
const { demoMode } = require("../server"); const { demoMode } = require("../config");
const version = require("../../package.json").version; const version = require("../../package.json").version;
const apicache = require("../modules/apicache"); const apicache = require("../modules/apicache");

View File

@ -1,6 +1,7 @@
console.log("Welcome to Uptime Kuma"); console.log("Welcome to Uptime Kuma");
const args = require("args-parser")(process.argv); const args = require("args-parser")(process.argv);
const { sleep, debug, getRandomInt, genSecret } = require("../src/util"); const { sleep, debug, getRandomInt, genSecret } = require("../src/util");
const config = require("./config");
debug(args); debug(args);
@ -8,10 +9,6 @@ if (! process.env.NODE_ENV) {
process.env.NODE_ENV = "production"; 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("Node Env: " + process.env.NODE_ENV);
console.log("Importing Node libraries"); 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; const testMode = !!args["test"] || false;
if (demoMode) { if (config.demoMode) {
console.log("==== Demo Mode ===="); console.log("==== Demo Mode ====");
} }