Drop exports.entryPage fully

This commit is contained in:
Louis Lam 2022-10-08 23:56:58 +08:00
parent 3e699f8ac3
commit ad1a7c255f

View file

@ -127,6 +127,7 @@ const StatusPage = require("./model/status_page");
const { cloudflaredSocketHandler, autoStart: cloudflaredAutoStart, stop: cloudflaredStop } = require("./socket-handlers/cloudflared-socket-handler"); const { cloudflaredSocketHandler, autoStart: cloudflaredAutoStart, stop: cloudflaredStop } = require("./socket-handlers/cloudflared-socket-handler");
const { proxySocketHandler } = require("./socket-handlers/proxy-socket-handler"); const { proxySocketHandler } = require("./socket-handlers/proxy-socket-handler");
const { dockerSocketHandler } = require("./socket-handlers/docker-socket-handler"); const { dockerSocketHandler } = require("./socket-handlers/docker-socket-handler");
const { Settings } = require("./settings");
app.use(express.json()); app.use(express.json());
@ -155,9 +156,7 @@ let needSetup = false;
Database.init(args); Database.init(args);
await initDatabase(testMode); await initDatabase(testMode);
const entryPage = (await getSettings("general"))["entryPage"]; server.entryPage = await Settings.get("entryPage");
exports.entryPage = entryPage;
UptimeKumaServer.getInstance().entryPage = entryPage;
await StatusPage.loadDomainMappingList(); await StatusPage.loadDomainMappingList();
log.info("server", "Adding route"); log.info("server", "Adding route");
@ -178,7 +177,7 @@ let needSetup = false;
log.debug("entry", `Request Domain: ${hostname}`); log.debug("entry", `Request Domain: ${hostname}`);
const uptimeKumaEntryPage = UptimeKumaServer.getInstance().entryPage; const uptimeKumaEntryPage = server.entryPage;
if (hostname in StatusPage.domainMappingList) { if (hostname in StatusPage.domainMappingList) {
log.debug("entry", "This is a status page domain"); log.debug("entry", "This is a status page domain");
@ -1087,8 +1086,7 @@ let needSetup = false;
} }
await setSettings("general", data); await setSettings("general", data);
exports.entryPage = data.entryPage; server.entryPage = data.entryPage;
UptimeKumaServer.getInstance().entryPage = data.entryPage;
callback({ callback({
ok: true, ok: true,