diff --git a/package-lock.json b/package-lock.json index 0b9454ae5..3347c1bda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.18.5", "license": "MIT", "dependencies": { - "@louislam/sqlite3": "~15.0.6", + "@louislam/sqlite3": "15.1.2", "args-parser": "~1.3.0", "axios": "~0.27.0", "axios-ntlm": "~1.3.0", @@ -3116,9 +3116,9 @@ "integrity": "sha512-iHHyIRLEfXLqBN+BkyH8u8imMYr4ihRbFDEk8toqTwUECETVQFCTh2U59Sw2oMoRVaS3XRIb7pyCulltq2jFVA==" }, "node_modules/@louislam/sqlite3": { - "version": "15.0.6", - "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.0.6.tgz", - "integrity": "sha512-+HF/4OEy+yakYzJlSPJbLDtf499t0s0eaglXC9y3Oa9OBZ+dKAaTW5+Ft1RCvfUJLFw/oyYjHtMsg9V+7NT05g==", + "version": "15.1.2", + "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.1.2.tgz", + "integrity": "sha512-VRquWrCKKwfOnzwVh6hOud8lHPvv2R7Jic3gyZCL5kiZpNfmJ71DLCV9SNgLaMDloU+mVWymLev8vehlf7xf5g==", "hasInstallScript": true, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.0", @@ -18867,9 +18867,9 @@ "integrity": "sha512-iHHyIRLEfXLqBN+BkyH8u8imMYr4ihRbFDEk8toqTwUECETVQFCTh2U59Sw2oMoRVaS3XRIb7pyCulltq2jFVA==" }, "@louislam/sqlite3": { - "version": "15.0.6", - "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.0.6.tgz", - "integrity": "sha512-+HF/4OEy+yakYzJlSPJbLDtf499t0s0eaglXC9y3Oa9OBZ+dKAaTW5+Ft1RCvfUJLFw/oyYjHtMsg9V+7NT05g==", + "version": "15.1.2", + "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-15.1.2.tgz", + "integrity": "sha512-VRquWrCKKwfOnzwVh6hOud8lHPvv2R7Jic3gyZCL5kiZpNfmJ71DLCV9SNgLaMDloU+mVWymLev8vehlf7xf5g==", "requires": { "@mapbox/node-pre-gyp": "^1.0.0", "node-addon-api": "^4.2.0", diff --git a/package.json b/package.json index eeae4fa26..8c774d71c 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "cypress-open": "concurrently -k -r \"node test/prepare-test-server.js && node server/server.js --port=3002 --data-dir=./data/test/\" \"cypress open --config-file ./config/cypress.config.js\"" }, "dependencies": { - "@louislam/sqlite3": "~15.0.6", + "@louislam/sqlite3": "15.1.2", "args-parser": "~1.3.0", "axios": "~0.27.0", "axios-ntlm": "~1.3.0", diff --git a/server/model/monitor.js b/server/model/monitor.js index d77c55297..43e9e358e 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -537,6 +537,17 @@ class Monitor extends BeanModel { bean.ping = dayjs().valueOf() - startTime; } else if (this.type === "radius") { let startTime = dayjs().valueOf(); + + // Handle monitors that were created before the + // update and as such don't have a value for + // this.port. + let port; + if (this.port == null) { + port = 1812; + } else { + port = this.port; + } + try { const resp = await radius( this.hostname, @@ -544,7 +555,8 @@ class Monitor extends BeanModel { this.radiusPassword, this.radiusCalledStationId, this.radiusCallingStationId, - this.radiusSecret + this.radiusSecret, + port ); if (resp.code) { bean.msg = resp.code; diff --git a/server/server.js b/server/server.js index 03b8b6cdc..fb6a0a217 100644 --- a/server/server.js +++ b/server/server.js @@ -135,6 +135,7 @@ const { cloudflaredSocketHandler, autoStart: cloudflaredAutoStart, stop: cloudfl const { proxySocketHandler } = require("./socket-handlers/proxy-socket-handler"); const { dockerSocketHandler } = require("./socket-handlers/docker-socket-handler"); const { maintenanceSocketHandler } = require("./socket-handlers/maintenance-socket-handler"); +const { Settings } = require("./settings"); app.use(express.json()); @@ -164,7 +165,7 @@ let needSetup = false; await initDatabase(testMode); await server.initAfterDatabaseReady(); - exports.entryPage = await setting("entryPage"); + server.entryPage = await Settings.get("entryPage"); await StatusPage.loadDomainMappingList(); log.info("server", "Adding route"); @@ -185,14 +186,15 @@ let needSetup = false; log.debug("entry", `Request Domain: ${hostname}`); + const uptimeKumaEntryPage = server.entryPage; if (hostname in StatusPage.domainMappingList) { log.debug("entry", "This is a status page domain"); let slug = StatusPage.domainMappingList[hostname]; await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug); - } else if (exports.entryPage && exports.entryPage.startsWith("statusPage-")) { - response.redirect("/status/" + exports.entryPage.replace("statusPage-", "")); + } else if (uptimeKumaEntryPage && uptimeKumaEntryPage.startsWith("statusPage-")) { + response.redirect("/status/" + uptimeKumaEntryPage.replace("statusPage-", "")); } else { response.redirect("/dashboard"); @@ -209,7 +211,7 @@ let needSetup = false; // Robots.txt app.get("/robots.txt", async (_request, response) => { let txt = "User-agent: *\nDisallow:"; - if (! await setting("searchEngineIndex")) { + if (!await setting("searchEngineIndex")) { txt += " /"; } response.setHeader("Content-Type", "text/plain"); @@ -1098,7 +1100,7 @@ let needSetup = false; } await setSettings("general", data); - exports.entryPage = data.entryPage; + server.entryPage = data.entryPage; // Also need to apply timezone globally if (data.serverTimezone) { diff --git a/server/util-server.js b/server/util-server.js index ac8bc4885..39adcccd4 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -292,6 +292,17 @@ exports.postgresQuery = function (connectionString, query) { }); }; +/** + * Query radius server + * @param {string} hostname Hostname of radius server + * @param {string} username Username to use + * @param {string} password Password to use + * @param {string} calledStationId ID of called station + * @param {string} callingStationId ID of calling station + * @param {string} secret Secret to use + * @param {number} [port=1812] Port to contact radius server on + * @returns {Promise} + */ exports.radius = function ( hostname, username, @@ -299,9 +310,11 @@ exports.radius = function ( calledStationId, callingStationId, secret, + port = 1812, ) { const client = new radiusClient({ host: hostname, + hostPort: port, dictionaries: [ file ], }); diff --git a/src/components/HiddenInput.vue b/src/components/HiddenInput.vue index 6287af05c..fb86a398c 100644 --- a/src/components/HiddenInput.vue +++ b/src/components/HiddenInput.vue @@ -42,7 +42,7 @@ export default { /** Should the field auto complete */ autocomplete: { type: String, - default: undefined, + default: "new-password", }, /** Is the input required? */ required: { diff --git a/src/components/notifications/ClickSendSMS.vue b/src/components/notifications/ClickSendSMS.vue index dbd4d0aa5..dbaca0452 100644 --- a/src/components/notifications/ClickSendSMS.vue +++ b/src/components/notifications/ClickSendSMS.vue @@ -6,7 +6,7 @@ - +
diff --git a/src/components/notifications/GoAlert.vue b/src/components/notifications/GoAlert.vue index a1465b503..cefb848dd 100644 --- a/src/components/notifications/GoAlert.vue +++ b/src/components/notifications/GoAlert.vue @@ -11,7 +11,7 @@
- +
{{ $t("goAlertIntegrationKeyInfo") }} diff --git a/src/components/notifications/Gotify.vue b/src/components/notifications/Gotify.vue index 5c294f6d7..8b9a8a163 100644 --- a/src/components/notifications/Gotify.vue +++ b/src/components/notifications/Gotify.vue @@ -1,7 +1,7 @@