From b0259b559249c979698b9f59891399920bf81070 Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 13 Jan 2022 16:17:07 +0000 Subject: [PATCH 01/96] 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 000000000..fdde41705 --- /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 afcace705..536acd198 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 c4441d63e..5683352f5 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 4b6a920c8..8b02a75f9 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 02/96] 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 5683352f5..5e32a89d5 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 868bbd5ef..7495cfb8a 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 47513466c..1d56e1391 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 03/96] 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 7f88db5f4..f2434b2d1 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 04/96] 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 536acd198..69551bacf 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 5e32a89d5..b75500ec2 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 1d56e1391..ae9fa5262 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 8b02a75f9..86c35ef04 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 05/96] 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 fdde41705..564756678 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 b75500ec2..d8a4be238 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 7495cfb8a..ac68769da 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 ae9fa5262..ade50373d 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 86c35ef04..b80b9a269 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 84a0b24448fc06f791bf4555fb2db8cd384c815b Mon Sep 17 00:00:00 2001 From: Moritz R Date: Sun, 3 Apr 2022 17:15:21 +0200 Subject: [PATCH 06/96] 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 d8a4be238..c9b697d0c 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 32cfd411f87ed98bd3247a7751b2f4791fbd388e Mon Sep 17 00:00:00 2001 From: c0derMo Date: Thu, 19 May 2022 12:35:55 +0000 Subject: [PATCH 07/96] 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 c7e2cd315..2bc40b5f2 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 56c9ac92d..1d1568838 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -120,7 +120,7 @@
- +
From fbfa5a33ed2fb44b33d8b85359ddd3654630b73a Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Sat, 11 Jun 2022 17:23:12 +0100 Subject: [PATCH 08/96] Added Clickable hostname on status page. #1221 This should fully implement #1221 by modifying the API and adding two new properties to the result. The `sendUrl` property denotes if the URL is sent and `url` is included when required. Client side checks have been implemented in order to only show a link when the URL is vaugely correct. I.e not "" or "https://". This prevents the link from being included if the monitor type is not HTTP without having to publicly expose the monitor type. The exposure of the URL is configuarable for each monitor on each status page by clicking on the link icon. Signed-off-by: Matthew Nickson --- db/patch-add-clickable-status-page-link.sql | 5 ++ server/database.js | 1 + server/model/group.js | 2 +- server/model/monitor.js | 6 +++ .../status-page-socket-handler.js | 1 + src/components/PublicGroupList.vue | 48 ++++++++++++++++++- src/icon.js | 1 + 7 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 db/patch-add-clickable-status-page-link.sql diff --git a/db/patch-add-clickable-status-page-link.sql b/db/patch-add-clickable-status-page-link.sql new file mode 100644 index 000000000..bacd669bd --- /dev/null +++ b/db/patch-add-clickable-status-page-link.sql @@ -0,0 +1,5 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; +ALTER TABLE monitor_group + ADD send_url BOOLEAN DEFAULT 0 NOT NULL; +COMMIT; diff --git a/server/database.js b/server/database.js index b17e7f4ed..8c93fed6a 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-clickable-status-page-link.sql": true, }; /** diff --git a/server/model/group.js b/server/model/group.js index 599b758bc..3f3b3b129 100644 --- a/server/model/group.js +++ b/server/model/group.js @@ -31,7 +31,7 @@ class Group extends BeanModel { */ async getMonitorList() { return R.convertToBeans("monitor", await R.getAll(` - SELECT monitor.* FROM monitor, monitor_group + SELECT monitor.*, monitor_group.send_url FROM monitor, monitor_group WHERE monitor.id = monitor_group.monitor_id AND group_id = ? ORDER BY monitor_group.weight diff --git a/server/model/monitor.js b/server/model/monitor.js index 643d34a6f..b46c0e323 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -34,7 +34,13 @@ class Monitor extends BeanModel { let obj = { id: this.id, name: this.name, + sendUrl: this.sendUrl, }; + + if (this.sendUrl) { + obj.url = this.url; + } + if (showTags) { obj.tags = await this.getTags(); } diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 0a0dc6865..80017e7d2 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -202,6 +202,7 @@ module.exports.statusPageSocketHandler = (socket) => { relationBean.weight = monitorOrder++; relationBean.group_id = groupBean.id; relationBean.monitor_id = monitor.id; + relationBean.send_url = monitor.sendUrl; await R.store(relationBean); } diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index df94eec98..cbd8aeffe 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -39,7 +39,21 @@ - {{ monitor.element.name }} + + {{ monitor.element.name }} + +

{{ monitor.element.name }}

+
@@ -101,6 +115,27 @@ export default { removeMonitor(groupIndex, index) { this.$root.publicGroupList[groupIndex].monitorList.splice(index, 1); }, + + /** + * Toggle the value of sendUrl + * @param {number} groupIndex Index of group monitor is member of + * @param {number} index Index of monitor within group + */ + toggleLink(groupIndex, index) { + this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl = !this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl; + }, + + /** + * Should a link to the monitor be shown? + * Attempts to guess if a link should be shown based upon if + * sendUrl is set and if the URL is default or not. + * @param {Object} monitor Monitor to check + * @returns {boolean} + */ + showLink(monitor) { + return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://"; + + }, } }; @@ -119,6 +154,17 @@ export default { min-height: 46px; } +.item-name { + padding-left: 5px; + padding-right: 5px; + margin: 0; + display: inline-block; +} + +.link-active { + color: #4caf50; +} + .flip-list-move { transition: transform 0.5s; } diff --git a/src/icon.js b/src/icon.js index d83034fa7..23513bccf 100644 --- a/src/icon.js +++ b/src/icon.js @@ -81,6 +81,7 @@ library.add( faUndo, faPlusCircle, faAngleDown, + faLink, ); export { FontAwesomeIcon }; From 5f6347d277695f8af5a68b186b373809f7a03272 Mon Sep 17 00:00:00 2001 From: Daeho Ro Date: Sun, 12 Jun 2022 04:02:44 +0900 Subject: [PATCH 09/96] pull request for adding alertnow notification --- server/notification-providers/alertnow.js | 50 ++++++++++ server/notification.js | 68 ++++++------- src/components/notifications/AlertNow.vue | 13 +++ src/components/notifications/index.js | 112 +++++++++++----------- 4 files changed, 155 insertions(+), 88 deletions(-) create mode 100644 server/notification-providers/alertnow.js create mode 100644 src/components/notifications/AlertNow.vue diff --git a/server/notification-providers/alertnow.js b/server/notification-providers/alertnow.js new file mode 100644 index 000000000..d778b01d3 --- /dev/null +++ b/server/notification-providers/alertnow.js @@ -0,0 +1,50 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); +const { setting } = require("../util-server"); +const { getMonitorRelativeURL, UP, DOWN } = require("../../src/util"); + +class AlertNow extends NotificationProvider { + + name = "AlertNow"; + + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + let okMsg = "Sent Successfully."; + try { + let textMsg = ""; + let status = "open"; + let eventType = "ERROR"; + let eventId = new Date().toISOString().slice(0, 10).replace(/-/g, ""); + + if (heartbeatJSON && heartbeatJSON.status === UP) { + textMsg = `[${heartbeatJSON.name}] ✅ Application is back online`; + status = "close"; + eventType = "INFO"; + eventId += `_${heartbeatJSON.name.replace(/\s/g, "")}`; + } else if (heartbeatJSON && heartbeatJSON.status === DOWN) { + textMsg = `[${heartbeatJSON.name}] 🔴 Application went down`; + } + + textMsg += ` - ${msg}`; + + const baseURL = await setting("primaryBaseURL"); + if (baseURL && monitorJSON) { + textMsg += ` >> ${baseURL + getMonitorRelativeURL(monitorJSON.id)}`; + } + + const data = { + "summary": textMsg, + "status": status, + "event_type": eventType, + "event_id": eventId, + }; + + await axios.post(notification.alertNowWebhookURL, data); + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + + } +} + +module.exports = AlertNow; diff --git a/server/notification.js b/server/notification.js index c457ed144..a3b3a70b6 100644 --- a/server/notification.js +++ b/server/notification.js @@ -1,40 +1,41 @@ const { R } = require("redbean-node"); +const { log } = require("../src/util"); +const Alerta = require("./notification-providers/alerta"); +const AlertNow = require("./notification-providers/alertnow"); +const AliyunSms = require("./notification-providers/aliyun-sms"); const Apprise = require("./notification-providers/apprise"); +const Bark = require("./notification-providers/bark"); +const ClickSendSMS = require("./notification-providers/clicksendsms"); +const DingDing = require("./notification-providers/dingding"); const Discord = require("./notification-providers/discord"); +const Feishu = require("./notification-providers/feishu"); +const GoogleChat = require("./notification-providers/google-chat"); +const Gorush = require("./notification-providers/gorush"); const Gotify = require("./notification-providers/gotify"); -const Ntfy = require("./notification-providers/ntfy"); const Line = require("./notification-providers/line"); const LunaSea = require("./notification-providers/lunasea"); -const Mattermost = require("./notification-providers/mattermost"); const Matrix = require("./notification-providers/matrix"); +const Mattermost = require("./notification-providers/mattermost"); +const Ntfy = require("./notification-providers/ntfy"); const Octopush = require("./notification-providers/octopush"); +const OneBot = require("./notification-providers/onebot"); +const PagerDuty = require("./notification-providers/pagerduty"); const PromoSMS = require("./notification-providers/promosms"); -const ClickSendSMS = require("./notification-providers/clicksendsms"); const Pushbullet = require("./notification-providers/pushbullet"); +const PushDeer = require("./notification-providers/pushdeer"); const Pushover = require("./notification-providers/pushover"); const Pushy = require("./notification-providers/pushy"); -const TechulusPush = require("./notification-providers/techulus-push"); const RocketChat = require("./notification-providers/rocket-chat"); +const SerwerSMS = require("./notification-providers/serwersms"); const Signal = require("./notification-providers/signal"); const Slack = require("./notification-providers/slack"); const SMTP = require("./notification-providers/smtp"); +const Stackfield = require("./notification-providers/stackfield"); const Teams = require("./notification-providers/teams"); +const TechulusPush = require("./notification-providers/techulus-push"); const Telegram = require("./notification-providers/telegram"); const Webhook = require("./notification-providers/webhook"); -const Feishu = require("./notification-providers/feishu"); -const AliyunSms = require("./notification-providers/aliyun-sms"); -const DingDing = require("./notification-providers/dingding"); -const Bark = require("./notification-providers/bark"); -const { log } = require("../src/util"); -const SerwerSMS = require("./notification-providers/serwersms"); -const Stackfield = require("./notification-providers/stackfield"); const WeCom = require("./notification-providers/wecom"); -const GoogleChat = require("./notification-providers/google-chat"); -const PagerDuty = require("./notification-providers/pagerduty"); -const Gorush = require("./notification-providers/gorush"); -const Alerta = require("./notification-providers/alerta"); -const OneBot = require("./notification-providers/onebot"); -const PushDeer = require("./notification-providers/pushdeer"); class Notification { @@ -47,41 +48,42 @@ class Notification { this.providerList = {}; const list = [ - new Apprise(), + new Alerta(), + new AlertNow(), new AliyunSms(), + new Apprise(), + new Bark(), + new ClickSendSMS(), new DingDing(), new Discord(), - new Teams(), + new Feishu(), + new GoogleChat(), + new Gorush(), new Gotify(), - new Ntfy(), new Line(), new LunaSea(), - new Feishu(), - new Mattermost(), new Matrix(), + new Mattermost(), + new Ntfy(), new Octopush(), + new OneBot(), + new PagerDuty(), new PromoSMS(), - new ClickSendSMS(), new Pushbullet(), + new PushDeer(), new Pushover(), new Pushy(), - new TechulusPush(), new RocketChat(), + new SerwerSMS(), new Signal(), new Slack(), new SMTP(), + new Stackfield(), + new Teams(), + new TechulusPush(), new Telegram(), new Webhook(), - new Bark(), - new SerwerSMS(), - new Stackfield(), new WeCom(), - new GoogleChat(), - new PagerDuty(), - new Gorush(), - new Alerta(), - new OneBot(), - new PushDeer(), ]; for (let item of list) { diff --git a/src/components/notifications/AlertNow.vue b/src/components/notifications/AlertNow.vue new file mode 100644 index 000000000..93acc9590 --- /dev/null +++ b/src/components/notifications/AlertNow.vue @@ -0,0 +1,13 @@ + diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 18c316a53..e5cbe8ce3 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -1,38 +1,39 @@ -import STMP from "./SMTP.vue"; -import Telegram from "./Telegram.vue"; +import Alerta from "./Alerta.vue"; +import AlertNow from "./AlertNow.vue"; +import AliyunSMS from "./AliyunSms.vue"; +import Apprise from "./Apprise.vue"; +import Bark from "./Bark.vue"; +import ClickSendSMS from "./ClickSendSMS.vue"; +import DingDing from "./DingDing.vue"; import Discord from "./Discord.vue"; -import Webhook from "./Webhook.vue"; -import Signal from "./Signal.vue"; +import Feishu from "./Feishu.vue"; +import GoogleChat from "./GoogleChat.vue"; +import Gorush from "./Gorush.vue"; import Gotify from "./Gotify.vue"; +import Line from "./Line.vue"; +import LunaSea from "./LunaSea.vue"; +import Matrix from "./Matrix.vue"; +import Mattermost from "./Mattermost.vue"; import Ntfy from "./Ntfy.vue"; -import Slack from "./Slack.vue"; -import RocketChat from "./RocketChat.vue"; -import Teams from "./Teams.vue"; +import Octopush from "./Octopush.vue"; +import OneBot from "./OneBot.vue"; +import PagerDuty from "./PagerDuty.vue"; +import PromoSMS from "./PromoSMS.vue"; +import Pushbullet from "./Pushbullet.vue"; +import PushDeer from "./PushDeer.vue"; import Pushover from "./Pushover.vue"; import Pushy from "./Pushy.vue"; -import TechulusPush from "./TechulusPush.vue"; -import Octopush from "./Octopush.vue"; -import PromoSMS from "./PromoSMS.vue"; -import ClickSendSMS from "./ClickSendSMS.vue"; -import LunaSea from "./LunaSea.vue"; -import Feishu from "./Feishu.vue"; -import Apprise from "./Apprise.vue"; -import Pushbullet from "./Pushbullet.vue"; -import Line from "./Line.vue"; -import Mattermost from "./Mattermost.vue"; -import Matrix from "./Matrix.vue"; -import AliyunSMS from "./AliyunSms.vue"; -import DingDing from "./DingDing.vue"; -import Bark from "./Bark.vue"; +import RocketChat from "./RocketChat.vue"; import SerwerSMS from "./SerwerSMS.vue"; +import Signal from "./Signal.vue"; +import Slack from "./Slack.vue"; import Stackfield from "./Stackfield.vue"; +import STMP from "./SMTP.vue"; +import Teams from "./Teams.vue"; +import TechulusPush from "./TechulusPush.vue"; +import Telegram from "./Telegram.vue"; +import Webhook from "./Webhook.vue"; import WeCom from "./WeCom.vue"; -import GoogleChat from "./GoogleChat.vue"; -import PagerDuty from "./PagerDuty.vue"; -import Gorush from "./Gorush.vue"; -import Alerta from "./Alerta.vue"; -import OneBot from "./OneBot.vue"; -import PushDeer from "./PushDeer.vue"; /** * Manage all notification form. @@ -40,41 +41,42 @@ import PushDeer from "./PushDeer.vue"; * @type { Record } */ const NotificationFormList = { - "telegram": Telegram, - "webhook": Webhook, - "smtp": STMP, - "discord": Discord, - "teams": Teams, - "signal": Signal, - "gotify": Gotify, - "ntfy": Ntfy, - "slack": Slack, - "rocket.chat": RocketChat, - "pushover": Pushover, - "pushy": Pushy, - "PushByTechulus": TechulusPush, - "octopush": Octopush, - "promosms": PromoSMS, - "clicksendsms": ClickSendSMS, - "lunasea": LunaSea, - "Feishu": Feishu, + "alerta": Alerta, + "AlertNow": AlertNow, "AliyunSMS": AliyunSMS, "apprise": Apprise, - "pushbullet": Pushbullet, - "line": Line, - "mattermost": Mattermost, - "matrix": Matrix, - "DingDing": DingDing, "Bark": Bark, - "serwersms": SerwerSMS, - "stackfield": Stackfield, - "WeCom": WeCom, + "clicksendsms": ClickSendSMS, + "DingDing": DingDing, + "discord": Discord, + "Feishu": Feishu, "GoogleChat": GoogleChat, - "PagerDuty": PagerDuty, "gorush": Gorush, - "alerta": Alerta, + "gotify": Gotify, + "line": Line, + "lunasea": LunaSea, + "matrix": Matrix, + "mattermost": Mattermost, + "ntfy": Ntfy, + "octopush": Octopush, "OneBot": OneBot, + "PagerDuty": PagerDuty, + "promosms": PromoSMS, + "pushbullet": Pushbullet, + "PushByTechulus": TechulusPush, "PushDeer": PushDeer, + "pushover": Pushover, + "pushy": Pushy, + "rocket.chat": RocketChat, + "serwersms": SerwerSMS, + "signal": Signal, + "slack": Slack, + "smtp": STMP, + "stackfield": Stackfield, + "teams": Teams, + "telegram": Telegram, + "webhook": Webhook, + "WeCom": WeCom, }; export default NotificationFormList; From 42848bcd2efdb9ed7f31556738f2eddab1e171b3 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Wed, 15 Jun 2022 09:00:47 -0500 Subject: [PATCH 10/96] updated translations --- src/languages/bg-BG.js | 1 + src/languages/de-DE.js | 1 + src/languages/en.js | 1 + src/languages/ko-KR.js | 1 + src/languages/pl.js | 1 + src/languages/ru-RU.js | 3 ++- src/languages/uk-UA.js | 3 ++- src/languages/zh-CN.js | 1 + src/languages/zh-TW.js | 1 + src/pages/EditMonitor.vue | 6 +++--- 10 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index 68297dc28..a6697fa74 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -421,6 +421,7 @@ export default { Next: "Следващ", "The slug is already taken. Please choose another slug.": "Този слъг вече се използва. Моля изберете друг.", "No Proxy": "Без прокси", + Authentication: "Удостоверяване", "HTTP Basic Auth": "HTTP основно удостоверяване", "New Status Page": "Нова статус страница", "Page Not Found": "Страницата не е открита", diff --git a/src/languages/de-DE.js b/src/languages/de-DE.js index 77d3962d7..561337524 100644 --- a/src/languages/de-DE.js +++ b/src/languages/de-DE.js @@ -421,6 +421,7 @@ export default { Next: "Weiter", "The slug is already taken. Please choose another slug.": "Der Slug ist bereits in Verwendung. Bitte wähle einen anderen.", "No Proxy": "Kein Proxy", + Authentication: "Authentifizierung", "HTTP Basic Auth": "HTTP Basisauthentifizierung", "New Status Page": "Neue Status-Seite", "Page Not Found": "Seite nicht gefunden", diff --git a/src/languages/en.js b/src/languages/en.js index a8965c114..cbe530f3f 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -438,6 +438,7 @@ export default { Next: "Next", "The slug is already taken. Please choose another slug.": "The slug is already taken. Please choose another slug.", "No Proxy": "No Proxy", + Authentication: "Authentication", "HTTP Basic Auth": "HTTP Basic Auth", "New Status Page": "New Status Page", "Page Not Found": "Page Not Found", diff --git a/src/languages/ko-KR.js b/src/languages/ko-KR.js index dd6ed9844..8cf612f94 100644 --- a/src/languages/ko-KR.js +++ b/src/languages/ko-KR.js @@ -438,6 +438,7 @@ export default { Next: "다음", "The slug is already taken. Please choose another slug.": "이미 존재하는 주소에요. 다른 주소를 사용해 주세요.", "No Proxy": "프록시 없음", + Authentication: "인증", "HTTP Basic Auth": "HTTP 인증", "New Status Page": "새로운 상태 페이지", "Page Not Found": "페이지를 찾을 수 없어요", diff --git a/src/languages/pl.js b/src/languages/pl.js index 32b291622..c317d0f94 100644 --- a/src/languages/pl.js +++ b/src/languages/pl.js @@ -428,6 +428,7 @@ export default { Next: "Dalej", "The slug is already taken. Please choose another slug.": "Ten symbol jest już zajęty. Proszę, wybierz inny.", "No Proxy": "Bez proxy", + Authentication: "Uwierzytelnianie", "HTTP Basic Auth": "Podstawowa autoryzacja HTTP", "New Status Page": "Nowa strona statusu", "Page Not Found": "Strona nie została znaleziona", diff --git a/src/languages/ru-RU.js b/src/languages/ru-RU.js index 3becb5901..7001160cd 100644 --- a/src/languages/ru-RU.js +++ b/src/languages/ru-RU.js @@ -351,7 +351,8 @@ export default { "Start or end with a-z 0-9 only": "Начало и окончание имени только на символы: a-z 0-9", "No consecutive dashes --": "Запрещено использовать тире --", "HTTP Options": "HTTP Опции", - "Basic Auth": "HTTP Авторизация", + Authentication: "Аутентификация", + "HTTP Basic Auth": "HTTP Авторизация", PushByTechulus: "Push by Techulus", clicksendsms: "ClickSend SMS", GoogleChat: "Google Chat (только Google Workspace)", diff --git a/src/languages/uk-UA.js b/src/languages/uk-UA.js index 2016ed3a9..75e330295 100644 --- a/src/languages/uk-UA.js +++ b/src/languages/uk-UA.js @@ -350,7 +350,8 @@ export default { "Start or end with a-z 0-9 only": "Початок та закінчення імені лише на символи: a-z 0-9", "No consecutive dashes --": "Заборонено використовувати тире --", "HTTP Options": "HTTP Опції", - "Basic Auth": "HTTP Авторизація", + Authentication: "Аутентифікація", + "HTTP Basic Auth": "HTTP Авторизація", PushByTechulus: "Push by Techulus", clicksendsms: "ClickSend SMS", GoogleChat: "Google Chat (тільки Google Workspace)", diff --git a/src/languages/zh-CN.js b/src/languages/zh-CN.js index 2ea2dfb5d..80e09fc4f 100644 --- a/src/languages/zh-CN.js +++ b/src/languages/zh-CN.js @@ -436,6 +436,7 @@ export default { Next: "下一步", "The slug is already taken. Please choose another slug.": "该路径已被使用。请选择其他路径。", "No Proxy": "无代理", + Authentication: "验证", "HTTP Basic Auth": "HTTP 基础身份验证", "New Status Page": "新的状态页", "Page Not Found": "未找到该页面", diff --git a/src/languages/zh-TW.js b/src/languages/zh-TW.js index 1307b40bf..f7b1abc12 100644 --- a/src/languages/zh-TW.js +++ b/src/languages/zh-TW.js @@ -428,6 +428,7 @@ export default { Next: "下一步", "The slug is already taken. Please choose another slug.": "此 slug 已被使用。請選擇其他 slug。", "No Proxy": "無 Proxy", + Authentication: "驗證", "HTTP Basic Auth": "HTTP 基本驗證", "New Status Page": "新狀態頁", "Page Not Found": "找不到頁面", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 83ffcfd86..4d39dc9fc 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -369,17 +369,17 @@
-

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

+

{{ $t("Authentication") }}

@@ -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 15/96] 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 dc403cbd9..89777bcef 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 16/96] 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 89777bcef..0ac13c689 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 dd09351c8e2f7f63358185ba0901b34300a3d7ca Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 16 Jun 2022 19:34:47 +0800 Subject: [PATCH 17/96] Update to 1.17.0-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index efb3e7c10..3cc85d099 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.17.0-beta.0", + "version": "1.17.0-beta.1", "license": "MIT", "repository": { "type": "git", From 012be23509a78e453d902604ca432b1e353155f1 Mon Sep 17 00:00:00 2001 From: AnnAngela-work Date: Thu, 16 Jun 2022 21:20:12 +0800 Subject: [PATCH 18/96] Update i18n --- src/languages/en.js | 3 +++ src/languages/zh-CN.js | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index cbe530f3f..b098c5377 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -529,4 +529,7 @@ export default { "Query": "Query", settingsCertificateExpiry: "TLS Certificate Expiry", certificationExpiryDescription: "HTTPS Monitors trigger notification when TLS certificate expires in:", + "ntfy Topic": "ntfy Topic", + "Domain": "Domain", + "Workstation": "Workstation", }; diff --git a/src/languages/zh-CN.js b/src/languages/zh-CN.js index 80e09fc4f..170e42708 100644 --- a/src/languages/zh-CN.js +++ b/src/languages/zh-CN.js @@ -523,11 +523,18 @@ export default { dnsPortDescription: "DNS 服务器端口,默认为 53,你可以在任何时候更改此端口.", error: "错误", critical: "关键", - wayToGetPagerDutyKey: "你可以在 Service -> Service Directory -> (Select a service) -> Integrations -> Add integration 页面中搜索 \"Events API V2\" 以获取此 Integration Key,更多信息请参见 {0}", + wayToGetPagerDutyKey: "你可以在 Service -> Service Directory -> (选择一个 Service) -> Integrations -> Add integration 页面中搜索 \"Events API V2\" 以获取此 Integration Key,更多信息请参见 {0}", "Integration Key": "Integration Key", "Integration URL": "Integration URL", "Auto resolve or acknowledged": "自动标记为已解决或已读", "do nothing": "不做任何操作", "auto acknowledged": "自动标记为已读", "auto resolve": "自动标记为已解决", + "Connection String": "连接字符串", + Query: "查询语句", + settingsCertificateExpiry: "TLS 证书过期通知", + certificationExpiryDescription: "HTTPS 监控项发现被监控目标的 TLS 证书剩余有效期少于以下天数时将发出通知:", + "ntfy Topic": "ntfy 主题", + "Domain": "域名", + "Workstation": "工作站", }; From b4a4171178855a149aab6f3bab9fcd1f970859e7 Mon Sep 17 00:00:00 2001 From: MrEddX <66828538+MrEddX@users.noreply.github.com> Date: Thu, 16 Jun 2022 21:08:17 +0300 Subject: [PATCH 19/96] Update bg-BG.js Translation fixes. --- src/languages/bg-BG.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/languages/bg-BG.js b/src/languages/bg-BG.js index a6697fa74..3271d849c 100644 --- a/src/languages/bg-BG.js +++ b/src/languages/bg-BG.js @@ -89,11 +89,11 @@ export default { "Search Engine Visibility": "Видимост за търсачки", "Allow indexing": "Разреши индексиране", "Discourage search engines from indexing site": "Не позволявай на търсачките да индексират този сайт", - "Change Password": "Промени парола", + "Change Password": "Промяна на парола", "Current Password": "Текуща парола", "New Password": "Нова парола", "Repeat New Password": "Повторете новата парола", - "Update Password": "Актуализирай парола", + "Update Password": "Актуализирай паролата", "Disable Auth": "Изключи удостоверяване", "Enable Auth": "Включи удостоверяване", Logout: "Изход от профила", @@ -144,7 +144,7 @@ export default { "Setup 2FA": "Настройка 2FA", "Enable 2FA": "Включи 2FA", "Disable 2FA": "Изключи 2FA", - "2FA Settings": "Настройки 2FA", + "2FA Settings": "Настройка за 2FA", "Two Factor Authentication": "Двуфакторно удостоверяване", Active: "Активно", Inactive: "Неактивно", @@ -298,7 +298,7 @@ export default { HeadersInvalidFormat: "Заявените хедъри не са валидни JSON: ", BodyInvalidFormat: "Заявеното съобщение не е валиден JSON: ", "Monitor History": "История на мониторите", - clearDataOlderThan: "Ще се съхранява {0} дни.", + clearDataOlderThan: "Ще се съхранява за {0} дни.", records: "записа", "One record": "Един запис", steamApiKeyDescription: "За да мониторирате Steam Gameserver се нуждаете от Steam Web-API ключ. Може да регистрирате Вашия API ключ тук: ", @@ -307,12 +307,12 @@ export default { PasswordsDoNotMatch: "Паролите не съвпадат.", "Current User": "Текущ потребител", recent: "Скорошни", - shrinkDatabaseDescription: "Инициира \"VACUUM\" за \"SQLite\" база данни. Ако Вашата база данни е създадена след версия 1.10.0, \"AUTO_VACUUM\" функцията е активна и това действие не нужно.", + shrinkDatabaseDescription: "Инициира \"VACUUM\" за \"SQLite\" база данни. Ако Вашата база данни е създадена след версия 1.10.0, \"AUTO_VACUUM\" функцията е активна и това действие не е нужно.", Done: "Готово", Info: "Информация", Security: "Сигурност", "Steam API Key": "Steam API ключ", - "Shrink Database": "Редуциране база данни", + "Shrink Database": "Редуцирай базата данни", "Pick a RR-Type...": "Изберете вида на ресурсния запис за мониторитане...", "Pick Accepted Status Codes...": "Изберете статус кодове, които да се считат за успешен отговор...", Default: "По подразбиране", @@ -517,16 +517,16 @@ export default { wayToGetClickSendSMSToken: "Може да получите API потребителско име и API ключ от {0} .", dnsPortDescription: "DNS порт на сървъра. По подразбиране е 53, но може да бъде променен по всяко време.", error: "грешка", - critical: "критична", - wayToGetPagerDutyKey: "Може да го получите като посетите Service -> Service Directory -> (Select a service) -> Integrations -> Add integration. Тук може да потърсите \"Events API V2\". Повече информация {0}", + critical: "критично", + wayToGetPagerDutyKey: "Може да го получите като посетите Service -> Service Directory -> (Select a service) -> Integrations -> Add integration. Тук трябва да потърсите \"Events API V2\". Повече информация {0}", "Integration Key": "Ключ за интегриране", "Integration URL": "URL адрес за интеграция", "Auto resolve or acknowledged": "Автоматично разрешаване или потвърждаване", "do nothing": "не прави нищо", "auto acknowledged": "автоматично потвърждаване", - "auto resolve": "автоматично потвърждаване", + "auto resolve": "автоматично разрешаване", "Connection String": "Стринг за връзка", Query: "Заявка", settingsCertificateExpiry: "Изтичане валидността на TLS сертификата", - certificationExpiryDescription: "HTTPS мониторите задействат известие при изтичане на TLS сертификата в:", + certificationExpiryDescription: "HTTPS мониторите ще задействат известие, ако е наличен изтичащ TLS сертификат, през следващите:", }; From bcd616a4d007d26b99ceb1d5ee3d7206a460c309 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 17 Jun 2022 15:07:55 +0800 Subject: [PATCH 20/96] Fix names in CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 079225c2c..c6bfb073a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,8 +86,8 @@ I personally do not like something need to learn so much and need to config so m ## Name convention - Javascript/Typescript: camelCaseType -- SQLite: underscore_type -- CSS/SCSS: dash-type +- SQLite: snake_case (Underscore) +- CSS/SCSS: kebab-case (Dash) ## Tools From c4e2d67d17319cc438be7174aaea3f7f6f560077 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 17 Jun 2022 10:11:53 +0300 Subject: [PATCH 21/96] 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 aea58bf1b..57519f557 100644 --- a/src/layouts/Layout.vue +++ b/src/layouts/Layout.vue @@ -77,7 +77,7 @@
-