From 301b2007a0666258dd68355ff1b550a9a42df56c Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 19 Jul 2022 20:53:19 +0800 Subject: [PATCH 001/494] Drop Alpine support --- docker/alpine-base.dockerfile | 8 -------- docker/dockerfile-alpine | 25 ------------------------- package.json | 6 +----- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 docker/alpine-base.dockerfile delete mode 100644 docker/dockerfile-alpine diff --git a/docker/alpine-base.dockerfile b/docker/alpine-base.dockerfile deleted file mode 100644 index cde65bb6..00000000 --- a/docker/alpine-base.dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -# DON'T UPDATE TO alpine3.13, 1.14, see #41. -FROM node:16-alpine3.12 -WORKDIR /app - -# Install apprise, iputils for non-root ping, setpriv -RUN apk add --no-cache iputils setpriv dumb-init python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \ - pip3 --no-cache-dir install apprise==0.9.9 && \ - rm -rf /root/.cache diff --git a/docker/dockerfile-alpine b/docker/dockerfile-alpine deleted file mode 100644 index ab9255f9..00000000 --- a/docker/dockerfile-alpine +++ /dev/null @@ -1,25 +0,0 @@ -FROM louislam/uptime-kuma:base-alpine AS build -WORKDIR /app - -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 - -COPY . . -RUN npm ci --production && \ - chmod +x /app/extra/entrypoint.sh - - -FROM louislam/uptime-kuma:base-alpine AS release -WORKDIR /app - -# Copy app files from build layer -COPY --from=build /app /app - -EXPOSE 3001 -VOLUME ["/app/data"] -HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js -ENTRYPOINT ["/usr/bin/dumb-init", "--", "extra/entrypoint.sh"] -CMD ["node", "server/server.js"] - - -FROM release AS nightly -RUN npm run mark-as-nightly diff --git a/package.json b/package.json index 7a18dbdf..676a0558 100644 --- a/package.json +++ b/package.json @@ -30,13 +30,10 @@ "jest-backend": "cross-env TEST_BACKEND=1 jest --config=./config/jest-backend.config.js", "tsc": "tsc", "vite-preview-dist": "vite preview --host --config ./config/vite.config.js", - "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": "npm run build && npm run build-docker-debian", "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": "node ./extra/env2arg.js 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:$VERSION-alpine --target release . --push", "build-docker-debian": "node ./extra/env2arg.js 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:$VERSION -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:$VERSION-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.17.1 && npm ci --production && npm run download-dist", @@ -46,7 +43,6 @@ "remove-2fa": "node extra/remove-2fa.js", "compile-install-script": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./extra/compile-install-script.ps1", "test-install-script-centos7": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/centos7.dockerfile .", - "test-install-script-alpine3": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/alpine3.dockerfile .", "test-install-script-ubuntu": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu.dockerfile .", "test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .", "test-nodejs16": "docker build --progress plain -f test/ubuntu-nodejs16.dockerfile .", From b0d39b44ce8eedc976fd13111c5b83f0ac73bb79 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 22 Jul 2022 23:15:55 +0800 Subject: [PATCH 002/494] Testing --- docker/debian-base.dockerfile | 2 +- docker/dockerfile | 9 +++++++-- package-lock.json | 2 +- package.json | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docker/debian-base.dockerfile b/docker/debian-base.dockerfile index f90968a8..19d996db 100644 --- a/docker/debian-base.dockerfile +++ b/docker/debian-base.dockerfile @@ -7,7 +7,7 @@ WORKDIR /app # Install Curl # Install Apprise, add sqlite3 cli for debugging in the future, iputils-ping for ping, util-linux for setpriv -# Stupid python3 and python3-pip actually install a lot of useless things into Debian, specify --no-install-recommends to skip them, make the base even smaller than alpine! +# Stupid python3 and python3-pip actually install a lot of useless things into Debian, specify --no-install-recommends to skip them. RUN apt update && \ apt --yes --no-install-recommends install python3 python3-pip python3-cryptography python3-six python3-yaml python3-click python3-markdown python3-requests python3-requests-oauthlib \ sqlite3 iputils-ping util-linux dumb-init && \ diff --git a/docker/dockerfile b/docker/dockerfile index a9984351..174775a5 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -20,11 +20,16 @@ HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD nod ENTRYPOINT ["/usr/bin/dumb-init", "--", "extra/entrypoint.sh"] CMD ["node", "server/server.js"] +FROM release AS mariadb +# Install MariaDB +RUN apt update && \ + apt --yes --no-install-recommends install mariadb-server && \ + rm -rf /var/lib/apt/lists/* && \ + apt --yes autoremove -FROM release AS nightly +FROM mariadb AS nightly RUN npm run mark-as-nightly - # Upload the artifact to Github FROM louislam/uptime-kuma:base-debian AS upload-artifact WORKDIR / diff --git a/package-lock.json b/package-lock.json index e64f9fa7..d76f5a94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "badge-maker": "^3.3.1", "bcryptjs": "~2.4.3", "bree": "~7.1.5", - "cacheable-lookup": "^6.0.4", + "cacheable-lookup": "~6.0.4", "chardet": "^1.3.0", "check-password-strength": "^2.0.5", "cheerio": "^1.0.0-rc.10", diff --git a/package.json b/package.json index 676a0558..1fc45546 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,10 @@ "jest-backend": "cross-env TEST_BACKEND=1 jest --config=./config/jest-backend.config.js", "tsc": "tsc", "vite-preview-dist": "vite preview --host --config ./config/vite.config.js", - "build-docker": "npm run build && npm run build-docker-debian", + "build-docker": "npm run build && npm run build-docker-debian && npm run build-docker-debian-mariadb", "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-debian": "node ./extra/env2arg.js 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:$VERSION -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:$VERSION-debian --target release . --push", + "build-docker-debian-mariadb": "node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:mariadb -t louislam/uptime-kuma:1-mariadb -t louislam/uptime-kuma:$VERSION-mariadb --target mariadb . --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-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", From f89ed0a3a44b7d8dad2b98c9e7a0163bbd93d7ca Mon Sep 17 00:00:00 2001 From: Stefan Ottosson Date: Fri, 12 Aug 2022 18:43:24 +0200 Subject: [PATCH 003/494] feat: added HTTP method option for push monitor --- server/routers/api-router.js | 7 ++- src/pages/EditMonitor.vue | 84 ++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 201efc41..bba789ac 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -31,9 +31,8 @@ router.get("/api/entry-page", async (request, response) => { response.json(result); }); -router.get("/api/push/:pushToken", async (request, response) => { +router.all("/api/push/:pushToken", async (request, response) => { try { - let pushToken = request.params.pushToken; let msg = request.query.msg || "OK"; let ping = request.query.ping || null; @@ -48,6 +47,10 @@ router.get("/api/push/:pushToken", async (request, response) => { throw new Error("Monitor not found or not active."); } + if (monitor.method !== request.method) { + throw new Error("Monitor HTTP method (" + monitor.method + ") does not match request (" + request.method + ")."); + } + const previousHeartbeat = await Monitor.getPreviousHeartbeat(monitor.id); if (monitor.isUpsideDown()) { diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 82859a4f..d82aa280 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -398,7 +398,7 @@ - + + diff --git a/src/lang/en.json b/src/lang/en.json index 726186f5..696b0ca6 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -667,6 +667,9 @@ "WebHookUrl": "WebHookUrl", "SecretKey": "SecretKey", "For safety, must use secret key": "For safety, must use secret key", + "Mentioning": "Mentioning", + "Don't mention people": "Don't mention people", + "Mention group": "Mention {group}", "Device Token": "Device Token", "Platform": "Platform", "Huawei": "Huawei", From 19e8c75c3b7fa8e1e9d6675372785dc37a8ef04e Mon Sep 17 00:00:00 2001 From: Joschua Becker Date: Sat, 27 Apr 2024 23:40:59 +0200 Subject: [PATCH 381/494] SevenIO Notification Provider (#4219) Co-authored-by: Frank Elsinga --- server/notification-providers/sevenio.js | 78 ++++++++++++++++++++++++ server/notification.js | 2 + src/components/NotificationDialog.vue | 1 + src/components/notifications/SevenIO.vue | 31 ++++++++++ src/components/notifications/index.js | 2 + src/lang/en.json | 5 ++ 6 files changed, 119 insertions(+) create mode 100644 server/notification-providers/sevenio.js create mode 100644 src/components/notifications/SevenIO.vue diff --git a/server/notification-providers/sevenio.js b/server/notification-providers/sevenio.js new file mode 100644 index 00000000..d363e95d --- /dev/null +++ b/server/notification-providers/sevenio.js @@ -0,0 +1,78 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); +const { DOWN, UP } = require("../../src/util"); + +class SevenIO extends NotificationProvider { + name = "SevenIO"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + + const data = { + to: notification.sevenioTo, + from: notification.sevenioSender || "Uptime Kuma", + text: msg, + }; + + const config = { + baseURL: "https://gateway.seven.io/api/", + headers: { + "Content-Type": "application/json", + "X-API-Key": notification.sevenioApiKey, + }, + }; + + try { + // testing or certificate expiry notification + if (heartbeatJSON == null) { + await axios.post("sms", data, config); + return okMsg; + } + + let address = ""; + + switch (monitorJSON["type"]) { + case "ping": + address = monitorJSON["hostname"]; + break; + case "port": + case "dns": + case "gamedig": + case "steam": + address = monitorJSON["hostname"]; + if (monitorJSON["port"]) { + address += ":" + monitorJSON["port"]; + } + break; + default: + if (![ "https://", "http://", "" ].includes(monitorJSON["url"])) { + address = monitorJSON["url"]; + } + break; + } + + if (address !== "") { + address = `(${address}) `; + } + + // If heartbeatJSON is not null, we go into the normal alerting loop. + if (heartbeatJSON["status"] === DOWN) { + data.text = `Your service ${monitorJSON["name"]} ${address}went down at ${heartbeatJSON["localDateTime"]} ` + + `(${heartbeatJSON["timezone"]}). Error: ${heartbeatJSON["msg"]}`; + } else if (heartbeatJSON["status"] === UP) { + data.text = `Your service ${monitorJSON["name"]} ${address}went back up at ${heartbeatJSON["localDateTime"]} ` + + `(${heartbeatJSON["timezone"]}).`; + } + await axios.post("sms", data, config); + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } + +} + +module.exports = SevenIO; diff --git a/server/notification.js b/server/notification.js index f5a95206..b64bb1b5 100644 --- a/server/notification.js +++ b/server/notification.js @@ -56,6 +56,7 @@ const GoAlert = require("./notification-providers/goalert"); const SMSManager = require("./notification-providers/smsmanager"); const ServerChan = require("./notification-providers/serverchan"); const ZohoCliq = require("./notification-providers/zoho-cliq"); +const SevenIO = require("./notification-providers/sevenio"); const Whapi = require("./notification-providers/whapi"); const GtxMessaging = require("./notification-providers/gtx-messaging"); const Cellsynt = require("./notification-providers/cellsynt"); @@ -132,6 +133,7 @@ class Notification { new WeCom(), new GoAlert(), new ZohoCliq(), + new SevenIO(), new Whapi(), new GtxMessaging(), new Cellsynt(), diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index f57e0628..347fa230 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -154,6 +154,7 @@ export default { "webhook": "Webhook", "GoAlert": "GoAlert", "ZohoCliq": "ZohoCliq", + "SevenIO": "SevenIO", "whapi": "WhatsApp (Whapi)", "gtxmessaging": "GtxMessaging", "Cellsynt": "Cellsynt", diff --git a/src/components/notifications/SevenIO.vue b/src/components/notifications/SevenIO.vue new file mode 100644 index 00000000..fcf746ec --- /dev/null +++ b/src/components/notifications/SevenIO.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 45832238..51107ac9 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -55,6 +55,7 @@ import WeCom from "./WeCom.vue"; import GoAlert from "./GoAlert.vue"; import ZohoCliq from "./ZohoCliq.vue"; import Splunk from "./Splunk.vue"; +import SevenIO from "./SevenIO.vue"; import Whapi from "./Whapi.vue"; import Cellsynt from "./Cellsynt.vue"; @@ -119,6 +120,7 @@ const NotificationFormList = { "GoAlert": GoAlert, "ServerChan": ServerChan, "ZohoCliq": ZohoCliq, + "SevenIO": SevenIO, "whapi": Whapi, "gtxmessaging": GtxMessaging, "Cellsynt": Cellsynt, diff --git a/src/lang/en.json b/src/lang/en.json index 696b0ca6..45e800d9 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -890,6 +890,11 @@ "deleteRemoteBrowserMessage": "Are you sure want to delete this Remote Browser for all monitors?", "GrafanaOncallUrl": "Grafana Oncall URL", "Browser Screenshot": "Browser Screenshot", + "wayToGetSevenIOApiKey": "Visit the dashboard under app.seven.io > developer > api key > the green add button", + "senderSevenIO": "Sending number or name", + "receiverSevenIO": "Receiving number", + "receiverInfoSevenIO": "If the receiving number is not located in Germany, you have to add the country code in front of the number (e.g. for the country code 1 from the US use 117612121212 instead of 017612121212)", + "apiKeySevenIO": "SevenIO API Key", "wayToWriteWhapiRecipient": "The phone number with the international prefix, but without the plus sign at the start ({0}), the Contact ID ({1}) or the Group ID ({2}).", "wayToGetWhapiUrlAndToken": "You can get the API URL and the token by going into your desired channel from {0}", "whapiRecipient": "Phone Number / Contact ID / Group ID", From 988ba79679f7cfacb42453470982f4c465797eeb Mon Sep 17 00:00:00 2001 From: Ezhil Shanmugham Date: Tue, 30 Apr 2024 19:47:34 +0530 Subject: [PATCH 382/494] feat: keephq notification provider (#4722) --- server/notification-providers/keep.js | 42 +++++++++++++++++++++++++++ server/notification.js | 2 ++ src/components/NotificationDialog.vue | 1 + src/components/notifications/Keep.vue | 42 +++++++++++++++++++++++++++ src/components/notifications/index.js | 2 ++ src/lang/en.json | 1 + 6 files changed, 90 insertions(+) create mode 100644 server/notification-providers/keep.js create mode 100644 src/components/notifications/Keep.vue diff --git a/server/notification-providers/keep.js b/server/notification-providers/keep.js new file mode 100644 index 00000000..aa65a867 --- /dev/null +++ b/server/notification-providers/keep.js @@ -0,0 +1,42 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); + +class Keep extends NotificationProvider { + name = "Keep"; + + /** + * @inheritdoc + */ + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + const okMsg = "Sent Successfully."; + + try { + let data = { + heartbeat: heartbeatJSON, + monitor: monitorJSON, + msg, + }; + let config = { + headers: { + "x-api-key": notification.webhookAPIKey, + "content-type": "application/json", + }, + }; + + let url = notification.webhookURL; + + if (url.endsWith("/")) { + url = url.slice(0, -1); + } + + let webhookURL = url + "/alerts/event/uptimekuma"; + + await axios.post(webhookURL, data, config); + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = Keep; diff --git a/server/notification.js b/server/notification.js index b64bb1b5..03bd368e 100644 --- a/server/notification.js +++ b/server/notification.js @@ -18,6 +18,7 @@ const Gotify = require("./notification-providers/gotify"); const GrafanaOncall = require("./notification-providers/grafana-oncall"); const HomeAssistant = require("./notification-providers/home-assistant"); const HeiiOnCall = require("./notification-providers/heii-oncall"); +const Keep = require("./notification-providers/keep"); const Kook = require("./notification-providers/kook"); const Line = require("./notification-providers/line"); const LineNotify = require("./notification-providers/linenotify"); @@ -95,6 +96,7 @@ class Notification { new GrafanaOncall(), new HomeAssistant(), new HeiiOnCall(), + new Keep(), new Kook(), new Line(), new LineNotify(), diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 347fa230..09646d59 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -123,6 +123,7 @@ export default { "GrafanaOncall": "Grafana Oncall", "HeiiOnCall": "Heii On-Call", "HomeAssistant": "Home Assistant", + "Keep": "Keep", "Kook": "Kook", "line": "LINE Messenger", "LineNotify": "LINE Notify", diff --git a/src/components/notifications/Keep.vue b/src/components/notifications/Keep.vue new file mode 100644 index 00000000..f0c856ee --- /dev/null +++ b/src/components/notifications/Keep.vue @@ -0,0 +1,42 @@ + + + diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 51107ac9..52bebf83 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -17,6 +17,7 @@ import GrafanaOncall from "./GrafanaOncall.vue"; import GtxMessaging from "./GtxMessaging.vue"; import HomeAssistant from "./HomeAssistant.vue"; import HeiiOnCall from "./HeiiOnCall.vue"; +import Keep from "./Keep.vue"; import Kook from "./Kook.vue"; import Line from "./Line.vue"; import LineNotify from "./LineNotify.vue"; @@ -82,6 +83,7 @@ const NotificationFormList = { "GrafanaOncall": GrafanaOncall, "HomeAssistant": HomeAssistant, "HeiiOnCall": HeiiOnCall, + "Keep": Keep, "Kook": Kook, "line": Line, "LineNotify": LineNotify, diff --git a/src/lang/en.json b/src/lang/en.json index 45e800d9..d4a0997c 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -63,6 +63,7 @@ "Friendly Name": "Friendly Name", "URL": "URL", "Hostname": "Hostname", + "Host URL": "Host URL", "locally configured mail transfer agent": "locally configured mail transfer agent", "Either enter the hostname of the server you want to connect to or localhost if you intend to use a locally configured mail transfer agent": "Either enter the hostname of the server you want to connect to or {localhost} if you intend to use a {local_mta}", "Port": "Port", From 9f2cf28a762ac5e49b84b7d9b38bce496862e34b Mon Sep 17 00:00:00 2001 From: Rakovskij Stanislav Date: Tue, 30 Apr 2024 23:53:27 +0300 Subject: [PATCH 383/494] Making docker usage with localhost and external ip more clear (#3836) Co-authored-by: Frank Elsinga --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0459692a..0cb8fe3f 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,18 @@ It is a temporary live demo, all data will be deleted after 10 minutes. Sponsore docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 ``` -Uptime Kuma is now running on http://localhost:3001 +Uptime Kuma is now running on . > [!WARNING] > File Systems like **NFS** (Network File System) are **NOT** supported. Please map to a local directory or volume. +> [!NOTE] +> If you want to limit exppoure to localhost (without exposing port for other users or to use a [reverse proxyx](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)), you can expose the port like this: +> +> ```bash +> docker run -d --restart=always -p 127.0.0.1:3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 +> ``` + ### 💪🏻 Non-Docker Requirements: From dbbc79a05a2036176c8b011401c915c0db3384ca Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 2 May 2024 06:11:49 +0200 Subject: [PATCH 384/494] Fixed a typo introduced in #3836 (#4729) Co-authored-by: Nelson Chan <3271800+chakflying@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0cb8fe3f..1b4c885d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Uptime Kuma is now running on . > File Systems like **NFS** (Network File System) are **NOT** supported. Please map to a local directory or volume. > [!NOTE] -> If you want to limit exppoure to localhost (without exposing port for other users or to use a [reverse proxyx](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)), you can expose the port like this: +> If you want to limit exposure to localhost (without exposing port for other users or to use a [reverse proxy](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy)), you can expose the port like this: > > ```bash > docker run -d --restart=always -p 127.0.0.1:3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1 From 237a6e8da9ac492baa3f68a4db4679bf7ec833e6 Mon Sep 17 00:00:00 2001 From: jmolnar-comparative <108280072+jmolnar-comparative@users.noreply.github.com> Date: Fri, 10 May 2024 12:35:36 -0600 Subject: [PATCH 385/494] chore: fixed a typo for internal, unused part of the file upload icon for status page (#4750) --- server/socket-handlers/status-page-socket-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index ee1c68d3..53128914 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -148,7 +148,7 @@ module.exports.statusPageSocketHandler = (socket) => { config.logo = `/upload/${filename}?t=` + Date.now(); } else { - config.icon = imgDataUrl; + config.logo = imgDataUrl; } statusPage.slug = config.slug; From 6bfb1be71a0c0901a16ebb884e2df5f1deec4ad0 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 19 May 2024 22:46:22 +0800 Subject: [PATCH 386/494] Improve MariaDB's connection (#4728) --- server/database.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/database.js b/server/database.js index ed4b9e68..3374aff9 100644 --- a/server/database.js +++ b/server/database.js @@ -209,9 +209,9 @@ class Database { let config = {}; let mariadbPoolConfig = { - afterCreate: function (conn, done) { - - } + min: 0, + max: 10, + idleTimeoutMillis: 30000, }; log.info("db", `Database Type: ${dbConfig.type}`); From 4e24e96dabc342b614cf8515fd205f394499be6c Mon Sep 17 00:00:00 2001 From: TheDanniCraft Date: Sun, 19 May 2024 21:14:13 +0200 Subject: [PATCH 387/494] [discord] thread/forum channel support (#4099) --- server/notification-providers/discord.js | 23 +++++++++--- src/components/notifications/Discord.vue | 46 ++++++++++++++++++++++++ src/lang/en.json | 9 +++++ 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index f24d4725..129e334b 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -13,6 +13,10 @@ class Discord extends NotificationProvider { try { const discordDisplayName = notification.discordUsername || "Uptime Kuma"; + const webhookUrl = new URL(notification.discordWebhookUrl); + if (notification.discordChannelType === "postToThread") { + webhookUrl.searchParams.append("thread_id", notification.threadId); + } // If heartbeatJSON is null, assume we're testing. if (heartbeatJSON == null) { @@ -20,7 +24,12 @@ class Discord extends NotificationProvider { username: discordDisplayName, content: msg, }; - await axios.post(notification.discordWebhookUrl, discordtestdata); + + if (notification.discordChannelType === "createNewForumPost") { + discordtestdata.thread_name = notification.postName; + } + + await axios.post(webhookUrl.toString(), discordtestdata); return okMsg; } @@ -72,12 +81,14 @@ class Discord extends NotificationProvider { ], }], }; - + if (notification.discordChannelType === "createNewForumPost") { + discorddowndata.thread_name = notification.postName; + } if (notification.discordPrefixMessage) { discorddowndata.content = notification.discordPrefixMessage; } - await axios.post(notification.discordWebhookUrl, discorddowndata); + await axios.post(webhookUrl.toString(), discorddowndata); return okMsg; } else if (heartbeatJSON["status"] === UP) { @@ -108,11 +119,15 @@ class Discord extends NotificationProvider { }], }; + if (notification.discordChannelType === "createNewForumPost") { + discordupdata.thread_name = notification.postName; + } + if (notification.discordPrefixMessage) { discordupdata.content = notification.discordPrefixMessage; } - await axios.post(notification.discordWebhookUrl, discordupdata); + await axios.post(webhookUrl.toString(), discordupdata); return okMsg; } } catch (error) { diff --git a/src/components/notifications/Discord.vue b/src/components/notifications/Discord.vue index 99389d29..5d8334f5 100644 --- a/src/components/notifications/Discord.vue +++ b/src/components/notifications/Discord.vue @@ -16,4 +16,50 @@ + +
+ + +
+ +
+
+ + +
+ {{ $t("whatHappensAtForumPost", { option: $t("postToExistingThread") }) }} +
+
+
+
+
+ + + +
+
+ diff --git a/src/lang/en.json b/src/lang/en.json index d4a0997c..2c6e7887 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -527,6 +527,15 @@ "Bot Display Name": "Bot Display Name", "Prefix Custom Message": "Prefix Custom Message", "Hello @everyone is...": "Hello {'@'}everyone is…", + "Select message type": "Select message type", + "Send to channel": "Send to channel", + "Create new forum post": "Create new forum post", + "postToExistingThread": "Post to existing thread / forum post", + "forumPostName": "Forum post name", + "threadForumPostID": "Thread / Forum post ID", + "e.g. {discordThreadID}": "e.g. {discordThreadID}", + "whatHappensAtForumPost": "Create a new forum post. This does NOT post messages in existing post. To post in existing post use \"{option}\"", + "wayToGetDiscordThreadId": "Getting a thread / forum post id is similar to getting a channel id. Read more about how to get ids {0}", "wayToGetTeamsURL": "You can learn how to create a webhook URL {0}.", "wayToGetZohoCliqURL": "You can learn how to create a webhook URL {0}.", "needSignalAPI": "You need to have a signal client with REST API.", From e856cb6007dd1cd6e8e33bf8813fde232a7237cb Mon Sep 17 00:00:00 2001 From: Laurent Aupse Date: Sun, 19 May 2024 21:56:55 +0200 Subject: [PATCH 388/494] Make auto refresh interval customizable (#4260) Co-authored-by: Frank Elsinga --- .../2023-12-20-0000-alter-status-page.js | 12 ++++++++++ server/model/status_page.js | 2 ++ .../status-page-socket-handler.js | 2 ++ src/lang/en.json | 2 ++ src/pages/StatusPage.vue | 24 ++++++++++++------- 5 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 db/knex_migrations/2023-12-20-0000-alter-status-page.js diff --git a/db/knex_migrations/2023-12-20-0000-alter-status-page.js b/db/knex_migrations/2023-12-20-0000-alter-status-page.js new file mode 100644 index 00000000..61ef5d60 --- /dev/null +++ b/db/knex_migrations/2023-12-20-0000-alter-status-page.js @@ -0,0 +1,12 @@ +exports.up = function (knex) { + return knex.schema + .alterTable("status_page", function (table) { + table.integer("auto_refresh_interval").defaultTo(300).unsigned(); + }); +}; + +exports.down = function (knex) { + return knex.schema.alterTable("status_page", function (table) { + table.dropColumn("auto_refresh_interval"); + }); +}; diff --git a/server/model/status_page.js b/server/model/status_page.js index 23558298..528d1dd4 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -238,6 +238,7 @@ class StatusPage extends BeanModel { description: this.description, icon: this.getIcon(), theme: this.theme, + autoRefreshInterval: this.autoRefreshInterval, published: !!this.published, showTags: !!this.show_tags, domainNameList: this.getDomainNameList(), @@ -260,6 +261,7 @@ class StatusPage extends BeanModel { title: this.title, description: this.description, icon: this.getIcon(), + autoRefreshInterval: this.autoRefreshInterval, theme: this.theme, published: !!this.published, showTags: !!this.show_tags, diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 53128914..0804da15 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -155,6 +155,7 @@ module.exports.statusPageSocketHandler = (socket) => { statusPage.title = config.title; statusPage.description = config.description; statusPage.icon = config.logo; + statusPage.autoRefreshInterval = config.autoRefreshInterval, statusPage.theme = config.theme; //statusPage.published = ; //statusPage.search_engine_index = ; @@ -280,6 +281,7 @@ module.exports.statusPageSocketHandler = (socket) => { statusPage.title = title; statusPage.theme = "auto"; statusPage.icon = ""; + statusPage.autoRefreshInterval = 300; await R.store(statusPage); callback({ diff --git a/src/lang/en.json b/src/lang/en.json index 2c6e7887..2a3e6628 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -361,6 +361,8 @@ "Proxy": "Proxy", "Date Created": "Date Created", "Footer Text": "Footer Text", + "Refresh Interval": "Refresh Interval", + "Refresh Interval Description": "The status page will do a full site refresh every {0} seconds", "Show Powered By": "Show Powered By", "Domain Names": "Domain Names", "signedInDisp": "Signed in as {0}", diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index af2f028d..1f67c22e 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -34,6 +34,14 @@ +
+ + +
+ {{ $t("Refresh Interval Description", [config.autoRefreshInterval]) }} +
+
+