From 1cf88f4fead8cc5285a740365dde4fbe5efdc786 Mon Sep 17 00:00:00 2001 From: Suven-p Date: Fri, 4 Oct 2024 17:35:24 +0545 Subject: [PATCH 01/13] Disable certificate expiry notification when SSL errors are ignored (#5156) --- src/lang/en.json | 1 + src/pages/EditMonitor.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 24ca7cd990..28ff675e19 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -82,6 +82,7 @@ "resendEveryXTimes": "Resend every {0} times", "resendDisabled": "Resend disabled", "retriesDescription": "Maximum retries before the service is marked as down and a notification is sent", + "ignoredTLSError": "TLS/SSL errors have been ignored", "ignoreTLSError": "Ignore TLS/SSL errors for HTTPS websites", "ignoreTLSErrorGeneral": "Ignore TLS/SSL error for connection", "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 53a31737c3..cb33fc0a44 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -565,8 +565,8 @@

{{ $t("Advanced") }}

-
- +
+ @@ -1456,6 +1456,12 @@ message HealthCheckResponse { } this.monitor.game = newGameObject.keys[0]; }, + + "monitor.ignoreTls"(newVal) { + if (newVal) { + this.monitor.expiryNotification = false; + } + }, }, mounted() { this.init(); From da168fc22082a4bdeae313ba90e0596366ecf87b Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 4 Oct 2024 14:33:21 +0200 Subject: [PATCH 02/13] fix: Both `Add` and `Home` being shown as selected on the homescreen (#3256) --- src/router.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/router.js b/src/router.js index 36cdeadaee..bda5078e14 100644 --- a/src/router.js +++ b/src/router.js @@ -68,15 +68,17 @@ const routes = [ }, ], }, + ], + }, + { + path: "/add", + component: EditMonitor, + children: [ { path: "/clone/:id", component: EditMonitor, }, - { - path: "/add", - component: EditMonitor, - }, - ], + ] }, { path: "/list", From a5faa4b2255693d5db6709bf577fde1029cd33b0 Mon Sep 17 00:00:00 2001 From: Tanmay Shinde <62463484+tanmay4u02@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:57:17 +0530 Subject: [PATCH 03/13] refactor: removed fs-rmsync extra func used for node <14 (#5159) --- extra/download-dist.js | 11 ++++++----- extra/fs-rmSync.js | 23 ----------------------- extra/update-language-files/index.js | 11 ++++++++--- package.json | 3 +-- test/prepare-test-server.js | 4 ++-- 5 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 extra/fs-rmSync.js diff --git a/extra/download-dist.js b/extra/download-dist.js index b8be5eb8a7..b339ac9300 100644 --- a/extra/download-dist.js +++ b/extra/download-dist.js @@ -4,7 +4,6 @@ const tar = require("tar"); const packageJSON = require("../package.json"); const fs = require("fs"); -const rmSync = require("./fs-rmSync.js"); const version = packageJSON.version; const filename = "dist.tar.gz"; @@ -29,8 +28,9 @@ function download(url) { if (fs.existsSync("./dist")) { if (fs.existsSync("./dist-backup")) { - rmSync("./dist-backup", { - recursive: true + fs.rmSync("./dist-backup", { + recursive: true, + force: true, }); } @@ -43,8 +43,9 @@ function download(url) { tarStream.on("close", () => { if (fs.existsSync("./dist-backup")) { - rmSync("./dist-backup", { - recursive: true + fs.rmSync("./dist-backup", { + recursive: true, + force: true, }); } console.log("Done"); diff --git a/extra/fs-rmSync.js b/extra/fs-rmSync.js deleted file mode 100644 index a42e30a680..0000000000 --- a/extra/fs-rmSync.js +++ /dev/null @@ -1,23 +0,0 @@ -const fs = require("fs"); -/** - * Detect if `fs.rmSync` is available - * to avoid the runtime deprecation warning triggered for using `fs.rmdirSync` with `{ recursive: true }` in Node.js v16, - * or the `recursive` property removing completely in the future Node.js version. - * See the link below. - * @todo Once we drop the support for Node.js v14 (or at least versions before v14.14.0), we can safely replace this function with `fs.rmSync`, since `fs.rmSync` was add in Node.js v14.14.0 and currently we supports all the Node.js v14 versions that include the versions before the v14.14.0, and this function have almost the same signature with `fs.rmSync`. - * @link https://nodejs.org/docs/latest-v16.x/api/deprecations.html#dep0147-fsrmdirpath--recursive-true- the deprecation information of `fs.rmdirSync` - * @link https://nodejs.org/docs/latest-v16.x/api/fs.html#fsrmsyncpath-options the document of `fs.rmSync` - * @param {fs.PathLike} path Valid types for path values in "fs". - * @param {fs.RmDirOptions} options options for `fs.rmdirSync`, if `fs.rmSync` is available and property `recursive` is true, it will automatically have property `force` with value `true`. - * @returns {void} - */ -const rmSync = (path, options) => { - if (typeof fs.rmSync === "function") { - if (options.recursive) { - options.force = true; - } - return fs.rmSync(path, options); - } - return fs.rmdirSync(path, options); -}; -module.exports = rmSync; diff --git a/extra/update-language-files/index.js b/extra/update-language-files/index.js index 5b748a98e1..acb6bd4673 100644 --- a/extra/update-language-files/index.js +++ b/extra/update-language-files/index.js @@ -2,7 +2,6 @@ import fs from "fs"; import util from "util"; -import rmSync from "../fs-rmSync.js"; /** * Copy across the required language files @@ -16,7 +15,10 @@ import rmSync from "../fs-rmSync.js"; */ function copyFiles(langCode, baseLang) { if (fs.existsSync("./languages")) { - rmSync("./languages", { recursive: true }); + fs.rmSync("./languages", { + recursive: true, + force: true, + }); } fs.mkdirSync("./languages"); @@ -93,6 +95,9 @@ console.log("Updating: " + langCode); copyFiles(langCode, baseLangCode); await updateLanguage(langCode, baseLangCode); -rmSync("./languages", { recursive: true }); +fs.rmSync("./languages", { + recursive: true, + force: true, +}); console.log("Done. Fixing formatting by ESLint..."); diff --git a/package.json b/package.json index cf6348cbd5..0d51984c7c 100644 --- a/package.json +++ b/package.json @@ -68,8 +68,7 @@ "sort-contributors": "node extra/sort-contributors.js", "quick-run-nightly": "docker run --rm --env NODE_ENV=development -p 3001:3001 louislam/uptime-kuma:nightly2", "start-dev-container": "cd docker && docker-compose -f docker-compose-dev.yml up --force-recreate", - "rebase-pr-to-1.23.X": "node extra/rebase-pr.js 1.23.X", - "start-server-node14-win": "private\\node14\\node.exe server/server.js" + "rebase-pr-to-1.23.X": "node extra/rebase-pr.js 1.23.X" }, "dependencies": { "@grpc/grpc-js": "~1.8.22", diff --git a/test/prepare-test-server.js b/test/prepare-test-server.js index 1a9b04df14..1e0ed5cc49 100644 --- a/test/prepare-test-server.js +++ b/test/prepare-test-server.js @@ -1,10 +1,10 @@ const fs = require("fs"); -const rmSync = require("../extra/fs-rmSync.js"); const path = "./data/test"; if (fs.existsSync(path)) { - rmSync(path, { + fs.rmSync(path, { recursive: true, + force: true, }); } From f791d4a9bf789c769bd90678faac82ec5de74790 Mon Sep 17 00:00:00 2001 From: nekojanai Date: Sun, 6 Oct 2024 02:27:15 +0200 Subject: [PATCH 04/13] feat: monitor debug curl (#5152) Co-authored-by: Frank Elsinga --- src/lang/en.json | 10 +++ src/pages/EditMonitor.vue | 127 +++++++++++++++++++++++++++++++++++++- 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 28ff675e19..3a4ca715c8 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -97,6 +97,8 @@ "pushOthers": "Others", "programmingLanguages": "Programming Languages", "Save": "Save", + "Debug": "Debug", + "Copy": "Copy", "Notifications": "Notifications", "Not available, please setup.": "Not available, please set up.", "Setup Notification": "Set Up Notification", @@ -249,6 +251,14 @@ "PushUrl": "Push URL", "HeadersInvalidFormat": "The request headers are not valid JSON: ", "BodyInvalidFormat": "The request body is not valid JSON: ", + "CopyToClipboardError": "Couldn't copy to clipbard: {error}", + "CopyToClipboardSuccess": "Copied!", + "CurlDebugInfo": "To debug the monitor, you can either paste this into your own machines terminal or into the machines terminal which uptime kuma is running on and see what you are requesting.{newiline}Please be aware of networking differences like {firewalls}, {dns_resolvers} or {docker_networks}.", + "firewalls": "firewalls", + "dns resolvers": "dns resolvers", + "docker networks": "docker networks", + "CurlDebugInfoOAuth2CCUnsupported": "Full oauth client credential flow is not supported in {curl}.{newline}Please get a bearer token and pass it via the {oauth2_bearer} option.", + "CurlDebugInfoProxiesUnsupported": "Proxy support in the above {curl} command is currently not implemented.", "Monitor History": "Monitor History", "clearDataOlderThan": "Keep monitor history data for {0} days.", "PasswordsDoNotMatch": "Passwords do not match.", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index cb33fc0a44..e684dd703a 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -982,13 +982,23 @@
+
@@ -1000,9 +1010,58 @@
+