From c4a2ce4e78cf90fc371a62c394f9523b5d62c102 Mon Sep 17 00:00:00 2001 From: Rolf Bachmann <1196109+rolfbachmann@users.noreply.github.com> Date: Tue, 19 Jul 2022 10:57:52 +0200 Subject: [PATCH 01/50] Add authentication support for ntfy --- server/notification-providers/ntfy.js | 11 +++++++++-- src/components/notifications/Ntfy.vue | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/ntfy.js b/server/notification-providers/ntfy.js index 21f358f64..17d6d812a 100644 --- a/server/notification-providers/ntfy.js +++ b/server/notification-providers/ntfy.js @@ -8,12 +8,19 @@ class Ntfy extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { let okMsg = "Sent Successfully."; try { - await axios.post(`${notification.ntfyserverurl}`, { + let headers = {}; + if (notification.ntfyusername.length > 0) { + headers = { + "Authorization": "Basic " + Buffer.from(notification.ntfyusername + ":" + notification.ntfypassword).toString("base64"), + }; + } + let data = { "topic": notification.ntfytopic, "message": msg, "priority": notification.ntfyPriority || 4, "title": "Uptime-Kuma", - }); + }; + await axios.post(`${notification.ntfyserverurl}`, data, { headers: headers }); return okMsg; diff --git a/src/components/notifications/Ntfy.vue b/src/components/notifications/Ntfy.vue index d9a83b499..a42dca302 100644 --- a/src/components/notifications/Ntfy.vue +++ b/src/components/notifications/Ntfy.vue @@ -11,7 +11,18 @@ - +
{{ $t("A list of Notification Services can be found in Home Assistant under \"Developer Tools > Services\" search for \"notification\" to find your device/phone name.") }}
+{{ $t('A list of Notification Services can be found in Home Assistant under "Developer Tools > Services" search for "notification" to find your device/phone name.') }}
{{ $t("Automations can optionally be triggered in Home Assistant:") }}
{{ $t("Trigger type:") }} Event
diff --git a/src/components/notifications/SMSManager.vue b/src/components/notifications/SMSManager.vue
index 25db624fc..1be952ae2 100644
--- a/src/components/notifications/SMSManager.vue
+++ b/src/components/notifications/SMSManager.vue
@@ -2,7 +2,7 @@
must be provided");
+}
+
+console.log("Base Lang: " + baseLangCode);
+console.log("Updating: " + langCode);
+
+copyFiles(langCode, baseLangCode);
+await updateLanguage(langCode, baseLangCode);
rmSync("./languages", { recursive: true });
+
console.log("Done. Fixing formatting by ESLint...");
diff --git a/package.json b/package.json
index d478a1d24..f5f78f3ac 100644
--- a/package.json
+++ b/package.json
@@ -51,8 +51,7 @@
"test-nodejs16": "docker build --progress plain -f test/ubuntu-nodejs16.dockerfile .",
"simple-dns-server": "node extra/simple-dns-server.js",
"simple-mqtt-server": "node extra/simple-mqtt-server.js",
- "update-language-files-with-base-lang": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix",
- "update-language-files": "cd extra/update-language-files && node index.js && eslint ../../src/languages/**.js --fix",
+ "update-language-files": "cd extra/update-language-files && node index.js && cross-env-shell eslint ../../src/languages/$npm_config_language.js --fix",
"ncu-patch": "npm-check-updates -u -t patch",
"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",
diff --git a/src/languages/README.md b/src/languages/README.md
index d505476a8..eddd61022 100644
--- a/src/languages/README.md
+++ b/src/languages/README.md
@@ -1,10 +1,13 @@
# How to translate
1. Fork this repo.
-2. Create a language file (e.g. `zh-TW.js`). The filename must be ISO language code: http://www.lingoes.net/en/translator/langcode.htm
-3. Run `npm run update-language-files`. You can also use this command to check if there are new strings to translate for your language.
-4. Your language file should be filled in. You can translate now.
-5. Add it into `languageList` constant.
-6. Make a [pull request](https://github.com/louislam/uptime-kuma/pulls) when you have done.
+2. Run `npm run update-language-files --language=` where ``
+ is a valid ISO language code:
+ http://www.lingoes.net/en/translator/langcode.htm. You can also use
+ this command to check if there are new strings to
+ translate for your language.
+3. Your language file should be filled in. You can translate now.
+4. Add it into `languageList` constant.
+5. Make a [pull request](https://github.com/louislam/uptime-kuma/pulls) when you have done.
If you do not have programming skills, let me know in [the issues section](https://github.com/louislam/uptime-kuma/issues). I will assist you. 😏
From 230e5110b1db0527c763daa680fa556a06d3bd9b Mon Sep 17 00:00:00 2001
From: Kevin Falentio
Date: Sat, 8 Oct 2022 19:59:22 +0700
Subject: [PATCH 48/50] Fix typo in id-ID language file (#2202)
---
src/languages/id-ID.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/languages/id-ID.js b/src/languages/id-ID.js
index f8ee3ab78..fe5d35942 100644
--- a/src/languages/id-ID.js
+++ b/src/languages/id-ID.js
@@ -565,7 +565,7 @@ export default {
Examples: "Contoh",
"Home Assistant URL": "Home Assistant URL",
"Long-Lived Access Token": "Token Akses Berumur Panjang",
- "Long-Lived Access Token canbe created by clicking on your profile name (bottom left) and scrolling to the bottom then click Create Token. ": "Token Akses Berumur Panjang dapat dibuat dengan mengklik nama profil Anda (kiri bawah) dan menggulir ke bawah lalu klik Buat Token. ",
+ "Long-Lived Access Token can be created by clicking on your profile name (bottom left) and scrolling to the bottom then click Create Token. ": "Token Akses Berumur Panjang dapat dibuat dengan mengklik nama profil Anda (kiri bawah) dan menggulir ke bawah lalu klik Buat Token. ",
"Notification Service": "Layanan Pemberitahuan",
"default: notify all devices": "bawaan: notifikasi seluruh perangkat",
"A listof Notification Services can be found in Home Assistant under \"Developer Tools > Services\" search for \"notification\" to find your device/phone name.": "Daftar Layanan Pemberitahuan dapat ditemukan di Home Assistant pada \"Developer Tools > Services\" cari \"notification\" lalu cari nama perangkat Anda.",
From 1c8631af8d5b3547f1fff5bea1ee3da75b7ee45f Mon Sep 17 00:00:00 2001
From: Louis Lam
Date: Sun, 9 Oct 2022 16:02:47 +0800
Subject: [PATCH 49/50] Pin dependencies (#2205)
---
package-lock.json | 48 +++++++++++++++++++++++------------------------
package.json | 48 +++++++++++++++++++++++------------------------
2 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4f2221714..6053fa5f5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,47 +12,47 @@
"@louislam/sqlite3": "~15.0.6",
"args-parser": "~1.3.0",
"axios": "~0.27.0",
- "axios-ntlm": "^1.3.0",
- "badge-maker": "^3.3.1",
+ "axios-ntlm": "~1.3.0",
+ "badge-maker": "~3.3.1",
"bcryptjs": "~2.4.3",
"bree": "~7.1.5",
"cacheable-lookup": "~6.0.4",
- "chardet": "^1.3.0",
+ "chardet": "~1.4.0",
"check-password-strength": "^2.0.5",
- "cheerio": "^1.0.0-rc.10",
- "chroma-js": "^2.1.2",
+ "cheerio": "~1.0.0-rc.12",
+ "chroma-js": "~2.4.2",
"command-exists": "~1.2.9",
"compare-versions": "~3.6.0",
- "compression": "^1.7.4",
- "dayjs": "^1.11.0",
+ "compression": "~1.7.4",
+ "dayjs": "~1.11.5",
"express": "~4.17.3",
"express-basic-auth": "~1.2.1",
- "express-static-gzip": "^2.1.7",
+ "express-static-gzip": "~2.1.7",
"form-data": "~4.0.0",
"http-graceful-shutdown": "~3.1.7",
- "http-proxy-agent": "^5.0.0",
- "https-proxy-agent": "^5.0.0",
- "iconv-lite": "^0.6.3",
- "jsesc": "^3.0.2",
+ "http-proxy-agent": "~5.0.0",
+ "https-proxy-agent": "~5.0.1",
+ "iconv-lite": "~0.6.3",
+ "jsesc": "~3.0.2",
"jsonwebtoken": "~8.5.1",
- "jwt-decode": "^3.1.2",
- "limiter": "^2.1.0",
- "mqtt": "^4.2.8",
- "mssql": "^8.1.0",
+ "jwt-decode": "~3.1.2",
+ "limiter": "~2.1.0",
+ "mqtt": "~4.3.7",
+ "mssql": "~8.1.4",
"node-cloudflared-tunnel": "~1.0.9",
- "node-radius-client": "^1.0.0",
+ "node-radius-client": "~1.0.0",
"nodemailer": "~6.6.5",
"notp": "~2.0.3",
"password-hash": "~1.2.2",
- "pg": "^8.7.3",
- "pg-connection-string": "^2.5.0",
+ "pg": "~8.8.0",
+ "pg-connection-string": "~2.5.0",
"prom-client": "~13.2.0",
"prometheus-api-metrics": "~3.2.1",
"redbean-node": "0.1.4",
"socket.io": "~4.4.1",
"socket.io-client": "~4.4.1",
"socks-proxy-agent": "6.1.1",
- "tar": "^6.1.11",
+ "tar": "~6.1.11",
"tcp-ping": "~0.1.1",
"thirty-two": "~1.0.2"
},
@@ -82,18 +82,18 @@
"dns2": "~2.0.1",
"eslint": "~8.14.0",
"eslint-plugin-vue": "~8.7.1",
- "favico.js": "^0.3.10",
+ "favico.js": "~0.3.10",
"jest": "~27.2.5",
"postcss-html": "~1.5.0",
"postcss-rtlcss": "~3.7.2",
"postcss-scss": "~4.0.4",
- "prismjs": "^1.27.0",
+ "prismjs": "~1.29.0",
"qrcode": "~1.5.0",
"rollup-plugin-visualizer": "^5.6.0",
"sass": "~1.42.1",
"stylelint": "~14.7.1",
"stylelint-config-standard": "~25.0.0",
- "terser": "^5.15.0",
+ "terser": "~5.15.0",
"timezones-list": "~3.0.1",
"typescript": "~4.4.4",
"v-pagination-3": "~0.1.7",
@@ -106,7 +106,7 @@
"vue-i18n": "~9.1.9",
"vue-image-crop-upload": "~3.0.3",
"vue-multiselect": "~3.0.0-alpha.2",
- "vue-prism-editor": "^2.0.0-alpha.2",
+ "vue-prism-editor": "~2.0.0-alpha.2",
"vue-qrcode": "~1.0.0",
"vue-router": "~4.0.14",
"vue-toastification": "~2.0.0-rc.5",
diff --git a/package.json b/package.json
index f5f78f3ac..0c72722de 100644
--- a/package.json
+++ b/package.json
@@ -66,47 +66,47 @@
"@louislam/sqlite3": "~15.0.6",
"args-parser": "~1.3.0",
"axios": "~0.27.0",
- "axios-ntlm": "^1.3.0",
- "badge-maker": "^3.3.1",
+ "axios-ntlm": "~1.3.0",
+ "badge-maker": "~3.3.1",
"bcryptjs": "~2.4.3",
"bree": "~7.1.5",
"cacheable-lookup": "~6.0.4",
- "chardet": "^1.3.0",
+ "chardet": "~1.4.0",
"check-password-strength": "^2.0.5",
- "cheerio": "^1.0.0-rc.10",
- "chroma-js": "^2.1.2",
+ "cheerio": "~1.0.0-rc.12",
+ "chroma-js": "~2.4.2",
"command-exists": "~1.2.9",
"compare-versions": "~3.6.0",
- "compression": "^1.7.4",
- "dayjs": "^1.11.0",
+ "compression": "~1.7.4",
+ "dayjs": "~1.11.5",
"express": "~4.17.3",
"express-basic-auth": "~1.2.1",
- "express-static-gzip": "^2.1.7",
+ "express-static-gzip": "~2.1.7",
"form-data": "~4.0.0",
"http-graceful-shutdown": "~3.1.7",
- "http-proxy-agent": "^5.0.0",
- "https-proxy-agent": "^5.0.0",
- "iconv-lite": "^0.6.3",
- "jsesc": "^3.0.2",
+ "http-proxy-agent": "~5.0.0",
+ "https-proxy-agent": "~5.0.1",
+ "iconv-lite": "~0.6.3",
+ "jsesc": "~3.0.2",
"jsonwebtoken": "~8.5.1",
- "jwt-decode": "^3.1.2",
- "limiter": "^2.1.0",
- "mqtt": "^4.2.8",
- "mssql": "^8.1.0",
+ "jwt-decode": "~3.1.2",
+ "limiter": "~2.1.0",
+ "mqtt": "~4.3.7",
+ "mssql": "~8.1.4",
"node-cloudflared-tunnel": "~1.0.9",
- "node-radius-client": "^1.0.0",
+ "node-radius-client": "~1.0.0",
"nodemailer": "~6.6.5",
"notp": "~2.0.3",
"password-hash": "~1.2.2",
- "pg": "^8.7.3",
- "pg-connection-string": "^2.5.0",
+ "pg": "~8.8.0",
+ "pg-connection-string": "~2.5.0",
"prom-client": "~13.2.0",
"prometheus-api-metrics": "~3.2.1",
"redbean-node": "0.1.4",
"socket.io": "~4.4.1",
"socket.io-client": "~4.4.1",
"socks-proxy-agent": "6.1.1",
- "tar": "^6.1.11",
+ "tar": "~6.1.11",
"tcp-ping": "~0.1.1",
"thirty-two": "~1.0.2"
},
@@ -136,18 +136,18 @@
"dns2": "~2.0.1",
"eslint": "~8.14.0",
"eslint-plugin-vue": "~8.7.1",
- "favico.js": "^0.3.10",
+ "favico.js": "~0.3.10",
"jest": "~27.2.5",
"postcss-html": "~1.5.0",
"postcss-rtlcss": "~3.7.2",
"postcss-scss": "~4.0.4",
- "prismjs": "^1.27.0",
+ "prismjs": "~1.29.0",
"qrcode": "~1.5.0",
"rollup-plugin-visualizer": "^5.6.0",
"sass": "~1.42.1",
"stylelint": "~14.7.1",
"stylelint-config-standard": "~25.0.0",
- "terser": "^5.15.0",
+ "terser": "~5.15.0",
"timezones-list": "~3.0.1",
"typescript": "~4.4.4",
"v-pagination-3": "~0.1.7",
@@ -160,7 +160,7 @@
"vue-i18n": "~9.1.9",
"vue-image-crop-upload": "~3.0.3",
"vue-multiselect": "~3.0.0-alpha.2",
- "vue-prism-editor": "^2.0.0-alpha.2",
+ "vue-prism-editor": "~2.0.0-alpha.2",
"vue-qrcode": "~1.0.0",
"vue-router": "~4.0.14",
"vue-toastification": "~2.0.0-rc.5",
From 07f9aafd7bce1b6d5226744654070a2fc7d54745 Mon Sep 17 00:00:00 2001
From: Louis Lam
Date: Sun, 9 Oct 2022 16:50:47 +0800
Subject: [PATCH 50/50] Update to 1.18.4
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 0c72722de..180bea289 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "uptime-kuma",
- "version": "1.18.3",
+ "version": "1.18.4",
"license": "MIT",
"repository": {
"type": "git",
@@ -38,7 +38,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.18.3 && npm ci --production && npm run download-dist",
+ "setup": "git checkout 1.18.4 && 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",