From b0259b559249c979698b9f59891399920bf81070 Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 13 Jan 2022 16:17:07 +0000 Subject: [PATCH 001/171] Added docker container monitor --- db/patch-add-docker-columns.sql | 10 ++++++++++ server/database.js | 1 + server/model/monitor.js | 23 +++++++++++++++++++++++ src/pages/EditMonitor.vue | 19 +++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 db/patch-add-docker-columns.sql diff --git a/db/patch-add-docker-columns.sql b/db/patch-add-docker-columns.sql new file mode 100644 index 00000000..fdde4170 --- /dev/null +++ b/db/patch-add-docker-columns.sql @@ -0,0 +1,10 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +ALTER TABLE monitor + ADD docker_daemon VARCHAR(255); + +ALTER TABLE monitor + ADD docker_container VARCHAR(255); + +COMMIT; diff --git a/server/database.js b/server/database.js index afcace70..536acd19 100644 --- a/server/database.js +++ b/server/database.js @@ -53,6 +53,7 @@ class Database { "patch-2fa-invalidate-used-token.sql": true, "patch-notification_sent_history.sql": true, "patch-monitor-basic-auth.sql": true, + "patch-add-docker-columns.sql": true } /** diff --git a/server/model/monitor.js b/server/model/monitor.js index c4441d63..5683352f 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -77,6 +77,8 @@ class Monitor extends BeanModel { dns_resolve_server: this.dns_resolve_server, dns_last_result: this.dns_last_result, pushToken: this.pushToken, + docker_container: this.docker_container, + docker_daemon: this.docker_daemon, notificationIDList, tags: tags, }; @@ -347,6 +349,27 @@ class Monitor extends BeanModel { throw new Error("Server not found on Steam"); } + } else if (this.type === "docker") { + debug(`[${this.name}] Prepare Options for axios`); + + const options = { + url: `/containers/${this.docker_container}/json`, + headers: { + "Accept": "*/*", + "User-Agent": "Uptime-Kuma/" + version, + }, + socketPath: this.docker_daemon, + httpsAgent: new https.Agent({ + maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) + rejectUnauthorized: ! this.getIgnoreTls(), + }), + }; + + debug(`[${this.name}] Axios Request`); + let res = await axios.request(options); + if (res.data.State.Running) { + bean.status = UP; + } } else { bean.msg = "Unknown Monitor Type"; bean.status = PENDING; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 4b6a920c..8b02a75f 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -32,6 +32,9 @@ + @@ -115,6 +118,20 @@ + + +
+ + +
+ + + +
+ + +
+
@@ -439,6 +456,8 @@ export default { accepted_statuscodes: ["200-299"], dns_resolve_type: "A", dns_resolve_server: "1.1.1.1", + docker_container: "", + docker_daemon: "/var/run/docker.sock" }; for (let i = 0; i < this.$root.notificationList.length; i++) { From c5cc42272f0a72dbbf7c971173ad54fe6a524bf5 Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 13 Jan 2022 18:28:45 +0000 Subject: [PATCH 002/171] Fixing the editing of docker container & adding english translation --- server/model/monitor.js | 1 + server/server.js | 2 ++ src/languages/en.js | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 5683352f..5e32a89d 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -369,6 +369,7 @@ class Monitor extends BeanModel { let res = await axios.request(options); if (res.data.State.Running) { bean.status = UP; + bean.msg = ""; } } else { bean.msg = "Unknown Monitor Type"; diff --git a/server/server.js b/server/server.js index 868bbd5e..7495cfb8 100644 --- a/server/server.js +++ b/server/server.js @@ -588,6 +588,8 @@ exports.entryPage = "dashboard"; bean.dns_resolve_type = monitor.dns_resolve_type; bean.dns_resolve_server = monitor.dns_resolve_server; bean.pushToken = monitor.pushToken; + bean.docker_container = monitor.docker_container; + bean.docker_daemon = monitor.docker_daemon; await R.store(bean); diff --git a/src/languages/en.js b/src/languages/en.js index 47513466..1d56e139 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -351,7 +351,7 @@ export default { serwersmsAPIPassword: "API Password", serwersmsPhoneNumber: "Phone number", serwersmsSenderName: "SMS Sender Name (registered via customer portal)", - "stackfield": "Stackfield", + stackfield: "Stackfield", smtpDkimSettings: "DKIM Settings", smtpDkimDesc: "Please refer to the Nodemailer DKIM {0} for usage.", documentation: "documentation", @@ -361,4 +361,6 @@ export default { smtpDkimHashAlgo: "Hash Algorithm (Optional)", smtpDkimheaderFieldNames: "Header Keys to sign (Optional)", smtpDkimskipFields: "Header Keys not to sign (Optional)", + "Container Name / ID": "Container Name / ID", + "Docker Daemon": "Docker Daemon", }; From 9619d31a05752d878de80d84679d0fec7fa2e117 Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 13 Jan 2022 18:33:01 +0000 Subject: [PATCH 003/171] Adding docker container ability to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f88db5f..f2434b2d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ VPS is sponsored by Uptime Kuma sponsors on [Open Collective](https://opencollec ## ⭐ Features -* Monitoring uptime for HTTP(s) / TCP / HTTP(s) Keyword / Ping / DNS Record / Push / Steam Game Server. +* Monitoring uptime for HTTP(s) / TCP / HTTP(s) Keyword / Ping / DNS Record / Push / Steam Game Server / Docker Containers. * Fancy, Reactive, Fast UI/UX. * Notifications via Telegram, Discord, Gotify, Slack, Pushover, Email (SMTP), and [70+ notification services, click here for the full list](https://github.com/louislam/uptime-kuma/tree/master/src/components/notifications). * 20 second intervals. From 4818bb67d60075b67435922bc3d00236e0bc23ac Mon Sep 17 00:00:00 2001 From: c0derMo Date: Fri, 14 Jan 2022 09:09:37 +0000 Subject: [PATCH 004/171] Added trailing comma, fixed spelling & translation --- server/database.js | 2 +- server/model/monitor.js | 2 +- src/languages/en.js | 1 + src/pages/EditMonitor.vue | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/database.js b/server/database.js index 536acd19..69551bac 100644 --- a/server/database.js +++ b/server/database.js @@ -53,7 +53,7 @@ class Database { "patch-2fa-invalidate-used-token.sql": true, "patch-notification_sent_history.sql": true, "patch-monitor-basic-auth.sql": true, - "patch-add-docker-columns.sql": true + "patch-add-docker-columns.sql": true, } /** diff --git a/server/model/monitor.js b/server/model/monitor.js index 5e32a89d..b75500ec 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -350,7 +350,7 @@ class Monitor extends BeanModel { } } else if (this.type === "docker") { - debug(`[${this.name}] Prepare Options for axios`); + debug(`[${this.name}] Prepare Options for Axios`); const options = { url: `/containers/${this.docker_container}/json`, diff --git a/src/languages/en.js b/src/languages/en.js index 1d56e139..ae9fa526 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -363,4 +363,5 @@ export default { smtpDkimskipFields: "Header Keys not to sign (Optional)", "Container Name / ID": "Container Name / ID", "Docker Daemon": "Docker Daemon", + "Docker Container": "Docker Container", }; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 8b02a75f..86c35ef0 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -33,7 +33,7 @@ Steam Game Server
@@ -457,7 +457,7 @@ export default { dns_resolve_type: "A", dns_resolve_server: "1.1.1.1", docker_container: "", - docker_daemon: "/var/run/docker.sock" + docker_daemon: "/var/run/docker.sock", }; for (let i = 0; i < this.$root.notificationList.length; i++) { From 29df70949d453dc4675eda05d7f107669e1fb3e1 Mon Sep 17 00:00:00 2001 From: c0derMo Date: Sat, 22 Jan 2022 01:57:37 +0000 Subject: [PATCH 005/171] Add ability to connect to daemon via http / tcp for windows compatibility --- db/patch-add-docker-columns.sql | 3 +++ server/model/monitor.js | 8 +++++++- server/server.js | 1 + src/languages/en.js | 3 +++ src/pages/EditMonitor.vue | 15 +++++++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/db/patch-add-docker-columns.sql b/db/patch-add-docker-columns.sql index fdde4170..56475667 100644 --- a/db/patch-add-docker-columns.sql +++ b/db/patch-add-docker-columns.sql @@ -7,4 +7,7 @@ ALTER TABLE monitor ALTER TABLE monitor ADD docker_container VARCHAR(255); +ALTER TABLE monitor + ADD docker_type VARCHAR(255); + COMMIT; diff --git a/server/model/monitor.js b/server/model/monitor.js index b75500ec..d8a4be23 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -79,6 +79,7 @@ class Monitor extends BeanModel { pushToken: this.pushToken, docker_container: this.docker_container, docker_daemon: this.docker_daemon, + docker_type: this.docker_type, notificationIDList, tags: tags, }; @@ -358,13 +359,18 @@ class Monitor extends BeanModel { "Accept": "*/*", "User-Agent": "Uptime-Kuma/" + version, }, - socketPath: this.docker_daemon, httpsAgent: new https.Agent({ maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) rejectUnauthorized: ! this.getIgnoreTls(), }), }; + if (this.docker_type === "socket") { + options.socketPath = this.docker_daemon; + } else if (this.docker_type === "tcp") { + options.baseURL = this.docker_daemon; + } + debug(`[${this.name}] Axios Request`); let res = await axios.request(options); if (res.data.State.Running) { diff --git a/server/server.js b/server/server.js index 7495cfb8..ac68769d 100644 --- a/server/server.js +++ b/server/server.js @@ -590,6 +590,7 @@ exports.entryPage = "dashboard"; bean.pushToken = monitor.pushToken; bean.docker_container = monitor.docker_container; bean.docker_daemon = monitor.docker_daemon; + bean.docker_type = monitor.docker_type; await R.store(bean); diff --git a/src/languages/en.js b/src/languages/en.js index ae9fa526..ade50373 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -364,4 +364,7 @@ export default { "Container Name / ID": "Container Name / ID", "Docker Daemon": "Docker Daemon", "Docker Container": "Docker Container", + "Docker Type": "Connection Type", + docker_socket: "Socket", + docker_tcp: "TCP / HTTP", }; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 86c35ef0..b80b9a26 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -125,6 +125,20 @@ + + +
+ + +
+
@@ -458,6 +472,7 @@ export default { dns_resolve_server: "1.1.1.1", docker_container: "", docker_daemon: "/var/run/docker.sock", + docker_type: "socket", }; for (let i = 0; i < this.$root.notificationList.length; i++) { From 1ac904d6d6260a34d08a29249fb7cc15236ee787 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Sun, 23 Jan 2022 15:22:57 +0100 Subject: [PATCH 006/171] Introduce resend interval if down --- package-lock.json | 4 ++-- package.json | 8 ++++---- server/model/monitor.js | 17 +++++++++++++++++ server/server.js | 7 +++++++ src/pages/EditMonitor.vue | 8 ++++++++ 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc21a63f..5253c3af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "1.11.3", + "version": "1.11.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "1.11.3", + "version": "1.11.4", "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "~1.2.36", diff --git a/package.json b/package.json index 048a5e0a..cd522a31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.11.3", + "version": "1.11.4", "license": "MIT", "repository": { "type": "git", @@ -30,13 +30,13 @@ "build-docker": "npm run build && npm run build-docker-debian && npm run build-docker-alpine", "build-docker-alpine-base": "docker buildx build -f docker/alpine-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base-alpine . --push", "build-docker-debian-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base-debian . --push", - "build-docker-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.11.3-alpine --target release . --push", - "build-docker-debian": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.11.3 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.11.3-debian --target release . --push", + "build-docker-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.11.4-alpine --target release . --push", + "build-docker-debian": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.11.4 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.11.4-debian --target release . --push", "build-docker-nightly": "npm run build && docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly --target nightly . --push", "build-docker-nightly-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly-alpine --target nightly . --push", "build-docker-nightly-amd64": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain", "upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain", - "setup": "git checkout 1.11.3 && npm ci --production && npm run download-dist", + "setup": "git checkout 1.11.4 && npm ci --production && npm run download-dist", "download-dist": "node extra/download-dist.js", "update-version": "node extra/update-version.js", "mark-as-nightly": "node extra/mark-as-nightly.js", diff --git a/server/model/monitor.js b/server/model/monitor.js index c4441d63..eaba61ad 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -68,6 +68,7 @@ class Monitor extends BeanModel { type: this.type, interval: this.interval, retryInterval: this.retryInterval, + resendInterval: this.resendInterval, keyword: this.keyword, ignoreTls: this.getIgnoreTls(), upsideDown: this.isUpsideDown(), @@ -135,6 +136,7 @@ class Monitor extends BeanModel { bean.monitor_id = this.id; bean.time = R.isoDateTime(dayjs.utc()); bean.status = DOWN; + bean.lastNotifiedTime = previousBeat?.lastNotifiedTime || null; // after first update lastNotifiedTime will be undefined if (this.isUpsideDown()) { bean.status = flipStatus(bean.status); @@ -390,12 +392,27 @@ class Monitor extends BeanModel { debug(`[${this.name}] sendNotification`); await Monitor.sendNotification(isFirstBeat, this, bean); + // Set last notified time to now + bean.lastNotifiedTime = dayjs().valueOf(); + // Clear Status Page Cache debug(`[${this.name}] apicache clear`); apicache.clear(); } else { bean.important = false; + + if (bean.status === DOWN && this.resendInterval > 0) { + timeSinceLastNotified = dayjs().valueOf() - (bean.lastNotifiedTime || 0); + if (timeSinceLastNotified >= this.resendInterval) { + // Send notification again, because we are still DOWN + debug(`[${this.name}] sendNotification`); + await Monitor.sendNotification(isFirstBeat, this, bean); + + // Set last notified time to now + bean.lastNotifiedTime = dayjs().valueOf(); + } + } } if (bean.status === UP) { diff --git a/server/server.js b/server/server.js index 153cac4f..5a9cf944 100644 --- a/server/server.js +++ b/server/server.js @@ -588,6 +588,7 @@ exports.entryPage = "dashboard"; bean.basic_auth_pass = monitor.basic_auth_pass; bean.interval = monitor.interval; bean.retryInterval = monitor.retryInterval; + bean.resendInterval = monitor.resendInterval; bean.hostname = monitor.hostname; bean.maxretries = monitor.maxretries; bean.port = monitor.port; @@ -1082,6 +1083,7 @@ exports.entryPage = "dashboard"; let monitorListData = backupData.monitorList; let version17x = compareVersions.compare(backupData.version, "1.7.0", ">="); + let version1114 = compareVersions.compare(backupData.version, "1.11.4", ">="); // If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user" if (importHandle == "overwrite") { @@ -1131,6 +1133,7 @@ exports.entryPage = "dashboard"; // Define default values let retryInterval = 0; + let resendInterval = 0; /* Only replace the default value with the backup file data for the specific version, where it appears the first time @@ -1139,6 +1142,9 @@ exports.entryPage = "dashboard"; if (version17x) { retryInterval = monitorListData[i].retryInterval; } + if (version1114) { + resendInterval = monitorListData[i].resendInterval; + } // --- End --- @@ -1154,6 +1160,7 @@ exports.entryPage = "dashboard"; basic_auth_pass: monitorListData[i].basic_auth_pass, interval: monitorListData[i].interval, retryInterval: retryInterval, + resendInterval: resendInterval, hostname: monitorListData[i].hostname, maxretries: monitorListData[i].maxretries, port: monitorListData[i].port, diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 4b6a920c..b95c1098 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -137,6 +137,14 @@
+
+ + +
+

{{ $t("Advanced") }}

From b69a8b8493e095842bcf7daceaea21110106146a Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Sun, 23 Jan 2022 17:35:53 +0100 Subject: [PATCH 007/171] Fix formatting Co-authored-by: Adam Stachowicz --- server/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/server.js b/server/server.js index 5a9cf944..0ad361ad 100644 --- a/server/server.js +++ b/server/server.js @@ -1142,6 +1142,7 @@ exports.entryPage = "dashboard"; if (version17x) { retryInterval = monitorListData[i].retryInterval; } + if (version1114) { resendInterval = monitorListData[i].resendInterval; } From 65fc71e4858ae61b7e1fb639ca335b8ad4f22ca4 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Sun, 23 Jan 2022 17:34:39 +0100 Subject: [PATCH 008/171] Revert version change --- package-lock.json | 4 ++-- package.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5253c3af..fc21a63f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "1.11.4", + "version": "1.11.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "1.11.4", + "version": "1.11.3", "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "~1.2.36", diff --git a/package.json b/package.json index cd522a31..048a5e0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.11.4", + "version": "1.11.3", "license": "MIT", "repository": { "type": "git", @@ -30,13 +30,13 @@ "build-docker": "npm run build && npm run build-docker-debian && npm run build-docker-alpine", "build-docker-alpine-base": "docker buildx build -f docker/alpine-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base-alpine . --push", "build-docker-debian-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base-debian . --push", - "build-docker-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.11.4-alpine --target release . --push", - "build-docker-debian": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.11.4 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.11.4-debian --target release . --push", + "build-docker-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.11.3-alpine --target release . --push", + "build-docker-debian": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.11.3 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.11.3-debian --target release . --push", "build-docker-nightly": "npm run build && docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly --target nightly . --push", "build-docker-nightly-alpine": "docker buildx build -f docker/dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly-alpine --target nightly . --push", "build-docker-nightly-amd64": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain", "upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain", - "setup": "git checkout 1.11.4 && npm ci --production && npm run download-dist", + "setup": "git checkout 1.11.3 && npm ci --production && npm run download-dist", "download-dist": "node extra/download-dist.js", "update-version": "node extra/update-version.js", "mark-as-nightly": "node extra/mark-as-nightly.js", From 11e9eee09d45996d476168d8c646962eb6104bd1 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Sun, 23 Jan 2022 17:48:09 +0100 Subject: [PATCH 009/171] Change seconds to minutes --- server/model/monitor.js | 2 +- src/languages/en.js | 1 + src/pages/EditMonitor.vue | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index eaba61ad..f4803355 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -403,7 +403,7 @@ class Monitor extends BeanModel { bean.important = false; if (bean.status === DOWN && this.resendInterval > 0) { - timeSinceLastNotified = dayjs().valueOf() - (bean.lastNotifiedTime || 0); + timeSinceLastNotified = (dayjs().valueOf() - (bean.lastNotifiedTime || 0)) / 60; // divide by 60 to convert from seconds to minutes if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN debug(`[${this.name}] sendNotification`); diff --git a/src/languages/en.js b/src/languages/en.js index 47513466..21e215f7 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -2,6 +2,7 @@ export default { languageName: "English", checkEverySecond: "Check every {0} seconds", retryCheckEverySecond: "Retry every {0} seconds", + resendEveryMinute: "Resend every {0} minutes if DOWN", retriesDescription: "Maximum retries before the service is marked as down and a notification is sent", ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites", upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index b95c1098..3b4cbcf1 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -140,7 +140,7 @@
@@ -439,6 +439,7 @@ export default { method: "GET", interval: 60, retryInterval: this.interval, + resendInterval: 0, maxretries: 0, notificationIDList: {}, ignoreTls: false, From f931e709e638f0720309d1c59cbf17fe34b622a1 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 09:18:12 +0100 Subject: [PATCH 010/171] Add database patch --- db/patch-monitor-add-resend-interval.sql | 7 +++++++ server/database.js | 1 + 2 files changed, 8 insertions(+) create mode 100644 db/patch-monitor-add-resend-interval.sql diff --git a/db/patch-monitor-add-resend-interval.sql b/db/patch-monitor-add-resend-interval.sql new file mode 100644 index 00000000..e8bb08b8 --- /dev/null +++ b/db/patch-monitor-add-resend-interval.sql @@ -0,0 +1,7 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +ALTER TABLE monitor + ADD resend_interval INTEGER default 0 not null; + +COMMIT; diff --git a/server/database.js b/server/database.js index afcace70..ce4d5089 100644 --- a/server/database.js +++ b/server/database.js @@ -53,6 +53,7 @@ class Database { "patch-2fa-invalidate-used-token.sql": true, "patch-notification_sent_history.sql": true, "patch-monitor-basic-auth.sql": true, + "patch-monitor-add-resend-interval.sql": true, } /** From 8c4ab9d652d931c44ffbc434c4d8599ee2aa5cd3 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 09:18:22 +0100 Subject: [PATCH 011/171] Simplify --- src/languages/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 21e215f7..33ad0a42 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -2,7 +2,7 @@ export default { languageName: "English", checkEverySecond: "Check every {0} seconds", retryCheckEverySecond: "Retry every {0} seconds", - resendEveryMinute: "Resend every {0} minutes if DOWN", + resendEveryMinute: "Resend every {0} minutes", retriesDescription: "Maximum retries before the service is marked as down and a notification is sent", ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites", upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.", From 30ce53f57c3ada92b700c14cba6be822f687ee55 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 09:18:38 +0100 Subject: [PATCH 012/171] Fix min value of resend interval --- src/pages/EditMonitor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 3b4cbcf1..a297c54b 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -142,7 +142,7 @@ {{ $t("Notification resend Interval if Down") }} ({{ $t("resendEveryMinute", [ monitor.resendInterval ]) }}) - +

{{ $t("Advanced") }}

From f390a8caf1fea00348a3245b4c79d4315c125f3a Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 21:59:25 +0100 Subject: [PATCH 013/171] Fix missing DB patch and use DATETIME as column format --- db/patch-heartbeat-add-last-notified-time.sql | 7 +++++++ server/database.js | 1 + server/model/monitor.js | 10 +++++----- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 db/patch-heartbeat-add-last-notified-time.sql diff --git a/db/patch-heartbeat-add-last-notified-time.sql b/db/patch-heartbeat-add-last-notified-time.sql new file mode 100644 index 00000000..af9c21c0 --- /dev/null +++ b/db/patch-heartbeat-add-last-notified-time.sql @@ -0,0 +1,7 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +ALTER TABLE heartbeat + ADD last_notified_time DATETIME default null; + +COMMIT; diff --git a/server/database.js b/server/database.js index ce4d5089..0aae8ffc 100644 --- a/server/database.js +++ b/server/database.js @@ -54,6 +54,7 @@ class Database { "patch-notification_sent_history.sql": true, "patch-monitor-basic-auth.sql": true, "patch-monitor-add-resend-interval.sql": true, + "patch-heartbeat-add-last-notified-time.sql": true, } /** diff --git a/server/model/monitor.js b/server/model/monitor.js index f4803355..85a0e944 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -136,7 +136,7 @@ class Monitor extends BeanModel { bean.monitor_id = this.id; bean.time = R.isoDateTime(dayjs.utc()); bean.status = DOWN; - bean.lastNotifiedTime = previousBeat?.lastNotifiedTime || null; // after first update lastNotifiedTime will be undefined + bean.lastNotifiedTime = previousBeat?.lastNotifiedTime; if (this.isUpsideDown()) { bean.status = flipStatus(bean.status); @@ -393,7 +393,7 @@ class Monitor extends BeanModel { await Monitor.sendNotification(isFirstBeat, this, bean); // Set last notified time to now - bean.lastNotifiedTime = dayjs().valueOf(); + bean.lastNotifiedTime = R.isoDateTime(dayjs.utc()); // Clear Status Page Cache debug(`[${this.name}] apicache clear`); @@ -403,14 +403,14 @@ class Monitor extends BeanModel { bean.important = false; if (bean.status === DOWN && this.resendInterval > 0) { - timeSinceLastNotified = (dayjs().valueOf() - (bean.lastNotifiedTime || 0)) / 60; // divide by 60 to convert from seconds to minutes + let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN - debug(`[${this.name}] sendNotification`); + debug(`[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); await Monitor.sendNotification(isFirstBeat, this, bean); // Set last notified time to now - bean.lastNotifiedTime = dayjs().valueOf(); + bean.lastNotifiedTime = R.isoDateTime(dayjs.utc()); } } } From 855b12f435ca87059c2797b8695418947fc9b73e Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 22:20:38 +0100 Subject: [PATCH 014/171] Add text for resend disabled --- src/languages/en.js | 1 + src/pages/EditMonitor.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 33ad0a42..17a58543 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -3,6 +3,7 @@ export default { checkEverySecond: "Check every {0} seconds", retryCheckEverySecond: "Retry every {0} seconds", resendEveryMinute: "Resend every {0} minutes", + resendDisabled: "Resend disabled", retriesDescription: "Maximum retries before the service is marked as down and a notification is sent", ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites", upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index a297c54b..a7bc4f78 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -140,7 +140,8 @@
From d446a57d42613490c6bd5a6bec075b289ff3caef Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Mon, 24 Jan 2022 22:20:48 +0100 Subject: [PATCH 015/171] Add german translation --- src/languages/de-DE.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 48cdd2e3..9286a09b 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -164,6 +164,8 @@ export default { "Search...": "Suchen...", "Heartbeat Retry Interval": "Heartbeat-Wiederholungsintervall", retryCheckEverySecond: "Versuche alle {0} Sekunden", + resendEveryMinute: "Erneut versenden alle {0} Minuten", + resendDisabled: "Erneut versenden deaktiviert", "Import Backup": "Backup importieren", "Export Backup": "Backup exportieren", "Avg. Ping": "Durchschn. Ping", From d8013f31e8906aeb0188725353392581621cd121 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Sun, 27 Mar 2022 21:24:41 +0200 Subject: [PATCH 016/171] Update version after merging new master branch --- server/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.js b/server/server.js index e10df8cc..36b8590f 100644 --- a/server/server.js +++ b/server/server.js @@ -1087,7 +1087,7 @@ exports.entryPage = "dashboard"; let monitorListData = backupData.monitorList; let version17x = compareVersions.compare(backupData.version, "1.7.0", ">="); - let version1114 = compareVersions.compare(backupData.version, "1.11.4", ">="); + let version1132 = compareVersions.compare(backupData.version, "1.13.2", ">="); // If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user" if (importHandle == "overwrite") { @@ -1147,7 +1147,7 @@ exports.entryPage = "dashboard"; retryInterval = monitorListData[i].retryInterval; } - if (version1114) { + if (version1132) { resendInterval = monitorListData[i].resendInterval; } From 84a0b24448fc06f791bf4555fb2db8cd384c815b Mon Sep 17 00:00:00 2001 From: Moritz R Date: Sun, 3 Apr 2022 17:15:21 +0200 Subject: [PATCH 017/171] Update server/model/monitor.js As per recommendation of @Computroniks Co-authored-by: Matthew Nickson --- server/model/monitor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/model/monitor.js b/server/model/monitor.js index d8a4be23..c9b697d0 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -377,6 +377,7 @@ class Monitor extends BeanModel { bean.status = UP; bean.msg = ""; } + } else { bean.msg = "Unknown Monitor Type"; bean.status = PENDING; From 60f8ab7285fc0b3c1dfca5c8857807ba270e9956 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 12:09:59 +0200 Subject: [PATCH 018/171] Use new logging mechanism --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index a7e0b82f..0ac2e33e 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -473,7 +473,7 @@ class Monitor extends BeanModel { let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN - debug(`[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); + log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); await Monitor.sendNotification(isFirstBeat, this, bean); // Set last notified time to now From 19933bbd99d7e11dba97e61183051dc876b9581e Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 12:18:15 +0200 Subject: [PATCH 019/171] Improve backwards compatibility --- server/server.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/server.js b/server/server.js index d53fe696..58c08f9d 100644 --- a/server/server.js +++ b/server/server.js @@ -1168,7 +1168,6 @@ try { let monitorListData = backupData.monitorList; let version17x = compareVersions.compare(backupData.version, "1.7.0", ">="); - let version1132 = compareVersions.compare(backupData.version, "1.13.2", ">="); // If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user" if (importHandle == "overwrite") { @@ -1237,7 +1236,6 @@ try { // Define default values let retryInterval = 0; - let resendInterval = 0; /* Only replace the default value with the backup file data for the specific version, where it appears the first time @@ -1247,10 +1245,6 @@ try { retryInterval = monitorListData[i].retryInterval; } - if (version1132) { - resendInterval = monitorListData[i].resendInterval; - } - // --- End --- let monitor = { @@ -1265,7 +1259,7 @@ try { basic_auth_pass: monitorListData[i].basic_auth_pass, interval: monitorListData[i].interval, retryInterval: retryInterval, - resendInterval: resendInterval, + resendInterval: monitorListData[i].resendInterval || 0, hostname: monitorListData[i].hostname, maxretries: monitorListData[i].maxretries, port: monitorListData[i].port, From d6b591a513cb928c9173dab0b9042922a4b3df49 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 17:45:58 +0200 Subject: [PATCH 020/171] Make comment more readable Co-authored-by: Matthew Nickson --- server/model/monitor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 0ac2e33e..1383153e 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -470,7 +470,8 @@ class Monitor extends BeanModel { bean.important = false; if (bean.status === DOWN && this.resendInterval > 0) { - let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes + // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes + let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); From 052fde5a24daa70855082c4ed9ba362c3785e463 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 17:56:38 +0200 Subject: [PATCH 021/171] Fix casing of text label Co-authored-by: Matthew Nickson --- src/pages/EditMonitor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 4338b4ea..661a89c4 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -172,7 +172,7 @@
From c7ec9a07e248a730095e725c870f8396dfaa2296 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 17:59:38 +0200 Subject: [PATCH 022/171] Add translation for text label --- src/languages/de-DE.js | 1 + src/languages/en.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index ae28bf5b..5af4c8a1 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -163,6 +163,7 @@ export default { Pink: "Pink", "Search...": "Suchen...", "Heartbeat Retry Interval": "Überprüfungsintervall", + "Notification resend interval if down": "Benachrichtigung erneut versenden wenn Inaktiv", retryCheckEverySecond: "Alle {0} Sekunden neu versuchen", resendEveryMinute: "Erneut versenden alle {0} Minuten", resendDisabled: "Erneut versenden deaktiviert", diff --git a/src/languages/en.js b/src/languages/en.js index 7726d12f..a3a375f3 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -74,6 +74,7 @@ export default { "Heartbeat Interval": "Heartbeat Interval", Retries: "Retries", "Heartbeat Retry Interval": "Heartbeat Retry Interval", + "Notification resend interval if down": "Notification resend interval if down", Advanced: "Advanced", "Upside Down Mode": "Upside Down Mode", "Max. Redirects": "Max. Redirects", From 7ed8ae9f7cc35e24c29bab087c5324d764bf67dc Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 21 Apr 2022 18:23:32 +0200 Subject: [PATCH 023/171] Fix trailing space warning --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 1383153e..84b211b8 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -471,7 +471,7 @@ class Monitor extends BeanModel { if (bean.status === DOWN && this.resendInterval > 0) { // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes - let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; + let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); From 98ee9caf2cdc54a2f5edb864906d620e84196317 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 5 May 2022 15:55:33 +0200 Subject: [PATCH 024/171] Add variable for currentTime Co-authored-by: Adam Stachowicz --- server/model/monitor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 15181af6..f29f6de5 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -492,11 +492,12 @@ class Monitor extends BeanModel { let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; if (timeSinceLastNotified >= this.resendInterval) { // Send notification again, because we are still DOWN - log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${R.isoDateTime(dayjs.utc())}`); + const currentTime = R.isoDateTime(dayjs.utc()); + log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${currentTime}`); await Monitor.sendNotification(isFirstBeat, this, bean); // Set last notified time to now - bean.lastNotifiedTime = R.isoDateTime(dayjs.utc()); + bean.lastNotifiedTime = currentTime; } } } From 93050208bbe9eb1c5678bf609c18e47953fb8485 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Thu, 5 May 2022 16:01:10 +0200 Subject: [PATCH 025/171] Merge database changes into single patch file --- db/patch-heartbeat-add-last-notified-time.sql | 7 ------- db/patch-monitor-add-resend-interval.sql | 3 +++ server/database.js | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 db/patch-heartbeat-add-last-notified-time.sql diff --git a/db/patch-heartbeat-add-last-notified-time.sql b/db/patch-heartbeat-add-last-notified-time.sql deleted file mode 100644 index af9c21c0..00000000 --- a/db/patch-heartbeat-add-last-notified-time.sql +++ /dev/null @@ -1,7 +0,0 @@ --- You should not modify if this have pushed to Github, unless it does serious wrong with the db. -BEGIN TRANSACTION; - -ALTER TABLE heartbeat - ADD last_notified_time DATETIME default null; - -COMMIT; diff --git a/db/patch-monitor-add-resend-interval.sql b/db/patch-monitor-add-resend-interval.sql index e8bb08b8..c31dd7a2 100644 --- a/db/patch-monitor-add-resend-interval.sql +++ b/db/patch-monitor-add-resend-interval.sql @@ -4,4 +4,7 @@ BEGIN TRANSACTION; ALTER TABLE monitor ADD resend_interval INTEGER default 0 not null; +ALTER TABLE heartbeat + ADD last_notified_time DATETIME default null; + COMMIT; diff --git a/server/database.js b/server/database.js index 8e3b188b..5dbfd676 100644 --- a/server/database.js +++ b/server/database.js @@ -59,7 +59,6 @@ class Database { "patch-status-page-footer-css.sql": true, "patch-added-mqtt-monitor.sql": true, "patch-monitor-add-resend-interval.sql": true, - "patch-heartbeat-add-last-notified-time.sql": true, }; /** From 398ecb76667710731bc065f35b78706125fc8077 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Thu, 12 May 2022 11:48:38 +0200 Subject: [PATCH 026/171] add radius check --- db/patch-add-radius-monitor.sql | 18 ++++++++++++++++ package.json | 1 + server/database.js | 1 + server/model/monitor.js | 33 +++++++++++++++++++++++++++-- server/server.js | 5 +++++ server/util-server.js | 30 ++++++++++++++++++++++++++ src/languages/en.js | 6 ++++++ src/pages/EditMonitor.vue | 37 +++++++++++++++++++++++++++++++-- 8 files changed, 127 insertions(+), 4 deletions(-) create mode 100644 db/patch-add-radius-monitor.sql diff --git a/db/patch-add-radius-monitor.sql b/db/patch-add-radius-monitor.sql new file mode 100644 index 00000000..1fd5b44f --- /dev/null +++ b/db/patch-add-radius-monitor.sql @@ -0,0 +1,18 @@ +BEGIN TRANSACTION; + +ALTER TABLE monitor + ADD radius_username VARCHAR(255); + +ALTER TABLE monitor + ADD radius_password VARCHAR(255); + +ALTER TABLE monitor + ADD radius_calling_station_id VARCHAR(50); + +ALTER TABLE monitor + ADD radius_called_station_id VARCHAR(50); + +ALTER TABLE monitor + ADD radius_secret VARCHAR(255); + +COMMIT diff --git a/package.json b/package.json index e9b7003b..304a466e 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "limiter": "^2.1.0", "mqtt": "^4.2.8", "node-cloudflared-tunnel": "~1.0.9", + "node-radius-client": "^1.0.0", "nodemailer": "~6.6.5", "notp": "~2.0.3", "password-hash": "~1.2.2", diff --git a/server/database.js b/server/database.js index b17e7f4e..4ce509f3 100644 --- a/server/database.js +++ b/server/database.js @@ -58,6 +58,7 @@ class Database { "patch-monitor-expiry-notification.sql": true, "patch-status-page-footer-css.sql": true, "patch-added-mqtt-monitor.sql": true, + "patch-add-radius-monitor.sql": true, }; /** diff --git a/server/model/monitor.js b/server/model/monitor.js index f2d16524..0b8fade4 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -7,7 +7,7 @@ dayjs.extend(timezone); const axios = require("axios"); const { Prometheus } = require("../prometheus"); const { log, UP, DOWN, PENDING, flipStatus, TimeLogger } = require("../../src/util"); -const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mqttAsync } = require("../util-server"); +const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, radius, setting, mqttAsync } = require("../util-server"); const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); const { Notification } = require("../notification"); @@ -87,7 +87,12 @@ class Monitor extends BeanModel { mqttUsername: this.mqttUsername, mqttPassword: this.mqttPassword, mqttTopic: this.mqttTopic, - mqttSuccessMessage: this.mqttSuccessMessage + mqttSuccessMessage: this.mqttSuccessMessage, + radiusUsername: this.radiusUsername, + radiusPassword: this.radiusPassword, + radiusCalledStationId: this.radiusCalledStationId, + radiusCallingStationId: this.radiusCallingStationId, + radiusSecret: this.radiusSecret }; if (includeSensitiveData) { @@ -435,6 +440,30 @@ class Monitor extends BeanModel { interval: this.interval, }); bean.status = UP; + } else if (this.type === "radius") { + let startTime = dayjs().valueOf(); + try { + const resp = await radius( + this.hostname, + this.radiusUsername, + this.radiusPassword, + this.radiusCalledStationId, + this.radiusCallingStationId, + this.radiusSecret + ); + if (resp.code) { + bean.msg = resp.code; + } + bean.status = UP; + } catch (error) { + bean.status = DOWN; + if (error.response?.code) { + bean.msg = error.response.code; + } else { + bean.msg = error.message; + } + } + bean.ping = dayjs().valueOf() - startTime; } else { bean.msg = "Unknown Monitor Type"; bean.status = PENDING; diff --git a/server/server.js b/server/server.js index 79cb2102..55b10816 100644 --- a/server/server.js +++ b/server/server.js @@ -674,6 +674,11 @@ try { bean.mqttPassword = monitor.mqttPassword; bean.mqttTopic = monitor.mqttTopic; bean.mqttSuccessMessage = monitor.mqttSuccessMessage; + bean.radiusUsername = monitor.radiusUsername; + bean.radiusPassword = monitor.radiusPassword; + bean.radiusCalledStationId = monitor.radiusCalledStationId; + bean.radiusCallingStationId = monitor.radiusCallingStationId; + bean.radiusSecret = monitor.radiusSecret; await R.store(bean); diff --git a/server/util-server.js b/server/util-server.js index 54974e14..5dd81e00 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -10,6 +10,12 @@ const chardet = require("chardet"); const mqtt = require("mqtt"); const chroma = require("chroma-js"); const { badgeConstants } = require("./config"); +const radiusClient = require("node-radius-client"); +const { + dictionaries: { + rfc2865: { file, attributes }, + }, +} = require("node-radius-utils"); // From ping-lite exports.WIN = /^win/.test(process.platform); @@ -203,6 +209,30 @@ exports.dnsResolve = function (hostname, resolverServer, rrtype) { }); }; +exports.radius = function ( + hostname, + username, + password, + calledStationId, + callingStationId, + secret, +) { + const client = new radiusClient({ + host: hostname, + dictionaries: [ file ], + }); + + return client.accessRequest({ + secret: secret, + attributes: [ + [ attributes.USER_NAME, username ], + [ attributes.USER_PASSWORD, password ], + [ attributes.CALLING_STATION_ID, callingStationId ], + [ attributes.CALLED_STATION_ID, calledStationId ], + ], + }); +}; + /** * Retrieve value of setting based on key * @param {string} key Key of setting to retrieve diff --git a/src/languages/en.js b/src/languages/en.js index ab73ce35..13826453 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -464,4 +464,10 @@ export default { "Domain Names": "Domain Names", signedInDisp: "Signed in as {0}", signedInDispDisabled: "Auth Disabled.", + RadiusSecret: "Radius Secret", + RadiusSecretDescription: "Shared Secret between client and server", + RadiusCalledStationId: "Called Station Id", + RadiusCalledStationIdDescription: "Identifier of the called device", + RadiusCallingStationId: "Calling Station Id", + RadiusCallingStationIdDescription: "Identifier of the calling device", }; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 43f34527..e2beaca1 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -35,6 +35,9 @@ +
@@ -70,8 +73,8 @@ - -
+ +
@@ -148,6 +151,36 @@
+ +
From 42d68edab07881e4d9ffe88349c8de2a0db85b1f Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Wed, 18 May 2022 15:55:36 +0200 Subject: [PATCH 027/171] (style) add trailing comma Co-authored-by: Adam Stachowicz --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 0b8fade4..71b4255c 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -92,7 +92,7 @@ class Monitor extends BeanModel { radiusPassword: this.radiusPassword, radiusCalledStationId: this.radiusCalledStationId, radiusCallingStationId: this.radiusCallingStationId, - radiusSecret: this.radiusSecret + radiusSecret: this.radiusSecret, }; if (includeSensitiveData) { From 32cfd411f87ed98bd3247a7751b2f4791fbd388e Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 19 May 2022 12:35:55 +0000 Subject: [PATCH 028/171] Fixed style & code errors --- server/model/monitor.js | 4 ++-- src/pages/EditMonitor.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index c7e2cd31..2bc40b5f 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -429,7 +429,7 @@ class Monitor extends BeanModel { throw new Error("Server not found on Steam"); } } else if (this.type === "docker") { - debug(`[${this.name}] Prepare Options for Axios`); + log.debug(`[${this.name}] Prepare Options for Axios`); const options = { url: `/containers/${this.docker_container}/json`, @@ -449,7 +449,7 @@ class Monitor extends BeanModel { options.baseURL = this.docker_daemon; } - debug(`[${this.name}] Axios Request`); + log.debug(`[${this.name}] Axios Request`); let res = await axios.request(options); if (res.data.State.Running) { bean.status = UP; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 56c9ac92..1d156883 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -120,7 +120,7 @@
- +
From 54548e34edfa17fd5930901dd66c48ce6b28684a Mon Sep 17 00:00:00 2001 From: Wooferz <85282355+woooferz@users.noreply.github.com> Date: Wed, 8 Jun 2022 20:05:10 +1000 Subject: [PATCH 029/171] Added label to status badge --- server/routers/api-router.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 201efc41..d71f903a 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -136,6 +136,7 @@ router.get("/api/badge/:id/status", cache("5 minutes"), async (request, response const heartbeat = await Monitor.getPreviousHeartbeat(requestedMonitorId); const state = overrideValue !== undefined ? overrideValue : heartbeat.status === 1; + badgeValues.label = label ? label : ""; badgeValues.color = state ? upColor : downColor; badgeValues.message = label ?? state ? upLabel : downLabel; } From 817c941489efabe35ac08ed6a6e9158e424617fe Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Sun, 12 Jun 2022 22:30:42 +0800 Subject: [PATCH 030/171] Add Bark Notification Parameters --- server/notification-providers/bark.js | 15 +++- src/components/notifications/Bark.vue | 106 ++++++++++++++++++++++++++ src/languages/bg-BG.js | 2 + src/languages/de-DE.js | 2 + src/languages/en.js | 2 + src/languages/ko-KR.js | 2 + src/languages/nl-NL.js | 2 + src/languages/pl.js | 2 + src/languages/th-TH.js | 2 + src/languages/tr-TR.js | 2 + src/languages/vi-VN.js | 2 + src/languages/zh-CN.js | 2 + src/languages/zh-TW.js | 2 + 13 files changed, 140 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index 092511d8..a2c4966a 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -12,9 +12,7 @@ const { default: axios } = require("axios"); // bark is an APN bridge that sends notifications to Apple devices. -const barkNotificationGroup = "UptimeKuma"; const barkNotificationAvatar = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png"; -const barkNotificationSound = "telegraph"; const successMessage = "Successes!"; class Bark extends NotificationProvider { @@ -53,10 +51,21 @@ class Bark extends NotificationProvider { appendAdditionalParameters(postUrl) { // grouping all our notifications postUrl += "?group=" + barkNotificationGroup; + if (notification.barkGroup != null) { + postUrl += "&group=" + notification.barkGroup; + } else { + postUrl += "&group=" + "UptimeKuma"; + // default group + } // set icon to uptime kuma icon, 11kb should be fine postUrl += "&icon=" + barkNotificationAvatar; // picked a sound, this should follow system's mute status when arrival - postUrl += "&sound=" + barkNotificationSound; + if (notification.barkSound != null) { + postUrl += "&sound=" + notification.barkSound; + } else { + postUrl += "&sound=" + "telegraph"; + // default sound + } return postUrl; } diff --git a/src/components/notifications/Bark.vue b/src/components/notifications/Bark.vue index 014450de..70e4322d 100644 --- a/src/components/notifications/Bark.vue +++ b/src/components/notifications/Bark.vue @@ -12,4 +12,110 @@ >{{ $t("here") }}
+
+ + +
+
+ + + +
diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index 6297062a..23b1b726 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -389,6 +389,8 @@ export default { SignName: "Знак име", "Sms template must contain parameters: ": "SMS шаблонът трябва да съдържа следните параметри: ", "Bark Endpoint": "Bark крайна точка", + "Bark Group": "Bark група", + "Bark Sound": "Bark Звънене", WebHookUrl: "URL адрес на уеб кука", SecretKey: "Таен ключ", "For safety, must use secret key": "За сигурност, трябва да се използва таен ключ", diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index e679937c..aeba230f 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -389,6 +389,8 @@ export default { SignName: "Signaturname", "Sms template must contain parameters: ": "SMS Vorlage muss folgende Parameter enthalten: ", "Bark Endpoint": "Bark Endpunkt", + "Bark Group": "Bark Gruppe", + "Bark Sound": "Bark Klingelton", WebHookUrl: "Webhook URL", SecretKey: "Geheimer Schlüssel", "For safety, must use secret key": "Zur Sicherheit muss ein geheimer Schlüssel verwendet werden", diff --git a/src/languages/en.js b/src/languages/en.js index aa6737dd..4b8f782f 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -406,6 +406,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms template must contain parameters: ", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "For safety, must use secret key", diff --git a/src/languages/ko-KR.js b/src/languages/ko-KR.js index da034167..0ed7a6f2 100644 --- a/src/languages/ko-KR.js +++ b/src/languages/ko-KR.js @@ -406,6 +406,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms 템플릿은 다음과 같은 파라미터가 포함되어야 해요:", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "웹훅 URL", SecretKey: "Secret Key", "For safety, must use secret key": "안전을 위해 꼭 Secret Key를 사용하세요.", diff --git a/src/languages/nl-NL.js b/src/languages/nl-NL.js index 96424a5f..93bae56d 100644 --- a/src/languages/nl-NL.js +++ b/src/languages/nl-NL.js @@ -397,6 +397,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms sjabloon moet de volgende parameters bevatten: ", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Voor de veiligheid moet je de secret key gebruiken", diff --git a/src/languages/pl.js b/src/languages/pl.js index ab2480d3..57a5cbe6 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -396,6 +396,8 @@ export default { SignName: "Podpis", "Sms template must contain parameters: ": "Szablon sms musi posiadać parametry: ", "Bark Endpoint": "Punkt końcowy Bark", + "Bark Group": "grupa Bark", + "Bark Sound": "Dzwonek Bark", WebHookUrl: "WebHookUrl", SecretKey: "Tajny klucz", "For safety, must use secret key": "Ze względów bezpieczeństwa musisz użyć tajnego klucza", diff --git a/src/languages/th-TH.js b/src/languages/th-TH.js index 70138ff4..1773de7a 100644 --- a/src/languages/th-TH.js +++ b/src/languages/th-TH.js @@ -396,6 +396,8 @@ export default { SignName: "ป้ายชื่อ", "Sms template must contain parameters: ": "เทมเพลต SMS ต้องมีพารามิเตอร์ : ", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "เพื่อความปลอดภัย จำเป็นต้องตั้งค่ากุญแจการเข้าถึง", diff --git a/src/languages/tr-TR.js b/src/languages/tr-TR.js index 4904bdb7..bce1f0fd 100644 --- a/src/languages/tr-TR.js +++ b/src/languages/tr-TR.js @@ -397,6 +397,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms şablonu parametreleri içermelidir:", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Güvenlik için gizli anahtar kullanılmalıdır", diff --git a/src/languages/vi-VN.js b/src/languages/vi-VN.js index 9005c393..9d8da69a 100644 --- a/src/languages/vi-VN.js +++ b/src/languages/vi-VN.js @@ -396,6 +396,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms template must contain parameters: ", "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Để an toàn, hãy dùng secret key", diff --git a/src/languages/zh-CN.js b/src/languages/zh-CN.js index 428d56bb..003fdd7a 100644 --- a/src/languages/zh-CN.js +++ b/src/languages/zh-CN.js @@ -402,6 +402,8 @@ export default { TemplateCode: "TemplateCode", SignName: "SignName", "Bark Endpoint": "Bark 接入点", + "Bark Group": "Bark 群组", + "Bark Sound": "Bark 铃声", "Device Token": "Apple Device Token", Platform: "平台", iOS: "iOS", diff --git a/src/languages/zh-TW.js b/src/languages/zh-TW.js index ff849adb..1118d100 100644 --- a/src/languages/zh-TW.js +++ b/src/languages/zh-TW.js @@ -396,6 +396,8 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms 範本必須包含參數:", "Bark Endpoint": "Bark 端點", + "Bark Group": "Bark 群組", + "Bark Sound": "Bark 鈴聲", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "為了安全起見,必須使用秘密金鑰", From a41023ca2a05f1015021d30352b9e4f752778320 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Sun, 12 Jun 2022 22:41:24 +0800 Subject: [PATCH 031/171] Update --- server/notification-providers/bark.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index a2c4966a..b9113a74 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -50,7 +50,6 @@ class Bark extends NotificationProvider { */ appendAdditionalParameters(postUrl) { // grouping all our notifications - postUrl += "?group=" + barkNotificationGroup; if (notification.barkGroup != null) { postUrl += "&group=" + notification.barkGroup; } else { From 404923b7c82cdc633c637f364f0f2ccbb878d346 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Sun, 12 Jun 2022 22:49:04 +0800 Subject: [PATCH 032/171] bugfix --- server/notification-providers/bark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index b9113a74..f9215c8a 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -48,7 +48,7 @@ class Bark extends NotificationProvider { * @param {string} postUrl URL to append parameters to * @returns {string} */ - appendAdditionalParameters(postUrl) { + appendAdditionalParameters(notification, postUrl) { // grouping all our notifications if (notification.barkGroup != null) { postUrl += "&group=" + notification.barkGroup; From a23ab9d1de03e0825f6c1206c141fcec98a41a8d Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Sun, 12 Jun 2022 23:18:32 +0800 Subject: [PATCH 033/171] Update --- src/components/notifications/Bark.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/notifications/Bark.vue b/src/components/notifications/Bark.vue index 70e4322d..34d35db1 100644 --- a/src/components/notifications/Bark.vue +++ b/src/components/notifications/Bark.vue @@ -18,7 +18,6 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
From 5f347b10ba88114a5c15757e4f86c96a3672e479 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 13 Jun 2022 01:15:38 +0800 Subject: [PATCH 035/171] Update --- src/components/notifications/Bark.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/notifications/Bark.vue b/src/components/notifications/Bark.vue index 5ff01b1a..6cac73d3 100644 --- a/src/components/notifications/Bark.vue +++ b/src/components/notifications/Bark.vue @@ -2,9 +2,6 @@
-
-

*{{ $t("Required") }}

-
Date: Mon, 13 Jun 2022 01:30:27 +0800 Subject: [PATCH 036/171] Update --- src/languages/bg-BG.js | 2 -- src/languages/de-DE.js | 2 -- src/languages/ko-KR.js | 2 -- src/languages/nl-NL.js | 2 -- src/languages/pl.js | 2 -- src/languages/th-TH.js | 2 -- src/languages/tr-TR.js | 2 -- src/languages/vi-VN.js | 2 -- 8 files changed, 16 deletions(-) diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index 23b1b726..6297062a 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -389,8 +389,6 @@ export default { SignName: "Знак име", "Sms template must contain parameters: ": "SMS шаблонът трябва да съдържа следните параметри: ", "Bark Endpoint": "Bark крайна точка", - "Bark Group": "Bark група", - "Bark Sound": "Bark Звънене", WebHookUrl: "URL адрес на уеб кука", SecretKey: "Таен ключ", "For safety, must use secret key": "За сигурност, трябва да се използва таен ключ", diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index aeba230f..e679937c 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -389,8 +389,6 @@ export default { SignName: "Signaturname", "Sms template must contain parameters: ": "SMS Vorlage muss folgende Parameter enthalten: ", "Bark Endpoint": "Bark Endpunkt", - "Bark Group": "Bark Gruppe", - "Bark Sound": "Bark Klingelton", WebHookUrl: "Webhook URL", SecretKey: "Geheimer Schlüssel", "For safety, must use secret key": "Zur Sicherheit muss ein geheimer Schlüssel verwendet werden", diff --git a/src/languages/ko-KR.js b/src/languages/ko-KR.js index 0ed7a6f2..da034167 100644 --- a/src/languages/ko-KR.js +++ b/src/languages/ko-KR.js @@ -406,8 +406,6 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms 템플릿은 다음과 같은 파라미터가 포함되어야 해요:", "Bark Endpoint": "Bark Endpoint", - "Bark Group": "Bark Group", - "Bark Sound": "Bark Sound", WebHookUrl: "웹훅 URL", SecretKey: "Secret Key", "For safety, must use secret key": "안전을 위해 꼭 Secret Key를 사용하세요.", diff --git a/src/languages/nl-NL.js b/src/languages/nl-NL.js index 93bae56d..96424a5f 100644 --- a/src/languages/nl-NL.js +++ b/src/languages/nl-NL.js @@ -397,8 +397,6 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms sjabloon moet de volgende parameters bevatten: ", "Bark Endpoint": "Bark Endpoint", - "Bark Group": "Bark Group", - "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Voor de veiligheid moet je de secret key gebruiken", diff --git a/src/languages/pl.js b/src/languages/pl.js index 57a5cbe6..ab2480d3 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -396,8 +396,6 @@ export default { SignName: "Podpis", "Sms template must contain parameters: ": "Szablon sms musi posiadać parametry: ", "Bark Endpoint": "Punkt końcowy Bark", - "Bark Group": "grupa Bark", - "Bark Sound": "Dzwonek Bark", WebHookUrl: "WebHookUrl", SecretKey: "Tajny klucz", "For safety, must use secret key": "Ze względów bezpieczeństwa musisz użyć tajnego klucza", diff --git a/src/languages/th-TH.js b/src/languages/th-TH.js index 1773de7a..70138ff4 100644 --- a/src/languages/th-TH.js +++ b/src/languages/th-TH.js @@ -396,8 +396,6 @@ export default { SignName: "ป้ายชื่อ", "Sms template must contain parameters: ": "เทมเพลต SMS ต้องมีพารามิเตอร์ : ", "Bark Endpoint": "Bark Endpoint", - "Bark Group": "Bark Group", - "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "เพื่อความปลอดภัย จำเป็นต้องตั้งค่ากุญแจการเข้าถึง", diff --git a/src/languages/tr-TR.js b/src/languages/tr-TR.js index bce1f0fd..4904bdb7 100644 --- a/src/languages/tr-TR.js +++ b/src/languages/tr-TR.js @@ -397,8 +397,6 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms şablonu parametreleri içermelidir:", "Bark Endpoint": "Bark Endpoint", - "Bark Group": "Bark Group", - "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Güvenlik için gizli anahtar kullanılmalıdır", diff --git a/src/languages/vi-VN.js b/src/languages/vi-VN.js index 9d8da69a..9005c393 100644 --- a/src/languages/vi-VN.js +++ b/src/languages/vi-VN.js @@ -396,8 +396,6 @@ export default { SignName: "SignName", "Sms template must contain parameters: ": "Sms template must contain parameters: ", "Bark Endpoint": "Bark Endpoint", - "Bark Group": "Bark Group", - "Bark Sound": "Bark Sound", WebHookUrl: "WebHookUrl", SecretKey: "SecretKey", "For safety, must use secret key": "Để an toàn, hãy dùng secret key", From 252709ff494d6e16f5689d05a069e19dcb4a9aeb Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 13 Jun 2022 17:06:05 +0800 Subject: [PATCH 037/171] Update server/notification-providers/bark.js Co-authored-by: Adam Stachowicz --- server/notification-providers/bark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index f9215c8a..8d579724 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -53,8 +53,8 @@ class Bark extends NotificationProvider { if (notification.barkGroup != null) { postUrl += "&group=" + notification.barkGroup; } else { - postUrl += "&group=" + "UptimeKuma"; // default group + postUrl += "&group=" + "UptimeKuma"; } // set icon to uptime kuma icon, 11kb should be fine postUrl += "&icon=" + barkNotificationAvatar; From 55a6e5af425a1be2df58680aeaed4d726614050a Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 13 Jun 2022 17:06:12 +0800 Subject: [PATCH 038/171] Update server/notification-providers/bark.js Co-authored-by: Adam Stachowicz --- server/notification-providers/bark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index 8d579724..21ee9b13 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -62,8 +62,8 @@ class Bark extends NotificationProvider { if (notification.barkSound != null) { postUrl += "&sound=" + notification.barkSound; } else { - postUrl += "&sound=" + "telegraph"; // default sound + postUrl += "&sound=" + "telegraph"; } return postUrl; } From 1c4ddaeddf2c7d2f78ce881c73ae575a3cbfdb3a Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 13 Jun 2022 18:17:47 +0800 Subject: [PATCH 039/171] Update --- server/notification-providers/bark.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index 21ee9b13..6b22ae49 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -53,7 +53,7 @@ class Bark extends NotificationProvider { if (notification.barkGroup != null) { postUrl += "&group=" + notification.barkGroup; } else { - // default group + // default group name postUrl += "&group=" + "UptimeKuma"; } // set icon to uptime kuma icon, 11kb should be fine @@ -62,7 +62,7 @@ class Bark extends NotificationProvider { if (notification.barkSound != null) { postUrl += "&sound=" + notification.barkSound; } else { - // default sound + // default app sound postUrl += "&sound=" + "telegraph"; } return postUrl; From 54b9698a05e21649ec78f64ec5187b41d885f9d9 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Mon, 13 Jun 2022 21:44:10 +0800 Subject: [PATCH 040/171] Update --- server/notification-providers/bark.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/bark.js b/server/notification-providers/bark.js index 6b22ae49..3258e7c5 100644 --- a/server/notification-providers/bark.js +++ b/server/notification-providers/bark.js @@ -49,20 +49,20 @@ class Bark extends NotificationProvider { * @returns {string} */ appendAdditionalParameters(notification, postUrl) { + // set icon to uptime kuma icon, 11kb should be fine + postUrl += "&icon=" + barkNotificationAvatar; // grouping all our notifications if (notification.barkGroup != null) { postUrl += "&group=" + notification.barkGroup; } else { - // default group name + // default name postUrl += "&group=" + "UptimeKuma"; } - // set icon to uptime kuma icon, 11kb should be fine - postUrl += "&icon=" + barkNotificationAvatar; // picked a sound, this should follow system's mute status when arrival if (notification.barkSound != null) { postUrl += "&sound=" + notification.barkSound; } else { - // default app sound + // default sound postUrl += "&sound=" + "telegraph"; } return postUrl; From ac27e6e2af5dd8140b20c6f36a51a4af608b5a69 Mon Sep 17 00:00:00 2001 From: OidaTiftla Date: Wed, 15 Jun 2022 16:56:26 +0200 Subject: [PATCH 041/171] Rename feature to: Resend Notification if Down X times consequently Co-authored-by: Louis Lam --- db/patch-monitor-add-resend-interval.sql | 2 +- server/model/monitor.js | 20 +++++++++----------- src/languages/de-DE.js | 4 ++-- src/languages/en.js | 4 ++-- src/pages/EditMonitor.vue | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/db/patch-monitor-add-resend-interval.sql b/db/patch-monitor-add-resend-interval.sql index c31dd7a2..8e28bf69 100644 --- a/db/patch-monitor-add-resend-interval.sql +++ b/db/patch-monitor-add-resend-interval.sql @@ -5,6 +5,6 @@ ALTER TABLE monitor ADD resend_interval INTEGER default 0 not null; ALTER TABLE heartbeat - ADD last_notified_time DATETIME default null; + ADD down_count INTEGER default 0 not null; COMMIT; diff --git a/server/model/monitor.js b/server/model/monitor.js index e1d02766..b3435f24 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -206,7 +206,7 @@ class Monitor extends BeanModel { bean.monitor_id = this.id; bean.time = R.isoDateTimeMillis(dayjs.utc()); bean.status = DOWN; - bean.lastNotifiedTime = previousBeat?.lastNotifiedTime; + bean.downCount = previousBeat?.downCount || 0; if (this.isUpsideDown()) { bean.status = flipStatus(bean.status); @@ -523,8 +523,8 @@ class Monitor extends BeanModel { log.debug("monitor", `[${this.name}] sendNotification`); await Monitor.sendNotification(isFirstBeat, this, bean); - // Set last notified time to now - bean.lastNotifiedTime = R.isoDateTime(dayjs.utc()); + // Reset down count + bean.downCount = 0; // Clear Status Page Cache log.debug("monitor", `[${this.name}] apicache clear`); @@ -534,16 +534,14 @@ class Monitor extends BeanModel { bean.important = false; if (bean.status === DOWN && this.resendInterval > 0) { - // divide by 1000 to convert from milliseconds to seconds and divide by 60 to convert from seconds to minutes - let timeSinceLastNotified = (dayjs.utc().valueOf() - (bean.lastNotifiedTime == null ? 0 : dayjs.utc(bean.lastNotifiedTime).valueOf())) / 1000 / 60; - if (timeSinceLastNotified >= this.resendInterval) { + ++bean.downCount; + if (bean.downCount >= this.resendInterval) { // Send notification again, because we are still DOWN - const currentTime = R.isoDateTime(dayjs.utc()); - log.debug("monitor", `[${this.name}] sendNotification again: lastNotifiedTime: ${bean.lastNotifiedTime} | current time: ${currentTime}`); + log.debug("monitor", `[${this.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`); await Monitor.sendNotification(isFirstBeat, this, bean); - // Set last notified time to now - bean.lastNotifiedTime = currentTime; + // Reset down count + bean.downCount = 0; } } } @@ -556,7 +554,7 @@ class Monitor extends BeanModel { } log.warn("monitor", `Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Max retries: ${this.maxretries} | Retry: ${retries} | Retry Interval: ${beatInterval} seconds | Type: ${this.type}`); } else { - log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type}`); + log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`); } log.debug("monitor", `[${this.name}] Send to socket`); diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index f9f1e301..c4ef0b26 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -162,9 +162,9 @@ export default { Pink: "Pink", "Search...": "Suchen...", "Heartbeat Retry Interval": "Überprüfungsintervall", - "Notification resend interval if down": "Benachrichtigung erneut versenden wenn Inaktiv", + "Resend Notification if Down X times consequently": "Benachrichtigung erneut senden, wenn Inaktiv X mal hintereinander", retryCheckEverySecond: "Alle {0} Sekunden neu versuchen", - resendEveryMinute: "Erneut versenden alle {0} Minuten", + resendEveryXTimes: "Erneut versenden alle {0} mal", resendDisabled: "Erneut versenden deaktiviert", "Import Backup": "Backup importieren", "Export Backup": "Backup exportieren", diff --git a/src/languages/en.js b/src/languages/en.js index c3c3b740..49354a26 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -2,7 +2,7 @@ export default { languageName: "English", checkEverySecond: "Check every {0} seconds", retryCheckEverySecond: "Retry every {0} seconds", - resendEveryMinute: "Resend every {0} minutes", + resendEveryXTimes: "Resend every {0} times", resendDisabled: "Resend disabled", retriesDescription: "Maximum retries before the service is marked as down and a notification is sent", ignoreTLSError: "Ignore TLS/SSL error for HTTPS websites", @@ -74,7 +74,7 @@ export default { "Heartbeat Interval": "Heartbeat Interval", Retries: "Retries", "Heartbeat Retry Interval": "Heartbeat Retry Interval", - "Notification resend interval if down": "Notification resend interval if down", + "Resend Notification if Down X times consequently": "Resend Notification if Down X times consequently", Advanced: "Advanced", "Upside Down Mode": "Upside Down Mode", "Max. Redirects": "Max. Redirects", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 55924952..87bf1996 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -204,8 +204,8 @@
From 945288f0c01c45b771d81da711768d8987754baa Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Wed, 15 Jun 2022 12:12:47 -0500 Subject: [PATCH 042/171] Added postgres monitor --- package-lock.json | 215 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + server/model/monitor.js | 10 +- server/util-server.js | 28 +++++ src/pages/EditMonitor.vue | 22 ++-- 5 files changed, 268 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87342813..d213b883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "nodemailer": "~6.6.5", "notp": "~2.0.3", "password-hash": "~1.2.2", + "pg": "^8.7.3", "postcss-rtlcss": "~3.4.1", "postcss-scss": "~4.0.3", "prismjs": "^1.27.0", @@ -5335,6 +5336,14 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "node_modules/buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "engines": { + "node": ">=4" + } + }, "node_modules/builtins": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", @@ -14437,6 +14446,11 @@ "node": ">=8" } }, + "node_modules/packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, "node_modules/pacote": { "version": "13.0.5", "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.5.tgz", @@ -14689,11 +14703,88 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "optional": true }, + "node_modules/pg": { + "version": "8.7.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.3.tgz", + "integrity": "sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==", + "dependencies": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.5.1", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "pg-native": ">=2.0.0" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, "node_modules/pg-connection-string": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.1.tgz", + "integrity": "sha512-6iCR0wVrro6OOHFsyavV+i6KYL4lVNyYAB9RD18w66xSzN+d8b66HiwuP30Gp1SH5O9T82fckkzsRjlrhD0ioQ==", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/pgpass/node_modules/split2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "engines": { + "node": ">= 10.x" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -14927,6 +15018,41 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -22865,6 +22991,11 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" + }, "builtins": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.0.tgz", @@ -29671,6 +29802,11 @@ "semver": "^6.2.0" } }, + "packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, "pacote": { "version": "13.0.5", "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.0.5.tgz", @@ -29867,11 +30003,67 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "optional": true }, + "pg": { + "version": "8.7.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.3.tgz", + "integrity": "sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw==", + "requires": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.5.1", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + } + }, "pg-connection-string": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, + "pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" + }, + "pg-pool": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.1.tgz", + "integrity": "sha512-6iCR0wVrro6OOHFsyavV+i6KYL4lVNyYAB9RD18w66xSzN+d8b66HiwuP30Gp1SH5O9T82fckkzsRjlrhD0ioQ==" + }, + "pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "requires": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + } + }, + "pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "requires": { + "split2": "^4.1.0" + }, + "dependencies": { + "split2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" + } + } + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -30035,6 +30227,29 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==" + }, + "postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" + }, + "postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "requires": { + "xtend": "^4.0.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", diff --git a/package.json b/package.json index efb3e7c1..781e07b1 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "nodemailer": "~6.6.5", "notp": "~2.0.3", "password-hash": "~1.2.2", + "pg": "^8.7.3", "postcss-rtlcss": "~3.4.1", "postcss-scss": "~4.0.3", "prismjs": "^1.27.0", diff --git a/server/model/monitor.js b/server/model/monitor.js index 3e026fb6..9f1bbea5 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -7,7 +7,7 @@ dayjs.extend(timezone); const axios = require("axios"); const { Prometheus } = require("../prometheus"); const { log, UP, DOWN, PENDING, flipStatus, TimeLogger } = require("../../src/util"); -const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, mqttAsync, setSetting, httpNtlm } = require("../util-server"); +const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mqttAsync, setSetting, httpNtlm } = require("../util-server"); const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); const { Notification } = require("../notification"); @@ -477,6 +477,14 @@ class Monitor extends BeanModel { await mssqlQuery(this.databaseConnectionString, this.databaseQuery); + bean.msg = ""; + bean.status = UP; + bean.ping = dayjs().valueOf() - startTime; + } else if (this.type === "postgres") { + let startTime = dayjs().valueOf(); + + await postgresQuery(this.databaseConnectionString, this.databaseQuery); + bean.msg = ""; bean.status = UP; bean.ping = dayjs().valueOf() - startTime; diff --git a/server/util-server.js b/server/util-server.js index 87f9151d..34139383 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -11,6 +11,7 @@ const mqtt = require("mqtt"); const chroma = require("chroma-js"); const { badgeConstants } = require("./config"); const mssql = require("mssql"); +const { Client } = require("pg"); const { NtlmClient } = require("axios-ntlm"); // From ping-lite @@ -254,6 +255,33 @@ exports.mssqlQuery = function (connectionString, query) { }); }; +/** + * Run a query on Postgres + * @param {string} connectionString The database connection string + * @param {string} query The query to validate the database with + * @returns {Promise<(string[]|Object[]|Object)>} + */ +exports.postgresQuery = function (connectionString, query) { + + return new Promise((resolve, reject) => { + + const client = new Client({ connectionString }); + + client.connect(); + + client.query(query) + .then(res => { + resolve(res); + }) + .catch(err => { + reject(err); + }) + .finally(() => { + client.end(); + }); + }); +}; + /** * Retrieve value of setting based on key * @param {string} key Key of setting to retrieve diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 83ffcfd8..cc100bac 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -45,6 +45,9 @@ +
@@ -168,15 +171,21 @@
- -
From e1f766756f067f043bfc6a43c3f24e2c9c19f76a Mon Sep 17 00:00:00 2001 From: "sur.la.route" Date: Wed, 15 Jun 2022 20:14:26 -0500 Subject: [PATCH 045/171] Removed blank line Co-authored-by: Matthew Nickson --- server/util-server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/util-server.js b/server/util-server.js index dc403cbd..89777bce 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -263,7 +263,6 @@ exports.mssqlQuery = function (connectionString, query) { * @returns {Promise<(string[]|Object[]|Object)>} */ exports.postgresQuery = function (connectionString, query) { - return new Promise((resolve, reject) => { const config = postgresConParse(connectionString); From 47e82ed83ad980b16374ecd1010ccf4b4f9ae9bd Mon Sep 17 00:00:00 2001 From: "sur.la.route" Date: Wed, 15 Jun 2022 20:14:36 -0500 Subject: [PATCH 046/171] Removed blank line Co-authored-by: Matthew Nickson --- server/util-server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/util-server.js b/server/util-server.js index 89777bce..0ac13c68 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -264,7 +264,6 @@ exports.mssqlQuery = function (connectionString, query) { */ exports.postgresQuery = function (connectionString, query) { return new Promise((resolve, reject) => { - const config = postgresConParse(connectionString); if (config.password === "") { From c4e2d67d17319cc438be7174aaea3f7f6f560077 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 17 Jun 2022 10:11:53 +0300 Subject: [PATCH 047/171] fix: hide mobile header when not logged in --- src/layouts/Layout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/Layout.vue b/src/layouts/Layout.vue index aea58bf1..57519f55 100644 --- a/src/layouts/Layout.vue +++ b/src/layouts/Layout.vue @@ -77,7 +77,7 @@
-
+ +

{{ $t("HTTP Headers") }}

+
+ +
+ + +
+
+ + +
+
+ +
+ +
@@ -113,6 +154,12 @@ export default { settings() { return this.$parent.$parent.$parent.settings; }, + saveSettings() { + return this.$parent.$parent.$parent.saveSettings; + }, + settingsLoaded() { + return this.$parent.$parent.$parent.settingsLoaded; + }, }, watch: { diff --git a/src/languages/en.js b/src/languages/en.js index 9aeedd9d..3c3cdff4 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -453,6 +453,10 @@ export default { "Message:": "Message:", "Don't know how to get the token? Please read the guide:": "Don't know how to get the token? Please read the guide:", "The current connection may be lost if you are currently connecting via Cloudflare Tunnel. Are you sure want to stop it? Type your current password to confirm it.": "The current connection may be lost if you are currently connecting via Cloudflare Tunnel. Are you sure want to stop it? Type your current password to confirm it.", + "HTTP Headers": "HTTP Headers", + "Trust Proxy": "Trust Proxy", + "Trust 'X-Forwarded-*' headers": "Trust 'X-Forwarded-*' headers", + "Don't trust 'X-Forwarded-*' headers": "Don't trust 'X-Forwarded-*' headers", "Other Software": "Other Software", "For example: nginx, Apache and Traefik.": "For example: nginx, Apache and Traefik.", "Please read": "Please read", diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 03eb09e9..e1013789 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -153,6 +153,10 @@ export default { this.settings.tlsExpiryNotifyDays = [ 7, 14, 21 ]; } + if (this.settings.trustProxy === undefined) { + this.settings.trustProxy = false; + } + this.settingsLoaded = true; }); }, From 3fa5dfc87340ffec34d830a4e906f399845e33d6 Mon Sep 17 00:00:00 2001 From: Chongyi Zheng Date: Tue, 12 Jul 2022 22:59:23 -0400 Subject: [PATCH 056/171] Use x-forwarded-host only when trustProxy is true --- server/server.js | 14 +++++++++++--- server/uptime-kuma-server.js | 2 -- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/server/server.js b/server/server.js index 2d3f37ee..0c08da07 100644 --- a/server/server.js +++ b/server/server.js @@ -164,12 +164,20 @@ let needSetup = false; // Entry Page app.get("/", async (request, response) => { - log.debug("entry", `Request Domain: ${request.hostname}`); + let hostname = request.hostname; + if (await setting("trustProxy")) { + const proxy = request.headers["x-forwarded-host"]; + if (proxy) { + hostname = proxy; + } + } - if (request.hostname in StatusPage.domainMappingList) { + log.debug("entry", `Request Domain: ${hostname}`); + + if (hostname in StatusPage.domainMappingList) { log.debug("entry", "This is a status page domain"); - let slug = StatusPage.domainMappingList[request.hostname]; + let slug = StatusPage.domainMappingList[hostname]; await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug); } else if (exports.entryPage && exports.entryPage.startsWith("statusPage-")) { diff --git a/server/uptime-kuma-server.js b/server/uptime-kuma-server.js index 991c7ba2..34031b23 100644 --- a/server/uptime-kuma-server.js +++ b/server/uptime-kuma-server.js @@ -49,8 +49,6 @@ class UptimeKumaServer { log.info("server", "Creating express and socket.io instance"); this.app = express(); - this.app.enable("trust proxy"); - if (sslKey && sslCert) { log.info("server", "Server Type: HTTPS"); this.httpServer = https.createServer({ From 31c388a6e3edeb10c2d35e305d643fde359e7806 Mon Sep 17 00:00:00 2001 From: tamasmagyar <20069588+tamasmagyar@users.noreply.github.com> Date: Thu, 16 Jun 2022 08:06:34 +0200 Subject: [PATCH 057/171] added cypress framework and tests for setup page --- .gitignore | 3 +++ cypress.config.ts | 14 ++++++++++++++ cypress/e2e/setup.cy.ts | 24 ++++++++++++++++++++++++ cypress/fixtures/example.json | 5 +++++ cypress/plugins/index.js | 0 cypress/support/actors/actor.ts | 8 ++++++++ cypress/support/commands.ts | 0 cypress/support/const/user-data.ts | 4 ++++ cypress/support/e2e.ts | 1 + cypress/support/pages/dasboard-page.ts | 3 +++ cypress/support/pages/setup-page.ts | 7 +++++++ cypress/support/tasks/setup-task.ts | 15 +++++++++++++++ package.json | 5 ++++- src/pages/Setup.vue | 10 +++++----- tsconfig.json | 8 +++++--- 15 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 cypress.config.ts create mode 100644 cypress/e2e/setup.cy.ts create mode 100644 cypress/fixtures/example.json create mode 100644 cypress/plugins/index.js create mode 100644 cypress/support/actors/actor.ts create mode 100644 cypress/support/commands.ts create mode 100644 cypress/support/const/user-data.ts create mode 100644 cypress/support/e2e.ts create mode 100644 cypress/support/pages/dasboard-page.ts create mode 100644 cypress/support/pages/setup-page.ts create mode 100644 cypress/support/tasks/setup-task.ts diff --git a/.gitignore b/.gitignore index cd654d90..8eb05867 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ dist-ssr /out /tmp .env + +cypress/videos +cypress/screenshots diff --git a/cypress.config.ts b/cypress.config.ts new file mode 100644 index 00000000..ceeebca3 --- /dev/null +++ b/cypress.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from "cypress"; + +export default defineConfig({ + e2e: { + baseUrl: "http://localhost:3000", + defaultCommandTimeout: 10000, + pageLoadTimeout: 60000, + viewportWidth: 1920, + viewportHeight: 1080, + }, + env: { + baseUrl: "http://localhost:3000", + }, +}); diff --git a/cypress/e2e/setup.cy.ts b/cypress/e2e/setup.cy.ts new file mode 100644 index 00000000..94e18ede --- /dev/null +++ b/cypress/e2e/setup.cy.ts @@ -0,0 +1,24 @@ +import { actor } from "../support/actors/actor"; +import { DEFAULT_USER_DATA } from "../support/const/user-data"; +import { DashboardPage } from "../support/pages/dasboard-page"; +import { SetupPage } from "../support/pages/setup-page"; + +describe("user can create a new account on setup page", () => { + before(() => { + cy.visit("/setup"); + }); + + it("user can create new account", () => { + cy.url().should("be.equal", SetupPage.url); + actor.setupTask.fillAndSubmitSetupForm( + DEFAULT_USER_DATA.username, + DEFAULT_USER_DATA.password, + DEFAULT_USER_DATA.password + ); + + cy.url().should("be.equal", DashboardPage.url); + cy.get('[role="alert"]') + .should("be.visible") + .and("contain.text", "Added Successfully."); + }); +}); diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js new file mode 100644 index 00000000..e69de29b diff --git a/cypress/support/actors/actor.ts b/cypress/support/actors/actor.ts new file mode 100644 index 00000000..680c26ce --- /dev/null +++ b/cypress/support/actors/actor.ts @@ -0,0 +1,8 @@ +import { SetupTask } from "../tasks/setup-task"; + +class Actor { + setupTask: SetupTask = new SetupTask(); +} + +const actor = new Actor(); +export { actor }; diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts new file mode 100644 index 00000000..e69de29b diff --git a/cypress/support/const/user-data.ts b/cypress/support/const/user-data.ts new file mode 100644 index 00000000..ee2264dd --- /dev/null +++ b/cypress/support/const/user-data.ts @@ -0,0 +1,4 @@ +export const DEFAULT_USER_DATA = { + username: "testuser", + password: "testuser123", +}; diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts new file mode 100644 index 00000000..f887c29a --- /dev/null +++ b/cypress/support/e2e.ts @@ -0,0 +1 @@ +import "./commands"; diff --git a/cypress/support/pages/dasboard-page.ts b/cypress/support/pages/dasboard-page.ts new file mode 100644 index 00000000..48660dc1 --- /dev/null +++ b/cypress/support/pages/dasboard-page.ts @@ -0,0 +1,3 @@ +export const DashboardPage = { + url: Cypress.env("baseUrl") + "/dashboard", +}; diff --git a/cypress/support/pages/setup-page.ts b/cypress/support/pages/setup-page.ts new file mode 100644 index 00000000..8c1b9cfa --- /dev/null +++ b/cypress/support/pages/setup-page.ts @@ -0,0 +1,7 @@ +export const SetupPage = { + url: Cypress.env("baseUrl") + "/setup", + usernameInput: '[data-cy="username-input"]', + passWordInput: '[data-cy="password-input"]', + passwordRepeatInput: '[data-cy="password-repeat-input"]', + submitSetupForm: '[data-cy="submit-setup-form"]', +}; diff --git a/cypress/support/tasks/setup-task.ts b/cypress/support/tasks/setup-task.ts new file mode 100644 index 00000000..866e3ca5 --- /dev/null +++ b/cypress/support/tasks/setup-task.ts @@ -0,0 +1,15 @@ +import { SetupPage } from "../pages/setup-page"; + +export class SetupTask { + fillAndSubmitSetupForm( + username: string, + password: string, + passwordRepeat: string + ) { + cy.get(SetupPage.usernameInput).type(username); + cy.get(SetupPage.passWordInput).type(password); + cy.get(SetupPage.passwordRepeatInput).type(passwordRepeat); + + cy.get(SetupPage.submitSetupForm).click(); + } +} diff --git a/package.json b/package.json index 7a18dbdf..508722f4 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "release-final": "node extra/update-version.js && npm run build-docker && node ./extra/press-any-key.js && npm run upload-artifacts && node ./extra/update-wiki-version.js", "release-beta": "node extra/beta/update-version.js && npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:$VERSION -t louislam/uptime-kuma:beta . --target release --push && node ./extra/press-any-key.js && npm run upload-artifacts", "git-remove-tag": "git tag -d", - "build-dist-and-restart": "npm run build && npm run start-server-dev" + "build-dist-and-restart": "npm run build && npm run start-server-dev", + "cy:run": "npx cypress run --browser chrome --headless" }, "dependencies": { "@louislam/sqlite3": "~15.0.6", @@ -125,6 +126,8 @@ "concurrently": "^7.1.0", "core-js": "~3.18.3", "cross-env": "~7.0.3", + "cypress": "^10.1.0", + "delay": "^5.0.0", "dns2": "~2.0.1", "eslint": "~8.14.0", "eslint-plugin-vue": "~8.7.1", diff --git a/src/pages/Setup.vue b/src/pages/Setup.vue index 08347b8e..cba7f8fc 100644 --- a/src/pages/Setup.vue +++ b/src/pages/Setup.vue @@ -1,5 +1,5 @@