From 9964b6c4d88fb76948513366bc119583a42845cb Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:41:35 +0800 Subject: [PATCH 1/5] Fix: Update monitor object on pause (#4032) --- server/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/server.js b/server/server.js index 605dde325..9d509b45e 100644 --- a/server/server.js +++ b/server/server.js @@ -1832,6 +1832,7 @@ async function pauseMonitor(userID, monitorID) { if (monitorID in server.monitorList) { server.monitorList[monitorID].stop(); + server.monitorList[monitorID].active = 0; } } From b383392e8f962009ed68a5a086889c2ffab660c1 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 17 Nov 2023 15:21:08 +0800 Subject: [PATCH 2/5] Remains Node.js 16' SSL behavior for 1.23.X (#4044) --- server/model/monitor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/model/monitor.js b/server/model/monitor.js index e4d112bd4..54a1972c4 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -443,6 +443,7 @@ class Monitor extends BeanModel { const httpsAgentOptions = { maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) rejectUnauthorized: !this.getIgnoreTls(), + secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, }; log.debug("monitor", `[${this.name}] Prepare Options for axios`); @@ -697,6 +698,7 @@ class Monitor extends BeanModel { httpsAgent: CacheableDnsHttpAgent.getHttpsAgent({ maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) rejectUnauthorized: !this.getIgnoreTls(), + secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, }), httpAgent: CacheableDnsHttpAgent.getHttpAgent({ maxCachedSessions: 0, @@ -749,6 +751,7 @@ class Monitor extends BeanModel { httpsAgent: CacheableDnsHttpAgent.getHttpsAgent({ maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) rejectUnauthorized: !this.getIgnoreTls(), + secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, }), httpAgent: CacheableDnsHttpAgent.getHttpAgent({ maxCachedSessions: 0, From 40d6a2145301e2515b198ecba2968c8dfa1c278e Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 17 Nov 2023 15:21:29 +0800 Subject: [PATCH 3/5] Fix kafka migration script again (#4043) --- db/patch-fix-kafka-producer-booleans.sql | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/db/patch-fix-kafka-producer-booleans.sql b/db/patch-fix-kafka-producer-booleans.sql index 505f65a95..be2e992f5 100644 --- a/db/patch-fix-kafka-producer-booleans.sql +++ b/db/patch-fix-kafka-producer-booleans.sql @@ -15,12 +15,14 @@ ALTER TABLE monitor ALTER TABLE monitor ADD COLUMN kafka_producer_allow_auto_topic_creation BOOLEAN default 0 NOT NULL; --- Set bring old values from `_old` COLUMNs to correct ones -UPDATE monitor SET kafka_producer_allow_auto_topic_creation = monitor.kafka_producer_allow_auto_topic_creation_old - WHERE monitor.kafka_producer_allow_auto_topic_creation_old IS NOT NULL; +-- These SQL is still not fully safe. See https://github.com/louislam/uptime-kuma/issues/4039. -UPDATE monitor SET kafka_producer_ssl = monitor.kafka_producer_ssl_old - WHERE monitor.kafka_producer_ssl_old IS NOT NULL; +-- Set bring old values from `_old` COLUMNs to correct ones +-- UPDATE monitor SET kafka_producer_allow_auto_topic_creation = monitor.kafka_producer_allow_auto_topic_creation_old +-- WHERE monitor.kafka_producer_allow_auto_topic_creation_old IS NOT NULL; + +-- UPDATE monitor SET kafka_producer_ssl = monitor.kafka_producer_ssl_old +-- WHERE monitor.kafka_producer_ssl_old IS NOT NULL; -- Remove old COLUMNs ALTER TABLE monitor From f0975cd929ead07dee2cb5cbed5faa0eebe75b0f Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 18 Nov 2023 01:17:54 +0800 Subject: [PATCH 4/5] Should be a final ulitmate fix for request timeout issue (#4045) * Try to fix timeout again * Ops --- db/patch-timeout.sql | 7 +++++++ server/database.js | 1 + server/model/monitor.js | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/patch-timeout.sql diff --git a/db/patch-timeout.sql b/db/patch-timeout.sql new file mode 100644 index 000000000..f25711201 --- /dev/null +++ b/db/patch-timeout.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; + +UPDATE monitor SET timeout = (interval * 0.8) +WHERE timeout IS NULL OR timeout <= 0; + +COMMIT; diff --git a/server/database.js b/server/database.js index 29ab3b941..07a43a812 100644 --- a/server/database.js +++ b/server/database.js @@ -83,6 +83,7 @@ class Database { "patch-add-gamedig-given-port.sql": true, "patch-notification-config.sql": true, "patch-fix-kafka-producer-booleans.sql": true, + "patch-timeout.sql": true, }; /** diff --git a/server/model/monitor.js b/server/model/monitor.js index 54a1972c4..194980a12 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -369,7 +369,7 @@ class Monitor extends BeanModel { // Runtime patch timeout if it is 0 // See https://github.com/louislam/uptime-kuma/pull/3961#issuecomment-1804149144 - if (this.timeout <= 0) { + if (!this.timeout || this.timeout <= 0) { this.timeout = this.interval * 1000 * 0.8; } From 6d4a45f18c9a7372408a7d132e570f7ab4640123 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 18 Nov 2023 01:23:53 +0800 Subject: [PATCH 5/5] Update to 1.23.5 --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbc44b488..c25c4de75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "1.23.4", + "version": "1.23.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "1.23.4", + "version": "1.23.5", "license": "MIT", "dependencies": { "@grpc/grpc-js": "~1.7.3", diff --git a/package.json b/package.json index 4ecc87e86..f55d12a88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.23.4", + "version": "1.23.5", "license": "MIT", "repository": { "type": "git", @@ -40,7 +40,7 @@ "build-docker-nightly-amd64": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain", "build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test --target pr-test . --push", "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.23.4 && npm ci --production && npm run download-dist", + "setup": "git checkout 1.23.5 && npm ci --production && npm run download-dist", "download-dist": "node extra/download-dist.js", "mark-as-nightly": "node extra/mark-as-nightly.js", "reset-password": "node extra/reset-password.js",