This commit is contained in:
NeuralMiner 2021-10-18 14:35:36 -06:00
parent 572a5300aa
commit 76e7c8b276

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");
@ -93,7 +90,7 @@ const twofa_verification_opts = {
*/ */
const testMode = !!args["test"] || false; const testMode = !!args["test"] || false;
if (demoMode) { if (config.demoMode) {
console.log("==== Demo Mode ===="); console.log("==== Demo Mode ====");
} }
@ -452,7 +449,7 @@ exports.entryPage = "dashboard";
socket.on("setup", async (username, password, callback) => { socket.on("setup", async (username, password, callback) => {
try { try {
if ((await R.count("user")) !== 0) { if ((await R.count("user")) !== 0) {
throw new Error("Uptime Kuma has been initialized. If you want to run setup again, please delete the database."); throw new Error("Uptime Kuma has been setup. If you want to setup again, please delete the database.");
} }
let user = R.dispense("user"); let user = R.dispense("user");
@ -1342,7 +1339,7 @@ async function initDatabase() {
fs.copyFileSync(Database.templatePath, Database.path); fs.copyFileSync(Database.templatePath, Database.path);
} }
console.log("Connecting to the Database"); console.log("Connecting to Database");
await Database.connect(); await Database.connect();
console.log("Connected"); console.log("Connected");
@ -1442,7 +1439,7 @@ async function shutdownFunction(signal) {
} }
function finalFunction() { function finalFunction() {
console.log("Graceful shutdown successful!"); console.log("Graceful shutdown successfully!");
} }
gracefulShutdown(server, { gracefulShutdown(server, {