From b0d6b5b13d59de628eeb8820cfb3023d8501566a Mon Sep 17 00:00:00 2001 From: George Tsomlektsis Date: Mon, 3 Oct 2022 17:48:34 +0300 Subject: [PATCH 1/8] Fixed entry route not redirecting correctly when the status entry page changes slug. --- server/server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/server.js b/server/server.js index 0c9a45e6..0f215245 100644 --- a/server/server.js +++ b/server/server.js @@ -155,7 +155,9 @@ let needSetup = false; Database.init(args); await initDatabase(testMode); - exports.entryPage = await setting("entryPage"); + const entryPage = (await getSettings("general"))["entryPage"]; + exports.entryPage = entryPage; + UptimeKumaServer.getInstance().entryPage = entryPage; await StatusPage.loadDomainMappingList(); log.info("server", "Adding route"); @@ -176,14 +178,15 @@ let needSetup = false; log.debug("entry", `Request Domain: ${hostname}`); + const uptimeKumaEntryPage=UptimeKumaServer.getInstance().entryPage; if (hostname in StatusPage.domainMappingList) { log.debug("entry", "This is a status page domain"); let slug = StatusPage.domainMappingList[hostname]; await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug); - } else if (exports.entryPage && exports.entryPage.startsWith("statusPage-")) { - response.redirect("/status/" + exports.entryPage.replace("statusPage-", "")); + } else if (uptimeKumaEntryPage && uptimeKumaEntryPage.startsWith('statusPage-')) { + response.redirect("/status/" + uptimeKumaEntryPage.replace("statusPage-", "")); } else { response.redirect("/dashboard"); @@ -200,7 +203,7 @@ let needSetup = false; // Robots.txt app.get("/robots.txt", async (_request, response) => { let txt = "User-agent: *\nDisallow:"; - if (! await setting("searchEngineIndex")) { + if (!await setting("searchEngineIndex")) { txt += " /"; } response.setHeader("Content-Type", "text/plain"); @@ -1085,6 +1088,7 @@ let needSetup = false; await setSettings("general", data); exports.entryPage = data.entryPage; + UptimeKumaServer.getInstance().entryPage = data.entryPage; callback({ ok: true, From 3e699f8ac3c544cd0dd7d9459ef9b8da3c7efd65 Mon Sep 17 00:00:00 2001 From: George Tsomlektsis Date: Mon, 3 Oct 2022 18:01:52 +0300 Subject: [PATCH 2/8] Fix linting errors. --- server/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.js b/server/server.js index 0f215245..620e5bb4 100644 --- a/server/server.js +++ b/server/server.js @@ -178,14 +178,14 @@ let needSetup = false; log.debug("entry", `Request Domain: ${hostname}`); - const uptimeKumaEntryPage=UptimeKumaServer.getInstance().entryPage; + const uptimeKumaEntryPage = UptimeKumaServer.getInstance().entryPage; if (hostname in StatusPage.domainMappingList) { log.debug("entry", "This is a status page domain"); let slug = StatusPage.domainMappingList[hostname]; await StatusPage.handleStatusPageResponse(response, server.indexHTML, slug); - } else if (uptimeKumaEntryPage && uptimeKumaEntryPage.startsWith('statusPage-')) { + } else if (uptimeKumaEntryPage && uptimeKumaEntryPage.startsWith("statusPage-")) { response.redirect("/status/" + uptimeKumaEntryPage.replace("statusPage-", "")); } else { From ad1a7c255f214d2ce0be9d71d0d232d246fb64f9 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 8 Oct 2022 23:56:58 +0800 Subject: [PATCH 3/8] Drop exports.entryPage fully --- server/server.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/server.js b/server/server.js index 620e5bb4..2efad753 100644 --- a/server/server.js +++ b/server/server.js @@ -127,6 +127,7 @@ const StatusPage = require("./model/status_page"); const { cloudflaredSocketHandler, autoStart: cloudflaredAutoStart, stop: cloudflaredStop } = require("./socket-handlers/cloudflared-socket-handler"); const { proxySocketHandler } = require("./socket-handlers/proxy-socket-handler"); const { dockerSocketHandler } = require("./socket-handlers/docker-socket-handler"); +const { Settings } = require("./settings"); app.use(express.json()); @@ -155,9 +156,7 @@ let needSetup = false; Database.init(args); await initDatabase(testMode); - const entryPage = (await getSettings("general"))["entryPage"]; - exports.entryPage = entryPage; - UptimeKumaServer.getInstance().entryPage = entryPage; + server.entryPage = await Settings.get("entryPage"); await StatusPage.loadDomainMappingList(); log.info("server", "Adding route"); @@ -178,7 +177,7 @@ let needSetup = false; log.debug("entry", `Request Domain: ${hostname}`); - const uptimeKumaEntryPage = UptimeKumaServer.getInstance().entryPage; + const uptimeKumaEntryPage = server.entryPage; if (hostname in StatusPage.domainMappingList) { log.debug("entry", "This is a status page domain"); @@ -1087,8 +1086,7 @@ let needSetup = false; } await setSettings("general", data); - exports.entryPage = data.entryPage; - UptimeKumaServer.getInstance().entryPage = data.entryPage; + server.entryPage = data.entryPage; callback({ ok: true, From 180d881ac122fb8f85805153f2342725a4843851 Mon Sep 17 00:00:00 2001 From: Alexander Borzov <59200516+Borzoff@users.noreply.github.com> Date: Tue, 11 Oct 2022 10:35:08 +0300 Subject: [PATCH 4/8] Update ru-RU.js (#2217) --- src/languages/ru-RU.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/languages/ru-RU.js b/src/languages/ru-RU.js index 0aaf0968..6922f51b 100644 --- a/src/languages/ru-RU.js +++ b/src/languages/ru-RU.js @@ -393,6 +393,12 @@ export default { alertaAlertState: "Состояние алерта", alertaRecoverState: "Состояние восстановления", Proxies: "Прокси", + "Setup Proxy": "Настройка Прокси", + "Proxy Protocol": "Протокол Прокси", + "Proxy Server": "Прокси", + "Proxy server has authentication": "Прокси имеет аутентификацию", + "Reverse Proxy": "Обратный прокси", + "No Proxy": "Без прокси", default: "По умолчанию", enabled: "Включено", setAsDefault: "Установлено по умолчанию", From cb5f90aa89eae0d84c7eb62c98c956b7055183a3 Mon Sep 17 00:00:00 2001 From: MagicFun1241 Date: Wed, 12 Oct 2022 19:27:50 +0300 Subject: [PATCH 5/8] Update Russian locale (#2218) * Update ru-RU.js * Remove duplicates * Remove duplicates x2 * Revert to previous version for one translation * Removed conflicting lines * Remove conflicting 'Reverse Proxy' key --- src/languages/ru-RU.js | 172 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/src/languages/ru-RU.js b/src/languages/ru-RU.js index 6922f51b..2e6fdf7b 100644 --- a/src/languages/ru-RU.js +++ b/src/languages/ru-RU.js @@ -406,4 +406,176 @@ export default { proxyDescription: "Прокси должны быть привязаны к монитору, чтобы работать.", enableProxyDescription: "Этот прокси не будет влиять на запросы монитора, пока не будет активирован. Вы можете контролировать временное отключение прокси для всех мониторов через статус активации.", setAsDefaultProxyDescription: "Этот прокси будет по умолчанию включен для новых мониторов. Вы всё ещё можете отдельно отключать прокси в каждом мониторе.", + Invalid: "Недействительный", + AccessKeyId: "AccessKey ID", + SecretAccessKey: "AccessKey Secret", + PhoneNumbers: "PhoneNumbers", + TemplateCode: "TemplateCode", + SignName: "SignName", + "Sms template must contain parameters: ": "Шаблон СМС должен содержать параметры: ", + "Bark Endpoint": "Bark Endpoint", + "Bark Group": "Bark Group", + "Bark Sound": "Bark Sound", + WebHookUrl: "WebHookUrl", + SecretKey: "SecretKey", + "For safety, must use secret key": "В целях безопасности необходимо использовать секретный ключ", + "Device Token": "Токен устройства", + Platform: "Платформа", + iOS: "iOS", + Android: "Android", + Huawei: "Huawei", + High: "High", + Retry: "Повторить", + Topic: "Тема", + "WeCom Bot Key": "WeCom Bot Key", + User: "Пользователь", + Installed: "Установлено", + "Not installed": "Не установлено", + Running: "Запускается", + "Not running": "Не запускается", + "Remove Token": "Удалить токен", + Start: "Запустить", + Stop: "Остановить", + "Uptime Kuma": "Uptime Kuma", + Slug: "Slug", + "Accept characters:": "Принимаемые символы:", + startOrEndWithOnly: "Начинается или кончается только {0}", + "No consecutive dashes": "Без последовательных тире", + "The slug is already taken. Please choose another slug.": "The slug is already taken. Please choose another slug.", + "Page Not Found": "Страница не найдена", + wayToGetCloudflaredURL: "(Скачать cloudflared с {0})", + cloudflareWebsite: "Cloudflare Website", + "Message:": "Сообщение:", + "Don't know how to get the token? Please read the guide:": "Don't know how to get the token? Please read the guide:", + "The current connection may be lost if you are currently connecting via Cloudflare Tunnel. Are you sure want to stop it? Type your current password to confirm it.": "The current connection may be lost if you are currently connecting via Cloudflare Tunnel. Are you sure want to stop it? Type your current password to confirm it.", + "HTTP Headers": "HTTP заголовки", + "Trust Proxy": "Доверять прокси", + "Other Software": "Другое программное обеспечение", + "For example: nginx, Apache and Traefik.": "К примеру: nginx, Apache и Traefik.", + "Please read": "Пожалуйста, прочитайте", + "Subject:": "Тема:", + "Valid To:": "Действителен до:", + "Days Remaining:": "Дней осталось:", + "Issuer:": "Издатель:", + "Fingerprint:": "Отпечаток:", + "No status pages": "Нет статусных страниц", + "Domain Name Expiry Notification": "Уведомление об истечении срока действия доменного имени", + Proxy: "Прокси", + "Date Created": "Дата создания", + HomeAssistant: "Home Assistant", + onebotHttpAddress: "OneBot HTTP Address", + onebotMessageType: "OneBot Message Type", + onebotGroupMessage: "Группа", + onebotPrivateMessage: "Private", + onebotUserOrGroupId: "Группа/ID пользователя", + onebotSafetyTips: "В целях безопасности необходимо установить токен доступа", + "PushDeer Key": "PushDeer Key", + "Footer Text": "Текст нижнего колонтитула", + "Show Powered By": "Показывать на чем создано", + "Domain Names": "Доменные имена", + signedInDisp: "Вы вошли как {0}", + signedInDispDisabled: "Аутентификация отключена.", + RadiusSecret: "Секрет Radius", + RadiusSecretDescription: "Общий секрет между клиентом и сервером", + RadiusCalledStationId: "Идентификатор вызываемой станции", + RadiusCalledStationIdDescription: "Идентификатор вызываемого устройства", + RadiusCallingStationId: "Идентификатор вызывающей станции", + RadiusCallingStationIdDescription: "Идентификатор вызывающего устройства", + "Certificate Expiry Notification": "Уведомление об истечении срока действия сертификата", + "API Username": "Имя пользователя API", + "API Key": "API ключ", + "Recipient Number": "Номер получателя", + "From Name/Number": "Имя/номер отправителя", + "Leave blank to use a shared sender number.": "Оставьте пустым, чтобы использовать общий номер отправителя.", + "Octopush API Version": "Версия API Octopush", + "Legacy Octopush-DM": "Legacy Octopush-DM", + endpoint: "endpoint", + octopushAPIKey: "\"API key\" из учетных данных HTTP API в панели управления", + octopushLogin: "\"Login\" из учетных данных HTTP API в панели управления", + promosmsLogin: "Логин API", + promosmsPassword: "Пароль API", + "pushoversounds pushover": "Pushover (default)", + "pushoversounds bike": "Bike", + "pushoversounds bugle": "Bugle", + "pushoversounds cashregister": "Cash Register", + "pushoversounds classical": "Classical", + "pushoversounds cosmic": "Cosmic", + "pushoversounds falling": "Falling", + "pushoversounds gamelan": "Gamelan", + "pushoversounds incoming": "Incoming", + "pushoversounds intermission": "Intermission", + "pushoversounds magic": "Magic", + "pushoversounds mechanical": "Mechanical", + "pushoversounds pianobar": "Piano Bar", + "pushoversounds siren": "Siren", + "pushoversounds spacealarm": "Space Alarm", + "pushoversounds tugboat": "Tug Boat", + "pushoversounds alien": "Alien Alarm (long)", + "pushoversounds climb": "Climb (long)", + "pushoversounds persistent": "Persistent (long)", + "pushoversounds echo": "Pushover Echo (long)", + "pushoversounds updown": "Up Down (long)", + "pushoversounds vibrate": "Vibrate Only", + "pushoversounds none": "None (silent)", + pushyAPIKey: "Secret API Key", + pushyToken: "Токен устройства", + "Using a Reverse Proxy?": "Используете обратный прокси?", + "Check how to config it for WebSocket": "Проверьте, как настроить его для WebSocket", + "Steam Game Server": "Steam Game Server", + "Most likely causes:": "Наиболее вероятные причины:", + "The resource is no longer available.": "Ресурс больше не доступен.", + "There might be a typing error in the address.": "В адресе может быть опечатка.", + "What you can try:": "Что вы можете попробовать:", + "Retype the address.": "Повторите адрес.", + "Go back to the previous page.": "Вернуться на предыдущую страницу.", + "Coming Soon": "Скоро", + wayToGetClickSendSMSToken: "Вы можете получить имя пользователя API и ключ API из {0} .", + "Connection String": "Строка подключения", + Query: "Запрос", + settingsCertificateExpiry: "Истекание TLS сертификата", + certificationExpiryDescription: "HTTPS Мониторы инициируют уведомление, когда срок действия сертификата TLS истечет:", + "Setup Docker Host": "Настроить Docker Host", + "Connection Type": "Тип соединения", + "Docker Daemon": "Docker Daemon", + deleteDockerHostMsg: "Are you sure want to delete this docker host for all monitors?", + socket: "Socket", + tcp: "TCP / HTTP", + "Docker Container": "Docker контейнер", + "Container Name / ID": "Название контейнера / ID", + "Docker Host": "Docker Host", + "Docker Hosts": "Docker Hosts", + "ntfy Topic": "ntfy Topic", + Domain: "Домен", + Workstation: "Workstation", + disableCloudflaredNoAuthMsg: "Вы находитесь в режиме без авторизации, пароль не требуется.", + trustProxyDescription: "Доверять заголовкам 'X-Forwarded-*'. Если вы хотите получить правильный IP-адрес клиента, а ваш Uptime Kuma находится под Nginx или Apache, вам следует включить этот параметр.", + wayToGetLineNotifyToken: "Вы можете получить токен доступа в {0}", + Examples: "Примеры", + "Home Assistant URL": "Home Assistant URL", + "Long-Lived Access 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. ": "Long-Lived Access Token can be created by clicking on your profile name (bottom left) and scrolling to the bottom then click Create Token. ", + "Notification Service": "Служба уведомлений", + "default: notify all devices": "по стандарту: уведомлять все устройства", + "A list of Notification Services can be found in Home Assistant under \"Developer Tools > Services\" search for \"notification\" to find your device/phone name.": "A list of Notification Services can be found in Home Assistant under \"Developer Tools > Services\" search for \"notification\" to find your device/phone name.", + "Automations can optionally be triggered in Home Assistant:": "При желании автоматизацию можно активировать в Home Assistant.:", + "Trigger type:": "Тип триггера:", + "Event type:": "Тип события:", + "Event data:": "Данные события:", + "Then choose an action, for example switch the scene to where an RGB light is red.": "Затем выберите действие, например, переключите сцену на красный индикатор RGB..", + "Frontend Version": "Версия интерфейса", + "Frontend Version do not match backend version!": "Версия интерфейса не соответствует версии серверной части!", + "Base URL": "Базовый URL", + goAlertInfo: "GoAlert is a An open source application for on-call scheduling, automated escalations and notifications (like SMS or voice calls). Automatically engage the right person, the right way, and at the right time! {0}", + goAlertIntegrationKeyInfo: "Получить общий ключ интеграции API для сервиса в этом формате \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\" обычно значение параметра токена скопированного URL.", + goAlert: "GoAlert", + backupOutdatedWarning: "Устарело: поскольку добавлено множество функций, а эта функция резервного копирования немного не поддерживается, она не может создать или восстановить полную резервную копию.", + backupRecommend: "Сделайте резервную копию тома или папки с данными (./data/) напрямую.", + "Optional": "Необязательно", + squadcast: "Squadcast", + SendKey: "SendKey", + "SMSManager API Docs": "Документация к API SMSManager ", + "Gateway Type": "Тип шлюза", + SMSManager: "SMSManager", + "You can divide numbers with": "Вы можете делить числа с", + "or": "или", }; From f459ea845c6a1b192fa35efa44f3116aca921dd1 Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Wed, 12 Oct 2022 17:32:05 +0100 Subject: [PATCH 6/8] Added #2182 Add support for custom radius ports (#2197) This commit adds support for the port to be specified when using the radius monitor type. A check has been implemented to ensure that a null value is not passed to the radius check function as could occur with monitors that were created before this change was introduced. The default port of 1812 is displayed when the user selects the radius monitor in much the same way as the DNS port is handled. The port was not included in the hostname in the form hostname:port in order to avoid issues with IPv6 addresses and monitors that had been created before this change was implemented. Signed-off-by: Matthew Nickson Signed-off-by: Matthew Nickson --- server/model/monitor.js | 14 +++++++++++++- server/util-server.js | 13 +++++++++++++ src/pages/EditMonitor.vue | 8 +++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index ac892560..c0a3cce6 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -534,6 +534,17 @@ class Monitor extends BeanModel { bean.ping = dayjs().valueOf() - startTime; } else if (this.type === "radius") { let startTime = dayjs().valueOf(); + + // Handle monitors that were created before the + // update and as such don't have a value for + // this.port. + let port; + if (this.port == null) { + port = 1812; + } else { + port = this.port; + } + try { const resp = await radius( this.hostname, @@ -541,7 +552,8 @@ class Monitor extends BeanModel { this.radiusPassword, this.radiusCalledStationId, this.radiusCallingStationId, - this.radiusSecret + this.radiusSecret, + port ); if (resp.code) { bean.msg = resp.code; diff --git a/server/util-server.js b/server/util-server.js index cf303ba8..b975a43f 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -291,6 +291,17 @@ exports.postgresQuery = function (connectionString, query) { }); }; +/** + * Query radius server + * @param {string} hostname Hostname of radius server + * @param {string} username Username to use + * @param {string} password Password to use + * @param {string} calledStationId ID of called station + * @param {string} callingStationId ID of calling station + * @param {string} secret Secret to use + * @param {number} [port=1812] Port to contact radius server on + * @returns {Promise} + */ exports.radius = function ( hostname, username, @@ -298,9 +309,11 @@ exports.radius = function ( calledStationId, callingStationId, secret, + port = 1812, ) { const client = new radiusClient({ host: hostname, + hostPort: port, dictionaries: [ file ], }); diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 99cbeb95..6d1a7e51 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -97,8 +97,8 @@ - -
+ +
@@ -616,9 +616,11 @@ export default { } // Set default port for DNS if not already defined - if (! this.monitor.port || this.monitor.port === "53") { + if (! this.monitor.port || this.monitor.port === "53" || this.monitor.port === "1812") { if (this.monitor.type === "dns") { this.monitor.port = "53"; + } else if (this.monitor.type === "radius") { + this.monitor.port = "1812"; } else { this.monitor.port = undefined; } From c662d259b0a59e59a650f00a04253e0d81707ab2 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 13 Oct 2022 19:28:02 +0800 Subject: [PATCH 7/8] Firefox Better Support #2206 --- src/components/HiddenInput.vue | 2 +- src/components/notifications/ClickSendSMS.vue | 2 +- src/components/notifications/GoAlert.vue | 2 +- src/components/notifications/Gotify.vue | 2 +- src/components/notifications/Line.vue | 2 +- src/components/notifications/Matrix.vue | 2 +- src/components/notifications/Octopush.vue | 2 +- src/components/notifications/PromoSMS.vue | 2 +- src/components/notifications/PushDeer.vue | 2 +- src/components/notifications/Pushbullet.vue | 2 +- src/components/notifications/Pushover.vue | 4 ++-- src/components/notifications/Pushy.vue | 4 ++-- src/components/notifications/SMTP.vue | 2 +- src/components/notifications/ServerChan.vue | 2 +- src/components/notifications/SerwerSMS.vue | 2 +- src/components/notifications/TechulusPush.vue | 2 +- src/components/notifications/Telegram.vue | 2 +- src/components/settings/General.vue | 5 +++-- src/components/settings/ReverseProxy.vue | 2 +- 19 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/components/HiddenInput.vue b/src/components/HiddenInput.vue index 6287af05..fb86a398 100644 --- a/src/components/HiddenInput.vue +++ b/src/components/HiddenInput.vue @@ -42,7 +42,7 @@ export default { /** Should the field auto complete */ autocomplete: { type: String, - default: undefined, + default: "new-password", }, /** Is the input required? */ required: { diff --git a/src/components/notifications/ClickSendSMS.vue b/src/components/notifications/ClickSendSMS.vue index dbd4d0aa..dbaca045 100644 --- a/src/components/notifications/ClickSendSMS.vue +++ b/src/components/notifications/ClickSendSMS.vue @@ -6,7 +6,7 @@ - +
diff --git a/src/components/notifications/GoAlert.vue b/src/components/notifications/GoAlert.vue index a1465b50..cefb848d 100644 --- a/src/components/notifications/GoAlert.vue +++ b/src/components/notifications/GoAlert.vue @@ -11,7 +11,7 @@
- +
{{ $t("goAlertIntegrationKeyInfo") }} diff --git a/src/components/notifications/Gotify.vue b/src/components/notifications/Gotify.vue index 5c294f6d..8b9a8a16 100644 --- a/src/components/notifications/Gotify.vue +++ b/src/components/notifications/Gotify.vue @@ -1,7 +1,7 @@