Compare commits

..

165 commits

Author SHA1 Message Date
Otto Richter (fnetX)
2fd4e1cc72
Matrix token command hint should send JSON ()
Co-authored-by: Otto Richter <otto@codeberg.org>
2025-07-17 08:47:51 +02:00
Ionys
7c88a38df3
Fixing recurring maintenance start (again) ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-07-16 17:28:29 +02:00
yumeiyin
d490285a44
chore: fix some minor issues in comments ()
Signed-off-by: yumeiyin <yin.yumei@qq.com>
2025-07-14 10:08:53 +02:00
Peak Twilight
5bbbef5305
feat: Add heartbeat tooltip while hovering over status page heartbeats ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-07-12 13:34:33 +02:00
Lyall
487cb8fdc5
fix: refresh interval getting incremented by 10 on status page despite a minimum of 5 ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-07-11 23:41:43 +02:00
Louis Lam
03037e2a9a
Delete .github/workflows/pr-reply.yml () 2025-07-09 16:22:55 +02:00
Louis Lam
f395222423
Translations Update from Weblate () 2025-07-05 15:01:25 +08:00
José Perlin
db0bb6d87b Translated using Weblate (Portuguese)
Currently translated at 19.3% (218 of 1127 strings)

Co-authored-by: José Perlin <jose.vendr@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Samuel-MM
4d35dd14b4 Translated using Weblate (Portuguese)
Currently translated at 19.3% (218 of 1127 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (1127 of 1127 strings)

Co-authored-by: Samuel-MM <samuelmangia@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt/
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
AnnAngela
0d4249dfb5 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1127 of 1127 strings)

Co-authored-by: AnnAngela <naganjue@vip.qq.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Enes
b6f8454676 Translated using Weblate (Turkish)
Currently translated at 100.0% (1127 of 1127 strings)

Co-authored-by: Enes <enes3078@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/tr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Kang Dongheon
a45bff4bb4 Translated using Weblate (Korean)
Currently translated at 76.2% (858 of 1125 strings)

Co-authored-by: Kang Dongheon <daniel2231.dev@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
michalpixels
9427a5e434 Translated using Weblate (Slovak)
Currently translated at 66.1% (744 of 1125 strings)

Co-authored-by: michalpixels <michalpixels@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/sk/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Hemanth Rachapalli
530db0a4bd Translated using Weblate (English (Old))
Currently translated at 0.1% (1 of 1125 strings)

Added translation using Weblate (English (Old))

Co-authored-by: Hemanth Rachapalli <rachapalli.hemanth5544@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ang/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Maximiliano Simonazzi
a0924f2810 Translated using Weblate (Spanish)
Currently translated at 95.2% (1071 of 1125 strings)

Co-authored-by: Maximiliano Simonazzi <maxisimonazzi@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/es/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Howard Guo
e4b3c935e7 Translated using Weblate (Chinese (Traditional))
Currently translated at 96.5% (1086 of 1125 strings)

Co-authored-by: Howard Guo <toto6038@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hant/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Talip ÇAKIR
5ede3f298c Translated using Weblate (Turkish)
Currently translated at 100.0% (1125 of 1125 strings)

Co-authored-by: Talip ÇAKIR <talip@cakir.info.tr>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/tr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
dekkeng
b52ec3b219 Translated using Weblate (Thai)
Currently translated at 85.2% (959 of 1125 strings)

Co-authored-by: dekkeng <dek_keng@hotmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
VoraprotSeesod
025a8cb519 Translated using Weblate (Thai)
Currently translated at 85.2% (959 of 1125 strings)

Co-authored-by: VoraprotSeesod <voraprot.seesod.contact@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:13 +00:00
Unai Tolosa Pontesta
bd686b3647 Translated using Weblate (Basque)
Currently translated at 63.2% (711 of 1125 strings)

Co-authored-by: Unai Tolosa Pontesta <utolosa002@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/eu/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Thearex12
39f79d6807 Translated using Weblate (Finnish)
Currently translated at 97.9% (1102 of 1125 strings)

Co-authored-by: Thearex12 <thearex@thearex12.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fi/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Ionys
8f72683010 Translated using Weblate (French)
Currently translated at 100.0% (1125 of 1125 strings)

Co-authored-by: Ionys <kylliandm@hotmail.fr>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Ivan Bratović
c6ae7ad4b5 Translated using Weblate (Croatian)
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (Croatian)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Croatian)

Currently translated at 100.0% (1124 of 1124 strings)

Co-authored-by: Ivan Bratović <ivanbratovic4@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/hr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
PIXELHIZE
64d4544b2c Translated using Weblate (Korean)
Currently translated at 76.1% (854 of 1121 strings)

Co-authored-by: PIXELHIZE <pixelhize@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Stark
1fd1b24c00 Translated using Weblate (Italian)
Currently translated at 66.2% (743 of 1121 strings)

Co-authored-by: Stark <maverick.arrows@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/it/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
PangBo
2ec3c350f2 Translated using Weblate (Chinese (Simplified))
Currently translated at 98.8% (1100 of 1113 strings)

Co-authored-by: PangBo <373108669@qq.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
stanol
f7051dc6f3 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (Ukrainian)

Currently translated at 96.4% (1074 of 1113 strings)

Co-authored-by: stanol <stanol777@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/uk/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Yoswaris Lawpaiboon
15e302f7f5 Translated using Weblate (Thai)
Currently translated at 86.1% (957 of 1111 strings)

Co-authored-by: Yoswaris Lawpaiboon <konglha19@outlook.co.th>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Aluisio
ddce1180f5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (1113 of 1113 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (1111 of 1111 strings)

Co-authored-by: Aluisio <aluisiodeavila@hotmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Alex Javadi
f981685c34 Translated using Weblate (Persian)
Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Persian)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Persian)

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (Persian)

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (Persian)

Currently translated at 100.0% (1111 of 1111 strings)

Co-authored-by: Alex Javadi <15309978+aljvdi@users.noreply.github.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fa/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Ramin Mazloomi
c306bddd85 Translated using Weblate (Persian)
Currently translated at 94.9% (1055 of 1111 strings)

Co-authored-by: Ramin Mazloomi <RaminMT007@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fa/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:12 +00:00
Alex Javadi
4c0ad485c5 Translated using Weblate (Persian)
Currently translated at 94.9% (1055 of 1111 strings)

Co-authored-by: Alex Javadi <15309978+aljvdi@users.noreply.github.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fa/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
Emir Yılmazer
54151fa222 Translated using Weblate (Turkish)
Currently translated at 99.9% (1110 of 1111 strings)

Co-authored-by: Emir Yılmazer <benemiryilmazer@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/tr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
Marco
bfe045ccaa Translated using Weblate (German)
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (German (Switzerland))

Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (German)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (German (Switzerland))

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (German)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (German (Switzerland))

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (German)

Currently translated at 100.0% (1111 of 1111 strings)

Translated using Weblate (German (Switzerland))

Currently translated at 100.0% (1111 of 1111 strings)

Co-authored-by: Marco <marco@nanoweb.ch>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de/
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de_CH/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
MrEddX
317ebbfbf7 Translated using Weblate (Bulgarian)
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (1113 of 1113 strings)

Translated using Weblate (Bulgarian)

Currently translated at 100.0% (1111 of 1111 strings)

Co-authored-by: MrEddX <mreddx@chatrix.one>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/bg/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
Cyril59310
1c8cdaf18b Translated using Weblate (French)
Currently translated at 100.0% (1127 of 1127 strings)

Translated using Weblate (French)

Currently translated at 100.0% (1125 of 1125 strings)

Translated using Weblate (French)

Currently translated at 100.0% (1121 of 1121 strings)

Translated using Weblate (French)

Currently translated at 100.0% (1113 of 1113 strings)

Translated using Weblate (French)

Currently translated at 100.0% (1111 of 1111 strings)

Co-authored-by: Cyril59310 <archas.cyril@hotmail.fr>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fr/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
Saba Sakvarelidze
914c4ea0ad Translated using Weblate (Georgian)
Currently translated at 3.1% (34 of 1076 strings)

Co-authored-by: Saba Sakvarelidze <cal1b4nnn@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ka/
Translation: Uptime Kuma/Uptime Kuma
2025-07-05 04:38:11 +00:00
ianlv
54b0c89ea5
chore: fix typos in code comments ()
Signed-off-by: ianlv <sunlvyun@outlook.com>
2025-07-02 16:18:13 +02:00
Ryan Hartje
9506b3a16b
feat: Add optional audience for http-monitors via the oauth2 client credentials flow ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-30 02:37:41 +02:00
Frank Elsinga
5336b05a7f
remove feature freeze messaging from templates () 2025-06-28 18:27:31 +02:00
Louis Lam
10fd6ede1e
[Eliminate Blocking] Docker monitor () 2025-06-25 13:39:00 +08:00
mindsolo
9976ef94af
feat: Add proxy clone functionality to settings ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-23 15:38:01 +02:00
Louis Lam
9e7ea4913a
Fix auto pr reply () 2025-06-23 15:12:18 +02:00
Louis Lam
92f2484a8d
Auto reply to PRs ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-23 17:56:39 +08:00
Louis Lam
b55d6e8911
Improve the experience of testing pull requests () 2025-06-23 15:24:49 +08:00
Frank Elsinga
59d10062ca
chore: remove fluff from PR-template () 2025-06-22 14:49:24 +02:00
Ionys
072226bde2
Improve i18n language matching () 2025-06-22 01:02:52 +02:00
Eden Yemini
5aeda2dab0
feat: render markdown in monitor descriptions () 2025-06-19 23:56:43 +02:00
Louis Lam
b1e8d9b4d2
[Eliminate Blocking] Push example () 2025-06-19 15:41:21 +08:00
Louis Lam
e0335ecfbd
[Eliminate Blocking] Database related () 2025-06-19 14:30:24 +08:00
Louis Lam
4962817795
[Eliminate Blocking] User related () 2025-06-19 14:29:43 +08:00
Peak Twilight
443d5cf554
Improve UI: Edit Buttons in Status Page ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-15 20:44:28 +02:00
Louis Lam
609429bd7e
Fix dayjs () 2025-06-15 18:37:01 +08:00
Maksim
3b6a78bd80
Fix db coloum type for manual monitor () 2025-06-15 16:43:09 +08:00
Florian Feka
55817061c0
fix: Properly handle the NTLM part being embedded inside other authentication headers ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-13 15:08:11 +02:00
warpreality
18cfa901ad
feat: Add a "manual" (static/fixed) monitor ()
Co-authored-by: Maksim Kachynski <max.kachinsky@rocketdata.io>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-13 13:38:49 +02:00
Fabian Triebsch
f282422b22
added option to force ipv4 or ipv6 for http(s) monitor type ()
Co-authored-by: Ionys <9364594+Ionys320@users.noreply.github.com>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-13 08:14:55 +02:00
Manu
53e83e7722
Add monitor id label to prometheus metrics () 2025-06-12 12:31:01 +02:00
grvwy
8909cd008c
feat: add multiple tags in bulk for a monitor ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-12 03:52:35 +02:00
Ionys
c7bacbb7fe
Ensure maintenance are always runned at the right moment ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-12 01:42:25 +02:00
Ionys
4d51aaa6f8
Fix invalid maintenance date () 2025-06-12 00:28:04 +02:00
Andrea Mastellone
f27811c394
ntfy.sh separate down priority ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-11 01:41:09 +02:00
Cyril59310
c46772dafc
Add default avatar in discord notifications () 2025-06-07 21:09:56 +02:00
Louis Lam
4bdb616641
Translations Update from Weblate () 2025-06-07 13:47:02 +08:00
Louis Lam
87308a7778 Merge branch 'master' into fix-weblate-conflict
# Conflicts:
#	src/lang/bg-BG.json
#	src/lang/de-CH.json
#	src/lang/de-DE.json
#	src/lang/fi.json
#	src/lang/fr-FR.json
#	src/lang/it-IT.json
#	src/lang/ja.json
#	src/lang/ko-KR.json
#	src/lang/nl-NL.json
#	src/lang/pl.json
#	src/lang/pt-BR.json
#	src/lang/ru-RU.json
#	src/lang/uk-UA.json
#	src/lang/zh-CN.json
2025-06-07 13:43:08 +08:00
Louis Lam
8d710e217a
Update to 2.0.0-beta.3 () 2025-06-04 11:32:44 +08:00
Louis Lam
63c5ebe624 Update to 2.0.0-beta.3 2025-06-04 11:31:03 +08:00
Louis Lam
93daab9790
Update dependencies () 2025-06-04 10:14:55 +08:00
Louis Lam
dcff640248
Fix ()
Co-authored-by: ptrstr <ptrstr@protonmail.com>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-06-04 10:04:57 +08:00
Louis Lam
71965e6b69
Fix: Update TypeScript configuration and refactor imports () 2025-06-02 12:43:36 +02:00
Youssef Bourourou
ab418342a8 Translated using Weblate (Arabic)
Currently translated at 69.9% (753 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ar/
2025-05-30 10:43:07 +00:00
Damon
c0598ac606
Flashduty IntegrationKey support Endpoint URL () 2025-05-29 13:54:07 +02:00
Ilkka Myller
1ca035da80 Translated using Weblate (Finnish)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fi/
2025-05-27 12:04:41 +00:00
rainy5810
735f4a8268 Translated using Weblate (Korean)
Currently translated at 75.2% (810 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
2025-05-27 12:04:37 +00:00
Filippo
839ead80cc
Enhanced ping monitor with advanced options (count, timeout, numeric) ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-24 02:57:39 +02:00
Louis Lam
c69fcd4093
Update dependencies () 2025-05-23 01:03:37 +08:00
Louis Lam
49eb0ff87b
Fix: [Push Monitor] Send notifications during maintenance period () 2025-05-20 12:38:21 +02:00
Adam Stachowicz
f3828262c9 Translated using Weblate (Polish)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pl/
2025-05-19 23:04:36 +00:00
Brian Pravato
3760d8021b Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
2025-05-18 20:36:01 +00:00
Brad Koehn
c67f6efe29
added SMTP monitor ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-18 22:35:55 +02:00
zhang-wei
289e824a5d
Fix monitor reference in push notification logic ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-18 00:05:48 +02:00
丛林意志
0f1547febd Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
2025-05-17 21:33:06 +00:00
Đăng Khoa
0b29fd49ad
fix(sql): use UTC_TIMESTAMP instead of NOW for consistent time calcul… () 2025-05-17 23:33:00 +02:00
Matteo Morari
413cb08a81 Translated using Weblate (Italian)
Currently translated at 69.2% (745 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/it/
2025-05-15 11:04:35 +00:00
AnnAngela
60b3fb4c18 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
2025-05-14 01:04:35 +00:00
Martin Hjärtmyr
cd6dc144a7
feat: add notification provider Notifery ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-11 15:38:03 +02:00
Ionys
2b3f49a266
Add a public URL field for monitors and uses it on the status page ()
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
2025-05-10 19:05:37 +02:00
happy-game
86b3ef9c86
feat: Set default friendly name using hostname or the URL host ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-08 11:06:14 +02:00
Pargorn Ruasijan
eb18677e4f
fixed: slack notifications no preview available () 2025-05-07 22:29:27 +02:00
Ivan Bratović
edf788f97f Translated using Weblate (Croatian)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/hr/
2025-05-07 09:06:48 +00:00
Cyril59310
76c382f229
Add disable url option in notification Discord ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-06 01:33:49 +02:00
Pargorn Ruasijan
e1bb3324e4 Translated using Weblate (Thai)
Currently translated at 89.0% (958 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-05 15:25:27 +00:00
vapao
32d92eccfa
Update SpugPush notification payload () 2025-05-04 14:42:40 +02:00
Frank Elsinga
6f0571fc30 Translated using Weblate (German)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de/
2025-05-04 04:28:38 +00:00
Pargorn Ruasijan
36741e2023 Translated using Weblate (Thai)
Currently translated at 89.0% (958 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-02 19:18:55 +00:00
Pargorn Ruasijan
4bbe61fb46 Translated using Weblate (Thai)
Currently translated at 82.8% (892 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-02 14:23:06 +00:00
vapao
6a5011ad34
Add SpugPush notification provider ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-05-02 08:58:16 +02:00
Rachatat Bunpat
f814d86dd2 Translated using Weblate (Thai)
Currently translated at 81.0% (872 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-02 05:17:46 +00:00
Pargorn Ruasijan
0306596311 Translated using Weblate (Thai)
Currently translated at 81.0% (872 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-02 05:17:46 +00:00
Donker_Jumala
5d3d8b387d Translated using Weblate (Japanese)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ja/
2025-05-02 03:32:29 +00:00
Robin Janssens
474861e1c1 Translated using Weblate (Dutch)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
2025-05-01 22:29:49 +00:00
Pargorn Ruasijan
fb980b1065 Translated using Weblate (Thai)
Currently translated at 64.4% (693 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/th/
2025-05-01 17:36:46 +00:00
youpie
b22969a3e6
Allow HTML for custom email bodies () 2025-05-01 19:36:34 +02:00
Manuel Zavatta
00025e2a2d Translated using Weblate (Italian)
Currently translated at 67.4% (726 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/it/
2025-05-01 08:15:02 +00:00
Junghyuk Kwon
2ba33f068b Translated using Weblate (Korean)
Currently translated at 74.4% (801 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
2025-04-30 19:13:42 +00:00
Donker_Jumala
5255b6bbb9 Translated using Weblate (Japanese)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ja/
2025-04-30 19:13:42 +00:00
Junghyuk Kwon
5c7b91a99d Translated using Weblate (Korean)
Currently translated at 74.4% (801 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
2025-04-30 00:27:53 +00:00
Artur S
d2a4972f6a Translated using Weblate (Belarusian)
Currently translated at 89.9% (968 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/be/
2025-04-29 12:43:11 +00:00
Artur S
8f245b89cf Translated using Weblate (Russian)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ru/
2025-04-29 12:43:11 +00:00
Junghyuk Kwon
94275de493 Translated using Weblate (Korean)
Currently translated at 74.4% (801 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
2025-04-29 12:43:11 +00:00
carbeso
c60c0c4912 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hant/
2025-04-28 12:16:06 +00:00
Aluisio
cf82085917 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
2025-04-28 01:16:08 +00:00
Marco
fbd9490fc7 Translated using Weblate (German)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de/
2025-04-27 19:16:07 +00:00
Marco
2cbf3483bd Translated using Weblate (German (Switzerland))
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de_CH/
2025-04-27 19:16:07 +00:00
Pargorn Ruasijan
8396330552
Add OneChat notification provider ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-27 18:48:05 +02:00
Aleksander
e7d3fa6a78
Update SMSEagle support adding APIv2 and calls integration ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-27 18:37:23 +02:00
stanol
a3ca2d1838 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/uk/
2025-04-27 16:30:24 +00:00
II-EMC
b3a11a4d9d
fix: Add name to preparePreloadData call in sendNotification as a better fix for ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-27 18:30:18 +02:00
MrEddX
95023e64ab Translated using Weblate (Bulgarian)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/bg/
2025-04-27 04:27:04 +00:00
Cyril59310
64b2c6b183 Translated using Weblate (French)
Currently translated at 100.0% (1076 of 1076 strings)

Translation: Uptime Kuma/Uptime Kuma
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fr/
2025-04-26 23:33:30 +00:00
UptimeKumaBot
9bba309b88
Translations Update from Weblate ()
Co-authored-by: Alex Nagy <nagyalex003@gmail.com>
Co-authored-by: Tiramisu <garcia.o.felipe@gmail.com>
Co-authored-by: A3 <warmerdamm03@gmail.com>
Co-authored-by: B3CKDOOR <B3CKDOOR@users.noreply.weblate.kuma.pet>
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
Co-authored-by: ramondsq <quruis@hotmail.com>
Co-authored-by: Roberto Agria <roberto.agria@gmail.com>
Co-authored-by: Donker_Jumala <weareh0711@gmail.com>
Co-authored-by: Marcis Pauls <marcis.pauls@gmail.com>
Co-authored-by: ASTERISK Kwon <whying010@gmail.com>
Co-authored-by: dongsu8142 <dongsu8142@naver.com>
Co-authored-by: maz1lovo <smakshinov@gmail.com>
Co-authored-by: Enes <enes3078@gmail.com>
Co-authored-by: MrEddX <mreddx@chatrix.one>
Co-authored-by: Marco <marco@nanoweb.ch>
Co-authored-by: Cyril59310 <archas.cyril@hotmail.fr>
Co-authored-by: stanol <stanol777@gmail.com>
Co-authored-by: AnnAngela <naganjue@vip.qq.com>
Co-authored-by: JC <jjsuscc@gmail.com>
Co-authored-by: tepung <nikimran@gmail.com>
Co-authored-by: Aluisio <aluisiodeavila@hotmail.com>
Co-authored-by: Jonne Saloranta <saloranta.jonne@gmail.com>
2025-04-26 23:09:29 +02:00
Jonne Saloranta
0e9ba79ef2 Translated using Weblate (Finnish)
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: Jonne Saloranta <saloranta.jonne@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fi/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Aluisio
e6aea02ddf Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: Aluisio <aluisiodeavila@hotmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
tepung
9f92760238 Translated using Weblate (Malay)
Currently translated at 8.1% (87 of 1070 strings)

Translated using Weblate (Malay)

Currently translated at 7.6% (82 of 1070 strings)

Co-authored-by: tepung <nikimran@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ms/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
JC
dfc424494b Translated using Weblate (Catalan)
Currently translated at 52.9% (567 of 1070 strings)

Co-authored-by: JC <jjsuscc@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ca/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
AnnAngela
ae52d9f68f Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: AnnAngela <naganjue@vip.qq.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
stanol
edadbd5e9e Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: stanol <stanol777@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/uk/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Cyril59310
cf7a6b0831 Translated using Weblate (French)
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: Cyril59310 <archas.cyril@hotmail.fr>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/fr/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Marco
8ea23daf2e Translated using Weblate (German)
Currently translated at 100.0% (1070 of 1070 strings)

Translated using Weblate (German (Switzerland))

Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: Marco <marco@nanoweb.ch>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de/
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/de_CH/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
MrEddX
a09cbd176f Translated using Weblate (Bulgarian)
Currently translated at 100.0% (1070 of 1070 strings)

Co-authored-by: MrEddX <mreddx@chatrix.one>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/bg/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Enes
2ac56d39bd Translated using Weblate (Turkish)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: Enes <enes3078@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/tr/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
maz1lovo
2660382a73 Translated using Weblate (Russian)
Currently translated at 99.6% (1065 of 1069 strings)

Co-authored-by: maz1lovo <smakshinov@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ru/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
dongsu8142
6a7c5eb11d Translated using Weblate (Korean)
Currently translated at 74.9% (801 of 1069 strings)

Co-authored-by: dongsu8142 <dongsu8142@naver.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
ASTERISK Kwon
6869036a30 Translated using Weblate (Korean)
Currently translated at 74.1% (793 of 1069 strings)

Co-authored-by: ASTERISK Kwon <whying010@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ko/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Marcis Pauls
d0d5dbc8e7 Translated using Weblate (Latvian)
Currently translated at 0.3% (4 of 1069 strings)

Added translation using Weblate (Latvian)

Co-authored-by: Marcis Pauls <marcis.pauls@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/lv/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Donker_Jumala
139a2b7865 Translated using Weblate (Japanese)
Currently translated at 100.0% (1070 of 1070 strings)

Translated using Weblate (Japanese)

Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: Donker_Jumala <weareh0711@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/ja/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Roberto Agria
395e505c18 Translated using Weblate (Italian)
Currently translated at 66.3% (709 of 1069 strings)

Co-authored-by: Roberto Agria <roberto.agria@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/it/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
ramondsq
16c048f3bb Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: ramondsq <quruis@hotmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/zh_Hans/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
A3
acdd1e6a32 Translated using Weblate (Dutch)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: A3 <warmerdamm03@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
B3CKDOOR
8eea2bde65 Translated using Weblate (Dutch)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: B3CKDOOR <B3CKDOOR@users.noreply.weblate.kuma.pet>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
A3
c82ee23d65 Translated using Weblate (Dutch)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: A3 <warmerdamm03@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Adam Stachowicz
87ab164a45 Translated using Weblate (Polish)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
B3CKDOOR
edc62bd68e Translated using Weblate (Dutch)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: B3CKDOOR <B3CKDOOR@users.noreply.weblate.kuma.pet>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
A3
5654130ab4 Translated using Weblate (Dutch)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: A3 <warmerdamm03@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/nl/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Tiramisu
4953bf5eac Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: Tiramisu <garcia.o.felipe@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/pt_BR/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Alex Nagy
52b0856a2a Translated using Weblate (Hungarian)
Currently translated at 100.0% (1069 of 1069 strings)

Co-authored-by: Alex Nagy <nagyalex003@gmail.com>
Translate-URL: https://weblate.kuma.pet/projects/uptime-kuma/uptime-kuma/hu/
Translation: Uptime Kuma/Uptime Kuma
2025-04-26 21:01:27 +00:00
Ruse
27f808448f
Pushover add UP/DOWN status sounds ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Moqavem <sina.farahabadi@gmail.com>
2025-04-26 23:01:21 +02:00
Jan K.
33f253f825
Added Pumble Notification ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-26 22:53:40 +02:00
Dawid
f6444aacd2
feat: Support SMSPlanet notification provider ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-26 22:33:26 +02:00
Ryo Hanafusa
3b58ac3fd3
feat: Extend the length of status bar and feed sufficient data ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-25 13:47:18 +02:00
Frank Elsinga
0876b1cbf5
chore:extracted the group monitor to a different monitoring type () 2025-04-22 13:14:12 +02:00
happy-game
999132aca8
fix: Check password strength when resetting the password in CLI () 2025-04-21 19:57:28 +02:00
Jonathan Starck
8d8e3e5a8e
fix(dashboard): prevent y-overlapping of tags by adding a gap ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-19 01:34:16 +02:00
Alan Escarcha
ceb9c7e742
feat: Support for country flags emojis ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-19 01:09:10 +02:00
Louis Lam
510056fbbc
Fix : Some labels without value still show a 'null' value () 2025-04-18 01:35:09 +02:00
II-EMC
13a85b8200
fix: Mattermost notification provider not sending service name ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-12 12:53:36 +02:00
Mohit Nagaraj
f1baa02d7a
fix: remove modal when navigating back ()
Co-authored-by: deepsource-io[bot] <42547082+deepsource-io[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-12 12:26:17 +02:00
lbriceno-tz
bdf37c5a48
fix: flat txt records before conditions check () 2025-04-12 12:15:28 +02:00
Marcel
cfb53c4a3f
Update url for Matrix Login to match Matrix Spec v1.13 ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-11 13:28:55 +02:00
Louis Lam
867fff4264
Update axios to 0.30.0 () 2025-04-11 03:58:19 +08:00
Louis Lam
43a26eba88
Update dependencies () 2025-04-10 15:55:04 +08:00
Zaid Hafeez
a5f6a2b99a
fix: align package-lock.json version with package.json () 2025-04-07 23:55:07 +02:00
GJS
4b0a3df226
Fixed: Markdown hyperlinks in feature_request.yml and PULL_REQUEST_TEMPLATE.md () 2025-04-03 13:54:52 +02:00
GJS
85709f9ad4
docs: reword issue templates, pr workflow and review docs ()
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2025-04-03 11:05:07 +02:00
Louis Lam
6de4aec67b
Update to 2.0.0-beta.2 () 2025-03-28 23:36:37 +08:00
142 changed files with 7343 additions and 2569 deletions
.github
CODE_OF_CONDUCT.mdCONTRIBUTING.mdSECURITY.md
db/knex_migrations
docker
extra
package-lock.jsonpackage.json
server
src

View file

@ -1,75 +0,0 @@
name: "❓ Ask for help"
description: "Submit any question related to Uptime Kuma"
#title: "[Help] "
labels: [help]
body:
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "⚠️ Please verify that this question has NOT been raised before."
description: "Search in the issues sections by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=)"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
attributes:
label: "🛡️ Security Policy"
description: Please review the security policy before reporting security related issues/bugs.
options:
- label: I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/security/policy)
required: true
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: "📝 Describe your problem"
description: "Please walk us through it step by step. Include all important details and add screenshots where appropriate"
placeholder: "Describe what are you asking for..."
- type: textarea
id: error-msg
validations:
required: false
attributes:
label: "📝 Error Message(s) or Log"
- type: input
id: uptime-kuma-version
attributes:
label: "🐻 Uptime-Kuma Version"
description: "Which version of Uptime-Kuma are you running? Please do NOT provide the docker tag such as latest or 1"
placeholder: "Ex. 1.10.0"
validations:
required: true
- type: input
id: operating-system
attributes:
label: "💻 Operating System and Arch"
description: "Which OS is your server/device running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Ubuntu 20.04 x86"
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: "🌐 Browser"
description: "Which browser are you running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Google Chrome 95.0.4638.69"
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: "🖥️ Deployment Environment"
description: |
examples:
- **Runtime**: Docker 20.10.9 / nodejs 14.18.0 / K8S via ... v1.3.3 / ..
- **Database**: sqlite/embedded mariadb/external mariadb
- **Filesystem used to store the database on**: Windows/ZFS/btrfs/NFSv3 on a SSD/HDD/eMMC
- **number of monitors**: 42
value: |
- Runtime:
- Database:
- Filesystem used to store the database on:
- number of monitors:
validations:
required: true

120
.github/ISSUE_TEMPLATE/ask_for_help.yml vendored Normal file
View file

@ -0,0 +1,120 @@
---
name: ❓ Ask for help
description: |
Submit any question related to Uptime Kuma
#title: "[Help]"
labels: ["help"]
body:
- type: markdown
attributes:
value: |
🚫 **We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent issues that require immediate attention.**
**Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively
- type: checkboxes
id: no-duplicate-question
attributes:
label: ⚠️ Please verify that your question has not already been reported
description: |
To avoid duplicate reports, please search for any existing issues before submitting a new one. You can find the list of existing issues **[HERE](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc%20)**.
options:
- label: |
I have searched the [existing issues](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc%20) and found no similar reports.
required: true
- type: checkboxes
id: security-policy
attributes:
label: 🛡️ Security Policy
description: |
Please review and acknowledge the Security Policy before reporting any security-related issues or bugs. You can find the full Security Policy **[HERE](https://github.com/louislam/uptime-kuma/security/policy)**.
options:
- label: |
I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy).
required: true
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: 📝 Describe your problem
description: |
Please walk us through it step by step. Include all important details and add screenshots where appropriate
placeholder: |
Describe what are you asking for ...
- type: textarea
id: error-msg
attributes:
label: 📝 Error Message(s) or Log
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash session
validations:
required: false
- type: input
id: uptime-kuma-version
attributes:
label: 🐻 Uptime-Kuma Version
description: |
What version of Uptime-Kuma are you running? Please do not provide Docker tags like `latest` or `1`.
placeholder: |
e.g., 1.23.16 or 2.0.0-beta.2
validations:
required: true
- type: input
id: operating-system
attributes:
label: 💻 Operating System and Arch
description: |
Which OS is your server/device running on? (For Replit, please do not report this bug)
placeholder: |
e.g., Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: 🌐 Browser
description: |
Which browser are you running on? (For Replit, please do not report this bug)
placeholder: |
e.g., Google Chrome 134.0.6998.183 (Official Build) (64-bit)
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: 🖥️ Deployment Environment
description: |
Provide details about the deployment environment, including runtime components, databases, and storage configurations. This will
help assess the infrastructure and identify any potential compatibility requirements.
**Remove any fields that do not apply to your setup.**
value: |
- **Runtime Environment**:
- Docker: Version `X.X.X` (Build `Y.Y.Y`)
- Docker Compose: Version `X.X.X`
- Portainer (BE/CE): Version `X.X.X` (LTS: Yes/No)
- MariaDB: Version `X.X.X` (LTS: Yes/No)
- Node.js: Version `X.X.X` (LTS: Yes/No)
- Kubernetes (K3S/K8S): Version `X.X.X` (LTS: Yes/No, via `[method/tool]`)
- **Database**:
- SQLite: Embedded
- MariaDB: Embedded/External
- **Database Storage**:
- **Filesystem**:
- Linux: ext4/XFS/Btrfs/ZFS/F2FS
- macOS: APFS/ HFS+
- Windows: NTFS/ReFS
- **Storage Medium**: HDD/eMMC/SSD/NVMe
- **Uptime Kuma Setup**:
- Number of monitors: `X`
validations:
required: true

View file

@ -1,100 +0,0 @@
name: "🐛 Bug Report"
description: "Submit a bug report to help us improve"
#title: "[Bug] "
labels: [bug]
body:
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: "📑 I have found these related issues/pull requests"
description: "Search related issues by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=) and explain what the difference between them or explain that you are unable to find any related issues"
placeholder: "Related to #1 by also touching the ... system. They should not be merged because ..."
- type: checkboxes
attributes:
label: "🛡️ Security Policy"
description: Please review the security policy before reporting security related issues/bugs.
options:
- label: I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/security/policy)
required: true
- type: textarea
id: description
validations:
required: false
attributes:
label: "Description"
description: "You could also upload screenshots"
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: "👟 Reproduction steps"
description: "How do you trigger this bug? Please walk us through it step by step. Include all important details and add screenshots where appropriate"
placeholder: "..."
- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: "👀 Expected behavior"
description: "What did you think would happen?"
placeholder: "..."
- type: textarea
id: actual-behavior
validations:
required: true
attributes:
label: "😓 Actual Behavior"
description: "What actually happen?"
placeholder: "..."
- type: input
id: uptime-kuma-version
attributes:
label: "🐻 Uptime-Kuma Version"
description: "Which version of Uptime-Kuma are you running? Please do NOT provide the docker tag such as latest or 1"
placeholder: "Ex. 1.10.0"
validations:
required: true
- type: input
id: operating-system
attributes:
label: "💻 Operating System and Arch"
description: "Which OS is your server/device running on? (For Replit, please do not report this bug)"
placeholder: "Ex. Ubuntu 20.04 x64 "
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: "🌐 Browser"
description: "Which browser are you running on?"
placeholder: "Ex. Google Chrome 95.0.4638.69"
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: "🖥️ Deployment Environment"
description: |
examples:
- **Runtime**: Docker 20.10.9 / nodejs 18.17.1 / K8S via ... v1.3.3 / ..
- **Database**: sqlite/embedded mariadb/external mariadb
- **Filesystem used to store the database on**: Windows/ZFS/btrfs/NFSv3 on a SSD/HDD/eMMC
- **number of monitors**: 42
value: |
- Runtime:
- Database:
- Filesystem used to store the database on:
- number of monitors:
validations:
required: true
- type: textarea
id: logs
attributes:
label: "📝 Relevant log output"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false

154
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,154 @@
---
name: 🐛 Bug Report
description: |
Submit a bug report to help us improve
#title: "[Bug]"
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
🚫 **We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are reserved for critical/urgent issues that require immediate attention.**
**Why**: Reserving pings for urgent matters ensures maintainers can prioritize critical tasks effectively
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: 📑 I have found these related issues/pull requests
description: |
Please search for related **[ISSUES](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc)**
and **[PULL REQUESTS](https://github.com/louislam/uptime-kuma/pulls?q=is%3Apr+sort%3Acreated-desc+)**.
Explain the differences between them or clarify if you were unable to find any related issues/pull requests.
placeholder: |
Example: This relates to issue #1, which also affects the ... system. It should not be merged because ...
- type: checkboxes
id: security-policy
attributes:
label: 🛡️ Security Policy
description: |
Please review and acknowledge the Security Policy before reporting any security-related issues or bugs. You can find the full Security Policy **[HERE](https://github.com/louislam/uptime-kuma/security/policy)**.
options:
- label: |
I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy).
required: true
- type: textarea
id: description
validations:
required: false
attributes:
label: 📝 Description
description: |
You could also upload screenshots
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: 👟 Reproduction steps
description: |
How do you trigger this bug? Please walk us through it step by step. Include all important details and add screenshots where appropriate
placeholder: |
...
- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: 👀 Expected behavior
description: |
What did you think would happen?
placeholder: |
...
- type: textarea
id: actual-behavior
validations:
required: true
attributes:
label: 😓 Actual Behavior
description: |
What actually happen?
placeholder: |
...
- type: input
id: uptime-kuma-version
attributes:
label: 🐻 Uptime-Kuma Version
description: |
What version of Uptime-Kuma are you running? Please do not provide Docker tags like `latest` or `1`.
placeholder: |
e.g., 1.23.16 or 2.0.0-beta.2
validations:
required: true
- type: input
id: operating-system
attributes:
label: 💻 Operating System and Arch
description: |
Which OS is your server/device running on? (For Replit, please do not
report this bug)
placeholder: |
e.g., Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
validations:
required: true
- type: input
id: browser-vendor
attributes:
label: 🌐 Browser
description: |
Which browser are you running on?
placeholder: |
e.g., Google Chrome 134.0.6998.183 (Official Build) (64-bit)
validations:
required: true
- type: textarea
id: deployment-info
attributes:
label: 🖥️ Deployment Environment
description: |
Provide details about the deployment environment, including runtime components, databases, and storage configurations. This will
help assess the infrastructure and identify any potential compatibility requirements.
**Remove any fields that do not apply to your setup.**
value: |
- **Runtime Environment**:
- Docker: Version `X.X.X` (Build `Y.Y.Y`)
- Docker Compose: Version `X.X.X`
- Portainer (BE/CE): Version `X.X.X` (LTS: Yes/No)
- MariaDB: Version `X.X.X` (LTS: Yes/No)
- Node.js: Version `X.X.X` (LTS: Yes/No)
- Kubernetes (K3S/K8S): Version `X.X.X` (LTS: Yes/No, via `[method/tool]`)
- **Database**:
- SQLite: Embedded
- MariaDB: Embedded/External
- **Database Storage**:
- **Filesystem**:
- Linux: ext4/XFS/Btrfs/ZFS/F2FS
- macOS: APFS/ HFS+
- Windows: NTFS/ReFS
- **Storage Medium**: HDD/eMMC/SSD/NVMe
- **Uptime Kuma Setup**:
- Number of monitors: `X`
validations:
required: true
- type: textarea
id: logs
attributes:
label: 📝 Relevant log output
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash session
validations:
required: false

View file

@ -1,66 +0,0 @@
name: 🚀 Feature Request
description: "Submit a proposal for a new feature"
#title: "[Feature] "
labels: [feature-request]
body:
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: "📑 I have found these related issues/pull requests"
description: "Search related issues by clicking [HERE](https://github.com/louislam/uptime-kuma/issues?q=) and explain what the difference between them or explain that you are unable to find any related issues"
placeholder: "Related to #1 by also touching the ... system. They should not be merged because ..."
- type: dropdown
id: feature-area
attributes:
label: "🏷️ Feature Request Type"
description: "What kind of feature request is this?"
multiple: true
options:
- API / automation options
- New notification-provider
- Change to existing notification-provider
- New monitor
- Change to existing monitor
- Dashboard
- Status-page
- Maintenance
- Deployment
- Certificate expiry
- Settings
- Other
validations:
required: true
- type: textarea
id: feature-description
validations:
required: true
attributes:
label: "🔖 Feature description"
description: "A clear and concise description of what the feature request is."
placeholder: "You should add ..."
- type: textarea
id: solution
validations:
required: true
attributes:
label: "✔️ Solution"
description: "A clear and concise description of what you want to happen."
placeholder: "In my use-case, ..."
- type: textarea
id: alternatives
validations:
required: false
attributes:
label: "❓ Alternatives"
description: "A clear and concise description of any alternative solutions or features you've considered."
placeholder: "I have considered ..."
- type: textarea
id: additional-context
validations:
required: false
attributes:
label: "📝 Additional Context"
description: "Add any other context or screenshots about the feature request here."
placeholder: "..."

View file

@ -0,0 +1,93 @@
---
name: 🚀 Feature Request
description: |
Submit a proposal for a new feature
# title: "[Feature]"
labels: ["feature-request"]
body:
- type: markdown
attributes:
value: |
### 🚫 Please Avoid Unnecessary Pinging of Maintainers
We kindly ask you to refrain from pinging maintainers unless absolutely necessary.
Pings are for critical/urgent pull requests that require immediate attention.
- type: textarea
id: related-issues
validations:
required: true
attributes:
label: 📑 I have found these related issues/pull requests
description: |
Please search for related **[ISSUES](https://github.com/louislam/uptime-kuma/issues?q=is%3Aissue%20sort%3Acreated-desc)**
and **[PULL REQUESTS](https://github.com/louislam/uptime-kuma/pulls?q=is%3Apr+sort%3Acreated-desc+)**.
Explain the differences between them or clarify if you were unable to find any related issues/pull requests.
placeholder: |
Example: This relates to issue #1, which also affects the ... system. It should not be merged because ...
- type: dropdown
id: feature-area
attributes:
label: 🏷️ Feature Request Type
description: |
What kind of feature request is this?
multiple: true
options:
- API / automation options
- New notification-provider
- Change to existing notification-provider
- New monitor
- Change to existing monitor
- Dashboard
- Status-page
- Maintenance
- Deployment
- Certificate expiry
- Settings
- Other
validations:
required: true
- type: textarea
id: feature-description
validations:
required: true
attributes:
label: 🔖 Feature description
description: |
A clear and concise description of what the feature request is.
placeholder: |
You should add ...
- type: textarea
id: solution
validations:
required: true
attributes:
label: ✔️ Solution
description: |
A clear and concise description of what you want to happen.
placeholder: |
In my use-case, ...
- type: textarea
id: alternatives
validations:
required: false
attributes:
label: ❓ Alternatives
description: |
A clear and concise description of any alternative solutions or features you've considered.
placeholder: |
I have considered ...
- type: textarea
id: additional-context
validations:
required: false
attributes:
label: 📝 Additional Context
description: |
Add any other context or screenshots about the feature request here.
placeholder: |
...

View file

@ -1,19 +1,19 @@
--- ---
name: "🛡️ Security Issue" name: 🛡️ Security Issue
description: | description: |
Notify Louis Lam about a security concern. Please do NOT include any sensitive details in this issue. Notify Louis Lam about a security concern. Please do NOT include any sensitive details in this issue.
# title: "Security Issue" # title: "Security Issue"
labels: [security] labels: ["security"]
assignees: [louislam] assignees: [louislam]
body: body:
- type: "markdown" - type: markdown
attributes: attributes:
value: | value: |
## **⚠️ Report a Security Vulnerability** ## ❗ IMPORTANT: DO NOT SHARE VULNERABILITY DETAILS HERE
### **IMPORTANT: DO NOT SHARE VULNERABILITY DETAILS HERE** ### ⚠️ Report a Security Vulnerability
If you have discovered a security vulnerability, please report it securely using the GitHub Security Advisory. **If you have discovered a security vulnerability, please report it securely using the GitHub Security Advisory.**
**Note**: This issue is only for notifying the maintainers of the repository, as the GitHub Security Advisory does not automatically send notifications. **Note**: This issue is only for notifying the maintainers of the repository, as the GitHub Security Advisory does not automatically send notifications.
@ -34,12 +34,12 @@ body:
Once you've created your advisory, please share the URL below. This will notify Louis Lam and enable them to take the appropriate action. Once you've created your advisory, please share the URL below. This will notify Louis Lam and enable them to take the appropriate action.
- type: "textarea" - type: textarea
id: github-advisory-url id: github-advisory-url
validations: validations:
required: true required: true
attributes: attributes:
label: "GitHub Advisory URL for @louislam" label: GitHub Advisory URL for @louislam
placeholder: | placeholder: |
Please paste the GitHub Advisory URL here. Only the URL is required. Please paste the GitHub Advisory URL here. Only the URL is required.
Example: https://github.com/louislam/uptime-kuma/security/advisories/GHSA-8h5r-7t6l-q3kz Example: https://github.com/louislam/uptime-kuma/security/advisories/GHSA-8h5r-7t6l-q3kz

View file

@ -1,33 +1,80 @@
⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules: ## ❗ Important Announcements
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]: <details><summary>Click here for more details:</summary>
- [ ] I have read and understand the pull request rules. </p>
# Description **⚠️ Please Note: We do not accept all types of pull requests, and we want to ensure we dont waste your time. Before submitting, make sure you have read our pull request guidelines: [Pull Request Rules](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma)**
Fixes #(issue) ### 🚫 Please Avoid Unnecessary Pinging of Maintainers
## Type of change We kindly ask you to refrain from pinging maintainers unless absolutely necessary. Pings are for critical/urgent pull requests that require immediate attention.
Please delete any options that are not relevant. </p>
</details>
- Bug fix (non-breaking change which fixes an issue) ## 📋 Overview
- User interface (UI)
- New feature (non-breaking change which adds functionality)
- Breaking change (a fix or feature that would cause existing functionality to not work as expected)
- Other
- This change requires a documentation update
## Checklist <!-- Provide a clear summary of the purpose and scope of this pull request:-->
- [ ] My code follows the style guidelines of this project - **What problem does this pull request address?**
- [ ] I ran ESLint and other linters for modified files - Please provide a detailed explanation here.
- [ ] I have performed a self-review of my own code and tested it - **What features or functionality does this pull request introduce or enhance?**
- [ ] I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods) - Please provide a detailed explanation here.
- [ ] My changes generates no new warnings
- [ ] My code needed automated testing. I have added them (this is optional task)
## Screenshots (if any) <!--
Please link any GitHub issues or tasks that this pull request addresses.
Use the appropriate issue numbers or links to enable auto-closing.
-->
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically. - Relates to #issue-number
- Resolves #issue-number
## 🛠️ Type of change
<!-- Please select all options that apply -->
- [ ] 🐛 Bugfix (a non-breaking change that resolves an issue)
- [ ] ✨ New feature (a non-breaking change that adds new functionality)
- [ ] ⚠️ Breaking change (a fix or feature that alters existing functionality in a way that could cause issues)
- [ ] 🎨 User Interface (UI) updates
- [ ] 📄 New Documentation (addition of new documentation)
- [ ] 📄 Documentation Update (modification of existing documentation)
- [ ] 📄 Documentation Update Required (the change requires updates to related documentation)
- [ ] 🔧 Other (please specify):
- Provide additional details here.
## 📄 Checklist
<!-- Please select all options that apply -->
- [ ] 🔍 My code adheres to the style guidelines of this project.
- [ ] 🦿 I have indicated where (if any) I used an LLM for the contributions
- [ ] ✅ I ran ESLint and other code linters for modified files.
- [ ] 🛠️ I have reviewed and tested my code.
- [ ] 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
- [ ] ⚠️ My changes generate no new warnings.
- [ ] 🤖 My code needed automated testing. I have added them (this is an optional task).
- [ ] 📄 Documentation updates are included (if applicable).
- [ ] 🔒 I have considered potential security impacts and mitigated risks.
- [ ] 🧰 Dependency updates are listed and explained.
- [ ] 📚 I have read and understood the [Pull Request guidelines](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#recommended-pull-request-guideline).
## 📷 Screenshots or Visual Changes
<!--
If this pull request introduces visual changes, please provide the following details.
If not, remove this section.
Please upload the image directly here by pasting it or dragging and dropping.
Avoid using external image services as the image will be uploaded automatically.
-->
- **UI Modifications**: Highlight any changes made to the user interface.
- **Before & After**: Include screenshots or comparisons (if applicable).
| Event | Before | After |
| ------------------ | --------------------- | -------------------- |
| `UP` | ![Before](image-link) | ![After](image-link) |
| `DOWN` | ![Before](image-link) | ![After](image-link) |
| Certificate-expiry | ![Before](image-link) | ![After](image-link) |
| Testing | ![Before](image-link) | ![After](image-link) |

224
.github/REVIEW_GUIDELINES.md vendored Normal file
View file

@ -0,0 +1,224 @@
# Uptime Kuma Review Guidelines
> [!NOTE]
> These review guidelines are a work in progress, and are frequently
> updated and improved, so please check back frequently for the latest version.
## Preparing for a PR Review
### Read the PR description carefully
Make sure you understand what the PR is trying to solve or implement. This could
be a bug fix, a new feature, or a refactor.
### Check the linked issues
If the PR has a linked issue, read it to better understand the context and the
reason for the change.
### Check the test coverage
Make sure relevant tests have been added or modified. If the PR adds new
functionality, there should be tests covering the change.
## General Review
### Code formatting and style
Check if the code adheres to the style guidelines of the project. Make sure
there are no unused imports, variables, `console.log` for debugging in the PR.
- [Project Style](../CONTRIBUTING.md#project-styles)
- [Coding Style](../CONTRIBUTING.md#coding-styles)
### Readability and maintainability
Is the code easy to understand for other developers? Make sure complex parts are
explained with comments about **_why_** something is done, and use clear names
to show **_how_**. Are variables and functions well-named, and is there a
consistent naming style? Also, check if the code is maintainable:
- Is it unnecessarily complex? Could it be simplified?
- Does it follow the **[Single Responsibility Principle (SRP)]**?
[Single Responsibility Principle (SRP)]: https://www.geeksforgeeks.org/single-responsibility-in-solid-design-principle/
### Documentation
Is the PR well documented? Check if the descriptions of functions, parameters,
and return values are present. Are there any changes needed to the README or
other documentation, for example, if new features or configurations are
introduced?
## Functional Review
### Testing
Ensure that the new code is properly tested. This includes unit tests,
integration tests, and if necessary, end-to-end tests.
### Test results
Did all tests pass in the CI pipeline (e.g., GitHub Actions, Travis, CircleCI)?
### Testing in different environments
If the changes depend on certain environments or configurations, verify that the
code has been tested in various environments (e.g., local development, staging,
production).
- [How to test Pull Requests](https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests)
### Edge cases and regressions
- Are there test cases for possible edge cases?
- Could this change introduce regressions in other parts of the system?
## Security
### Security issues
Check for potential security problems, such as SQL injection, XSS attacks, or
unsafe API calls. Are there passwords, tokens, or other sensitive data left in
the code by mistake?
### Authentication and authorization
Is access to sensitive data or functionality properly secured? Check that the
correct authorization and authentication mechanisms are in place.
### Security Best Practices
- Ensure that the code is free from common vulnerabilities like **SQL
injection**, **XSS attacks**, and **insecure API calls**.
- Check for proper encryption of sensitive data, and ensure that **passwords**
or **API tokens** are not hardcoded in the code.
## Performance
### Performance impact
Check if the changes negatively impact performance. This can include factors
like load times, memory usage, or other performance aspects.
### Use of external libraries
- Have the right libraries been chosen?
- Are there unnecessary dependencies that might reduce performance or increase
code complexity?
- Are these dependencies actively maintained and free of known vulnerabilities?
### Performance Best Practices
- **Measure performance** using tools like Lighthouse or profiling libraries.
- **Avoid unnecessary dependencies** that may bloat the codebase.
- Ensure that the **code does not degrade the user experience** (e.g., by
increasing load times or memory consumption).
## Compliance and Integration
### Alignment with the project
Are the changes consistent with the project goals and requirements? Ensure the
PR aligns with the architecture and design principles of the project.
### Integration
If the PR depends on other PRs or changes, verify that they integrate well with
the rest of the project. Ensure the code does not cause conflicts with other
active PRs.
### Backward compatibility
Does the change break compatibility with older versions of the software or
dependencies? If so, is there a migration plan in place?
## Logging and Error Handling
### Proper error handling
- Are errors properly caught and handled instead of being silently ignored?
- Are exceptions used appropriately?
### Logging
- Is sufficient logging included for debugging and monitoring?
- Is there excessive logging that could affect performance?
## Accessibility (for UI-related changes)
If the PR affects the user interface, ensure that it meets accessibility
standards:
- Can users navigate using only the keyboard?
- Are screen readers supported?
- Is there proper color contrast for readability?
- Are there **WCAG** (Web Content Accessibility Guidelines) compliance issues?
- Use tools like **Axe** or **Lighthouse** to evaluate accessibility.
## Providing Feedback
### Constructive feedback
Provide clear, constructive feedback on what is good and what can be improved.
If improvements are needed, be specific about what should change.
### Clarity and collaboration
Ensure your feedback is friendly and open, so the team member who submitted the
PR feels supported and motivated to make improvements.
<details><summary><b>For Maintainers only</b> (click to expand)</summary>
<p>
## Go/No-Go Decision
### Go
If the code has no issues and meets the project requirements, approve it (and
possibly merge it).
### No-Go
If there are significant issues, such as missing tests, security
vulnerabilities, or performance problems, request the necessary changes before
the PR can be approved. Some examples of **significant issues** include:
- Missing tests for new functionality.
- Identified **security vulnerabilities**.
- Code changes that break **backward compatibility** without a proper migration
plan.
- Code that causes **major performance regressions** (e.g., high CPU/memory
usage).
## After the Review
### Reordering and merging
Once the necessary changes have been made and the PR is approved, the code can
be merged into the main branch (e.g., `main` or `master`).
### Testing after merging
Ensure that the build passes after merging the PR, and re-test the functionality
in the production environment if necessary.
## Follow-up
### Communication with team members
If the PR has long-term technical or functional implications, communicate the
changes to the team.
### Monitoring
Continue monitoring the production environment for any unexpected issues that
may arise after the code has been merged.
</p>
</details>
---
This process ensures that PRs are systematically and thoroughly reviewed,
improving overall code quality.

View file

@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status, identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity nationality, personal appearance, race, caste, color, religion, or sexual
and orientation. identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community. diverse, inclusive, and healthy community.
@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the overall
overall community community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or advances of
advances of any kind any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email address,
address, without their explicit permission without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -52,7 +52,7 @@ decisions when appropriate.
This Code of Conduct applies within all community spaces, and also applies when This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces. an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address, Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed posting via an official social media account, or acting as an appointed
representative at an online or offline event. representative at an online or offline event.
@ -60,8 +60,8 @@ representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at reported to the community leaders responsible for enforcement at
uptime@kuma.pet. <uptime@kuma.pet>. All complaints will be reviewed and investigated promptly and
All complaints will be reviewed and investigated promptly and fairly. fairly.
All community leaders are obligated to respect the privacy and security of the All community leaders are obligated to respect the privacy and security of the
reporter of any incident. reporter of any incident.
@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.
### 2. Warning ### 2. Warning
**Community Impact**: A violation through a single incident or series **Community Impact**: A violation through a single incident or series of
of actions. actions.
**Consequence**: A warning with consequences for continued behavior. No **Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or like social media. Violating these terms may lead to a temporary or permanent
permanent ban. ban.
### 3. Temporary Ban ### 3. Temporary Ban
@ -109,20 +109,24 @@ Violating these terms may lead to a permanent ban.
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within the
the community. community.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at version 2.1, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by [Mozilla's code of conduct Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity). enforcement ladder][Mozilla CoC].
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
https://www.contributor-covenant.org/translations. [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View file

@ -1,16 +1,18 @@
# Project Info # Project Info
First of all, I want to thank everyone who has submitted issues or shared pull requests for Uptime Kuma. First of all, I want to thank everyone who has submitted issues or shared pull
I never thought the GitHub community would be so nice! requests for Uptime Kuma. I never thought the GitHub community would be so nice!
Because of this, I also never thought that other people would actually read and edit my code. Because of this, I also never thought that other people would actually read and
Parts of the code are not very well-structured or commented, sorry about that. edit my code. Parts of the code are not very well-structured or commented, sorry
about that.
The project was created with `vite.js` and is written in `vue3`. The project was created with `vite.js` and is written in `vue3`. Our backend
Our backend lives in the `server`-directory and mostly communicates via websockets. lives in the `server`-directory and mostly communicates via websockets. Both
Both frontend and backend share the same `package.json`. frontend and backend share the same `package.json`.
For production, the frontend is built into the `dist`-directory and the server (`express.js`) exposes the `dist` directory as the root of the endpoint. For production, the frontend is built into the `dist`-directory and the server
For development, we run vite in development mode on another port. (`express.js`) exposes the `dist` directory as the root of the endpoint. For
development, we run vite in development mode on another port.
## Directories ## Directories
@ -25,193 +27,437 @@ For development, we run vite in development mode on another port.
- `src` (Frontend source code) - `src` (Frontend source code)
- `test` (unit test) - `test` (unit test)
## Can I create a pull request for Uptime Kuma? ## Can I Create a Pull Request for Uptime Kuma?
Yes or no, it depends on what you will try to do. Whether or not you can create a pull request depends on the nature of your
Both yours and our maintainers' time is precious, and we don't want to waste either. contribution. We value both your time and our maintainers' time, so we want to
make sure it's spent efficiently.
If you have any questions about any process/.. is not clear, you are likely not alone => please ask them ^^ If you're unsure about any process or step, you're probably not the only one
with that question—please feel free to ask. We're happy to help!
Different guidelines exist for different types of pull requests (PRs): Different types of pull requests (PRs) may have different guidelines, so be sure
- <details><summary><b>security fixes</b></summary> to review the appropriate one for your contribution.
- <details><summary><b>Security Fixes</b> (click to expand)</summary>
<p> <p>
Submitting security fixes is something that may put the community at risk. Submitting security fixes is something that may put the community at risk.
Please read through our [security policy](SECURITY.md) and submit vulnerabilities via an [advisory](https://github.com/louislam/uptime-kuma/security/advisories/new) + [issue](https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md) instead. Please read through our [security policy](SECURITY.md) and submit
We encourage you to submit how to fix a vulnerability if you know how to, this is not required. vulnerabilities via an [advisory] + [issue] instead. We encourage you to
Following the security policy allows us to properly test, fix bugs. submit how to fix a vulnerability if you know how to, this is not required.
This review allows us to notice, if there are any changes necessary to unrelated parts like the documentation. Following the security policy allows us to properly test, fix bugs. This
review allows us to notice, if there are any changes necessary to unrelated
parts like the documentation.
[**PLEASE SEE OUR SECURITY POLICY.**](SECURITY.md) [**PLEASE SEE OUR SECURITY POLICY.**](SECURITY.md)
[advisory]: https://github.com/louislam/uptime-kuma/security/advisories/new
[issue]:
https://github.com/louislam/uptime-kuma/issues/new?template=security_issue.yml
</p> </p>
</details> </details>
- <details><summary><b>small, non-breaking bug fixes</b></summary>
- <details><summary><b>Small, Non-Breaking Bug Fixes</b> (click to expand)</summary>
<p> <p>
If you come across a bug and think you can solve, we appreciate your work. If you come across a bug and think you can solve, we appreciate your work.
Please make sure that you follow these rules: Please make sure that you follow these rules:
- keep the PR as small as possible, fix only one thing at a time => keeping it reviewable
- keep the PR as small as possible, fix only one thing at a time => keeping it
reviewable
- test that your code does what you claim it does. - test that your code does what you claim it does.
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub> <sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>translations / internationalisation (i18n)</b></summary>
- <details><summary><b>Translations / Internationalisation (i18n)</b> (click to expand)</summary>
<p> <p>
We use weblate to localise this project into many languages. We use weblate to localise this project into many languages. If you are
If you are unhappy with a translation this is the best start. unhappy with a translation this is the best start. On how to translate using
On how to translate using weblate, please see [these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md). weblate, please see
[these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md).
There are two cases in which a change cannot be done in weblate and requires a PR: There are two cases in which a change cannot be done in weblate and requires a
- A text may not be currently localisable. In this case, **adding a new language key** via `$t("languageKey")` might be nessesary PR:
- language keys need to be **added to `en.json`** to be visible in weblate. If this has not happened, a PR is appreciated.
- **Adding a new language** requires a new file see [these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md) - A text may not be currently localisable. In this case, **adding a new
language key** via `$t("languageKey")` might be necessary
- language keys need to be **added to `en.json`** to be visible in weblate. If
this has not happened, a PR is appreciated.
- **Adding a new language** requires a new file see
[these instructions](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md)
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new notification providers</b></summary>
- <details><summary><b>New Notification Providers</b> (click to expand)</summary>
<p> <p>
To set up a new notification provider these files need to be modified/created: To set up a new notification provider these files need to be modified/created:
- `server/notification-providers/PROVIDER_NAME.js` is where the heart of the notification provider lives.
- Both `monitorJSON` and `heartbeatJSON` can be `null` for some events.
If both are `null`, this is a general testing message, but if just `heartbeatJSON` is `null` this is a certificate expiry.
- Please wrap the axios call into a
```js
try {
let result = await axios.post(...);
if (result.status === ...) ...
} catch (error) {
this.throwGeneralAxiosError(error);
}
```
- `server/notification.js` is where the backend of the notification provider needs to be registered.
*If you have an idea how we can skip this step, we would love to hear about it ^^*
- `src/components/NotificationDialog.vue` you need to decide if the provider is a regional or a global one and add it with a name to the respective list
- `src/components/notifications/PROVIDER_NAME.vue` is where the frontend of each provider lives.
Please make sure that you have:
- used `HiddenInput` for secret credentials
- included all the necessary helptexts/placeholder/.. to make sure the notification provider is simple to setup for new users.
- include all translations (`{{ $t("Translation key") }}`, [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html)) in `src/lang/en.json` to enable our translators to translate this
- `src/components/notifications/index.js` is where the frontend of the provider needs to be registered.
*If you have an idea how we can skip this step, we would love to hear about it ^^*
Offering notifications is close to the core of what we are as an uptime monitor. - `server/notification-providers/PROVIDER_NAME.js` is where the heart of the
Therefore, making sure that they work is also really important. notification provider lives.
Because testing notification providers is quite time intensive, we mostly offload this onto the person contributing a notification provider.
To make sure you have tested the notification provider, please include screenshots of the following events in the pull-request description: - Both `monitorJSON` and `heartbeatJSON` can be `null` for some events. If
- `UP`/`DOWN`
- Certificate Expiry via https://expired.badssl.com/
- Testing (the test button on the notification provider setup page)
Using the following way to format this is encouraged: both are `null`, this is a general testing message, but if just
```md `heartbeatJSON` is `null` this is a certificate expiry.
| Event | Before | After |
------------------ - Please wrap the axios call into a
| `UP` | paste-image-here | paste-image-here |
| `DOWN` | paste-image-here | paste-image-here | ```js
| Certificate-expiry | paste-image-here | paste-image-here | try {
| Testing | paste-image-here | paste-image-here | let result = await axios.post(...);
if (result.status === ...) ...
} catch (error) {
this.throwGeneralAxiosError(error);
}
``` ```
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub> - `server/notification.js` is where the backend of the notification provider
needs to be registered. _If you have an idea how we can skip this step, we
would love to hear about it ^^_
- `src/components/NotificationDialog.vue` you need to decide if the provider
is a regional or a global one and add it with a name to the respective list
- `src/components/notifications/PROVIDER_NAME.vue` is where the frontend of
each provider lives. Please make sure that you have:
- used `HiddenInput` for secret credentials
- included all the necessary helptexts/placeholder/.. to make sure the
notification provider is simple to setup for new users. - include all
translations (`{{ $t("Translation key") }}`,
[`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html))
in `src/lang/en.json` to enable our translators to translate this
- `src/components/notifications/index.js` is where the frontend of the
provider needs to be registered. _If you have an idea how we can skip this
step, we would love to hear about it ^^_
Offering notifications is close to the core of what we are as an uptime
monitor. Therefore, making sure that they work is also really important.
Because testing notification providers is quite time intensive, we mostly
offload this onto the person contributing a notification provider.
To make sure you have tested the notification provider, please include
screenshots of the following events in the pull-request description:
- `UP`/`DOWN`
- Certificate Expiry via <https://expired.badssl.com/>
- Testing (the test button on the notification provider setup page)
<br/>
Using the following way to format this is encouraged:
```md
| Event | Before | After |
| ------------------ | --------------------- | -------------------- |
| `UP` | ![Before](image-link) | ![After](image-link) |
| `DOWN` | ![Before](image-link) | ![After](image-link) |
| Certificate-expiry | ![Before](image-link) | ![After](image-link) |
| Testing | ![Before](image-link) | ![After](image-link) |
```
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new monitoring types</b></summary>
- <details><summary><b>New Monitoring Types</b> (click to expand)</summary>
<p> <p>
To set up a new notification provider these files need to be modified/created: To set up a new notification provider these files need to be modified/created:
- `server/monitor-types/MONITORING_TYPE.js` is the core of each monitor.
the `async check(...)`-function should: - `server/monitor-types/MONITORING_TYPE.js` is the core of each monitor. the
- throw an error for each fault that is detected with an actionable error message `async check(...)`-function should:
- in the happy-path, you should set `heartbeat.msg` to a successful message and set `heartbeat.status = UP`
- `server/uptime-kuma-server.js` is where the monitoring backend needs to be registered. - throw an error for each fault that is detected with an actionable error
*If you have an idea how we can skip this step, we would love to hear about it ^^*
message - in the happy-path, you should set `heartbeat.msg` to a successful
message and set `heartbeat.status = UP`
- `server/uptime-kuma-server.js` is where the monitoring backend needs to be
registered. _If you have an idea how we can skip this step, we would love to
hear about it ^^_
- `src/pages/EditMonitor.vue` is the shared frontend users interact with. - `src/pages/EditMonitor.vue` is the shared frontend users interact with.
Please make sure that you have: Please make sure that you have: - used `HiddenInput` for secret
- used `HiddenInput` for secret credentials credentials - included all the necessary helptexts/placeholder/.. to make
- included all the necessary helptexts/placeholder/.. to make sure the notification provider is simple to setup for new users. sure the notification provider is simple to setup for new users. - include
- include all translations (`{{ $t("Translation key") }}`, [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html)) in `src/lang/en.json` to enable our translators to translate this all translations (`{{ $t("Translation key") }}`,
- [`i18n-t keypath="Translation key">`](https://vue-i18n.intlify.dev/guide/advanced/component.html))
in `src/lang/en.json` to enable our translators to translate this
<sub>Because maintainer time is precious, junior maintainers may merge
uncontroversial PRs in this area.</sub>
<sub>Because maintainer time is precious, junior maintainers may merge uncontroversial PRs in this area.</sub>
</p> </p>
</details> </details>
- <details><summary><b>new features/ major changes / breaking bugfixes</b></summary>
- <details><summary><b>New Features / Major Changes / Breaking Bugfixes</b> (click to expand)</summary>
<p> <p>
be sure to **create an empty draft pull request or open an issue, so we can have a discussion first**. be sure to **create an empty draft pull request or open an issue, so we can
This is especially important for a large pull request or when you don't know if it will be merged or not. have a discussion first**. This is especially important for a large pull
request or when you don't know if it will be merged or not.
<sub>Because of the large impact of this work, only senior maintainers may
merge PRs in this area. </sub>
<sub>Because of the large impact of this work, only senior maintainers may merge PRs in this area.</sub>
</p> </p>
</details> </details>
The following rules are essential for making your PR mergable: - <details><summary><b>Pull Request Guidelines</b> (click to expand)</summary>
- Merging multiple issues by a huge PR is more difficult to review and causes conflicts with other PRs. Please <p>
## Steps to Submit a Pull Request
1. **Fork** the [Uptime-Kuma repository].
[Uptime-Kuma repository]: https://github.com/louislam/uptime-kuma/
2. **Clone** your forked repository to your local machine.
3. **Create a new branch** for your changes (e.g.,
`feature/add-new-notification-provider-signal`).
4. **Initiate a discussion before making major changes** by creating an empty
commit:
```sh
git commit -m "<YOUR TASK NAME>" --allow-empty
```
5. **Push** your branch to your forked repository.
6. **Open a pull request** using this link: [Compare & Pull Request].
[Compare & Pull Request]: https://github.com/louislam/uptime-kuma/compare/
7. **Select the correct source and target branches**.
8. **Link to related issues** for context.
9. **Provide a clear and concise description** explaining the changes and
their purpose.
- **Type of changes**
- Bugfix (a non-breaking change that resolves an issue)
- New feature (a non-breaking change that adds new functionality)
- Breaking change (a fix or feature that alters existing functionality in a
way that could cause issues)
- User Interface (UI) updates
- New Documentation (addition of new documentation)
- Documentation Update (modification of existing documentation)
- Documentation Update Required (the change requires updates to related
documentation)
- Other (please specify):
- Provide additional details here.
- **Checklist**
- My code adheres to the style guidelines of this project.
- I ran ESLint and other code linters for modified files.
- I have reviewed and tested my code.
- I have commented my code, especially in hard-to-understand areas (e.g.,
using JSDoc for methods).
- My changes generate no new warnings.
- My code needed automated testing. I have added them (this is an optional
task).
- Documentation updates are included (if applicable).
- I have considered potential security impacts and mitigated risks.
- Dependency updates are listed and explained.
- I have read and understood the
[Pull Request guidelines](#recommended-pull-request-guideline).
10. **When publishing your PR, set it as a** `Draft pull request` **to allow
for review and prevent automatic merging.**
11. **Maintainers will assign relevant labels** (e.g., `A:maintenance`,
`A:notifications`).
12. **Complete the PR checklist**, ensuring that:
- Documentation is updated if necessary.
- Tests are written or updated.
- CI/CD checks pass successfully.
13. **Request feedback** from team members to refine your changes before the
final review.
## When Can You Change the PR Status to "Ready for Review"?
A PR should remain in **draft status** until all tasks are completed. Only
change the status to **Ready for Review** when:
- You have implemented all planned changes.
- You have addressed all feedback.
- Your code is fully tested and ready for integration.
- You have updated or created the necessary tests.
- You have verified that CI/CD checks pass successfully.
<br />
A **work-in-progress (WIP) PR** must stay in **draft status** until everything
is finalized.
<sub>Since maintainer time is valuable, junior maintainers may merge
uncontroversial PRs.</sub>
</p>
</details>
## The following rules are essential for making your PR mergable
- Merging multiple issues by a huge PR is more difficult to review and causes
conflicts with other PRs. Please
- (if possible) **create one PR for one issue** or - (if possible) **create one PR for one issue** or
- (if not possible) **explain which issues a PR addresses and why this PR should not be broken apart** - (if not possible) **explain which issues a PR addresses and why this PR
- Make sure your **PR passes our continuous integration**. should not be broken apart**
PRs will not be merged unless all CI-Checks are green.
- **Breaking changes** (unless for a good reason and discussed beforehand) will not get merged / not get merged quickly. - Make sure your **PR passes our continuous integration**. PRs will not be
Such changes require a major version release. merged unless all CI-Checks are green.
- **Test your code** before submitting a PR. - **Breaking changes** (unless for a good reason and discussed beforehand) will
Buggy PRs will not be merged. not get merged / not get merged quickly. Such changes require a major version
release.
- **Test your code** before submitting a PR. Buggy PRs will not be merged.
- Make sure the **UI/UX is close to Uptime Kuma**. - Make sure the **UI/UX is close to Uptime Kuma**.
- **Think about the maintainability**: - **Think about the maintainability**: Don't add functionality that is
Don't add functionality that is completely **out of scope**. completely **out of scope**. Keep in mind that we need to be able to maintain
Keep in mind that we need to be able to maintain the functionality. the functionality.
- Don't modify or delete existing logic without a valid reason. - Don't modify or delete existing logic without a valid reason.
- Don't convert existing code into other programming languages for no reason. - Don't convert existing code into other programming languages for no reason.
I ([@louislam](https://github.com/louislam)) have the final say. I ([@louislam](https://github.com/louislam)) have the final say. If your pull
If your pull request does not meet my expectations, I will reject it, no matter how much time you spent on it. request does not meet my expectations, I will reject it, no matter how much time
Therefore, it is essential to have a discussion beforehand. you spent on it. Therefore, it is essential to have a discussion beforehand.
I will assign your pull request to a [milestone](https://github.com/louislam/uptime-kuma/milestones), if I plan to review and merge it. I will assign your pull request to a [milestone], if I plan to review and merge
it.
Please don't rush or ask for an ETA. [milestone]: https://github.com/louislam/uptime-kuma/milestones
We have to understand the pull request, make sure it has no breaking changes and stick to the vision of this project, especially for large pull requests.
Please don't rush or ask for an ETA. We have to understand the pull request,
make sure it has no breaking changes and stick to the vision of this project,
especially for large pull requests.
## I'd like to work on an issue. How do I do that? ## I'd Like to Work on an Issue. How Do I Do That?
We have found that assigning people to issues is management-overhead that we don't need. We have found that assigning people to issues is unnecessary management
A short comment that you want to try your hand at this issue is appreciated to save other devs time. overhead. Instead, a short comment stating that you want to work on an issue is
If you come across any problem during development, feel free to leave a comment with what you are stuck on. appreciated, as it saves time for other developers. If you encounter any
problems during development, feel free to leave a comment describing what you
are stuck on.
### Recommended Pull Request Guideline ### Recommended Pull Request Guideline
Before diving deep into coding, having a discussion first by creating an empty pull request for discussion is preferred. Before jumping into coding, it's recommended to initiate a discussion by
The rationale behind this is that we can align the direction and scope of the feature to eliminate any conflicts with existing and planned work, and can help by pointing out any potential pitfalls. creating an empty pull request. This approach allows us to align on the
direction and scope of the feature, ensuring it doesn't conflict with existing
or planned work. It also provides an opportunity to identify potential pitfalls
early on, helping to avoid issues down the line.
1. Fork the project 1. **Fork** the [Uptime-Kuma repository].
2. Clone your fork repo to local 2. **Clone** your forked repository to your local machine.
3. Create a new branch 3. **Create a new branch** for your changes (e.g.,
4. Create an empty commit: `git commit -m "<YOUR TASK NAME>" --allow-empty` `feature/add-new-notification-provider-signal`).
5. Push to your fork repo 4. **Initiate a discussion before making major changes** by creating an empty
6. Prepare a pull request: https://github.com/louislam/uptime-kuma/compare commit:
7. Write a proper description. You can mention @louislam in it, so @louislam will get the notification.
8. Create your pull request as a Draft ```sh
9. Wait for the discussion git commit -m "<YOUR TASK NAME>" --allow-empty
```
5. **Push** your branch to your forked repository.
6. **Open a pull request** using this link: [Compare & Pull Request].
7. **Select the correct source and target branches**.
8. **Link to related issues** for context.
9. **Provide a clear and concise description** explaining the changes and their
purpose.
- **Type of changes**
- Bugfix (a non-breaking change that resolves an issue)
- New feature (a non-breaking change that adds new functionality)
- Breaking change (a fix or feature that alters existing functionality in a
way that could cause issues)
- User Interface (UI) updates
- New Documentation (addition of new documentation)
- Documentation Update (modification of existing documentation)
- Documentation Update Required (the change requires updates to related
documentation)
- Other (please specify):
- Provide additional details here.
- **Checklist**
- My code adheres to the style guidelines of this project.
- I ran ESLint and other code linters for modified files.
- I have reviewed and tested my code.
- I have commented my code, especially in hard-to-understand areas (e.g.,
using JSDoc for methods).
- My changes generate no new warnings.
- My code needed automated testing. I have added them (this is an optional
task).
- Documentation updates are included (if applicable).
- I have considered potential security impacts and mitigated risks.
- Dependency updates are listed and explained.
- I have read and understood the
[Pull Request guidelines](#recommended-pull-request-guideline).
10. **When publishing your PR, set it as a** `Draft pull request` **to allow for
review and prevent automatic merging.**
11. **Maintainers will assign relevant labels** (e.g., `A:maintenance`,
`A:notifications`).
12. **Complete the PR checklist**, ensuring that:
- Documentation is updated if necessary.
- Tests are written or updated.
- CI/CD checks pass successfully.
13. **Request feedback** from team members to refine your changes before the
final review.
### When Can You Change the PR Status to "Ready for Review"?
A PR should remain in **draft status** until all tasks are completed. Only
change the status to **Ready for Review** when:
- You have implemented all planned changes.
- You have addressed all feedback.
- Your code is fully tested and ready for integration.
- You have updated or created the necessary tests.
- You have verified that CI/CD checks pass successfully.
A **work-in-progress (WIP) PR** must stay in **draft status** until everything
is finalized.
## Project Styles ## Project Styles
I personally do not like something that requires a lot of configuration before you can finally start the app. I personally do not like something that requires a lot of configuration before
The goal is to make the Uptime Kuma installation as easy as installing a mobile app. you can finally start the app. The goal is to make the Uptime Kuma installation
as easy as installing a mobile app.
- Easy to install for non-Docker users - Easy to install for non-Docker users
- no native build dependency is needed (for `x86_64`/`armv7`/`arm64`) - no native build dependency is needed (for `x86_64`/`armv7`/`arm64`)
- no extra configuration and - no extra configuration and
- no extra effort required to get it running - no extra effort required to get it running
- Single container for Docker users - Single container for Docker users
- no complex docker-compose file - no complex docker-compose file
- mapping the volume and exposing the port should be the only requirements - mapping the volume and exposing the port should be the only requirements
- Settings should be configurable in the frontend. Environment variables are discouraged, unless it is related to startup such as `DATA_DIR`
- Settings should be configurable in the frontend. Environment variables are
discouraged, unless it is related to startup such as `DATA_DIR`
- Easy to use - Easy to use
- The web UI styling should be consistent and nice - The web UI styling should be consistent and nice
@ -233,13 +479,18 @@ The goal is to make the Uptime Kuma installation as easy as installing a mobile
- [`Node.js`](https://nodejs.org/) >= 18 - [`Node.js`](https://nodejs.org/) >= 18
- [`npm`](https://www.npmjs.com/) >= 9.3 - [`npm`](https://www.npmjs.com/) >= 9.3
- [`git`](https://git-scm.com/) - [`git`](https://git-scm.com/)
- IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/)) - IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using
- A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/)) [`IntelliJ IDEA`](https://www.jetbrains.com/idea/))
- A SQLite GUI tool (f.ex.
[`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or
[`DBeaver Community`](https://dbeaver.io/download/))
## Git Branches ## Git Branches
- `master`: 2.X.X development. If you want to add a new feature, your pull request should base on this. - `master`: 2.X.X development. If you want to add a new feature, your pull
- `1.23.X`: 1.23.X development. If you want to fix a bug for v1 and v2, your pull request should base on this. request should base on this.
- `1.23.X`: 1.23.X development. If you want to fix a bug for v1 and v2, your
pull request should base on this.
- All other branches are unused, outdated or for dev. - All other branches are unused, outdated or for dev.
## Install Dependencies for Development ## Install Dependencies for Development
@ -260,7 +511,8 @@ Port `3000` and port `3001` will be used.
npm run dev npm run dev
``` ```
But sometimes you may want to restart the server without restarting the frontend. In that case, you can run these commands in two terminals: But sometimes you may want to restart the server without restarting the
frontend. In that case, you can run these commands in two terminals:
```bash ```bash
npm run start-frontend-dev npm run start-frontend-dev
@ -271,9 +523,9 @@ npm run start-server-dev
It binds to `0.0.0.0:3001` by default. It binds to `0.0.0.0:3001` by default.
The backend is an `express.js` server with `socket.io` integrated. The backend is an `express.js` server with `socket.io` integrated. It uses
It uses `socket.io` to communicate with clients, and most server logic is encapsulated in the `socket.io` handlers. `socket.io` to communicate with clients, and most server logic is encapsulated
`express.js` is also used to serve: in the `socket.io` handlers. `express.js` is also used to serve:
- as an entry point for redirecting to a status page or the dashboard - as an entry point for redirecting to a status page or the dashboard
- the frontend built files (`index.html`, `*.js`, `*.css`, etc.) - the frontend built files (`index.html`, `*.js`, `*.css`, etc.)
@ -289,11 +541,13 @@ It uses `socket.io` to communicate with clients, and most server logic is encaps
- `routers/` (Express Routers) - `routers/` (Express Routers)
- `socket-handler/` (Socket.io Handlers) - `socket-handler/` (Socket.io Handlers)
- `server.js` (Server entry point) - `server.js` (Server entry point)
- `uptime-kuma-server.js` (UptimeKumaServer class, main logic should be here, but some still in `server.js`) - `uptime-kuma-server.js` (UptimeKumaServer class, main logic should be here,
but some still in `server.js`)
## Frontend Dev Server ## Frontend Dev Server
It binds to `0.0.0.0:3000` by default. The frontend dev server is used for development only. It binds to `0.0.0.0:3000` by default. The frontend dev server is used for
development only.
For production, it is not used. It will be compiled to `dist` directory instead. For production, it is not used. It will be compiled to `dist` directory instead.
@ -307,17 +561,19 @@ npm run build
### Frontend Details ### Frontend Details
Uptime Kuma Frontend is a single page application (SPA). Most paths are handled by Vue Router. Uptime Kuma Frontend is a single page application (SPA). Most paths are handled
by Vue Router.
The router is in `src/router.js` The router is in `src/router.js`
As you can see, most data in the frontend is stored at the root level, even though you changed the current router to any other pages. As you can see, most data in the frontend is stored at the root level, even
though you changed the current router to any other pages.
The data and socket logic are in `src/mixins/socket.js`. The data and socket logic are in `src/mixins/socket.js`.
## Database Migration ## Database Migration
See: https://github.com/louislam/uptime-kuma/tree/master/db/knex_migrations See: <https://github.com/louislam/uptime-kuma/tree/master/db/knex_migrations>
## Unit Test ## Unit Test
@ -328,11 +584,12 @@ npm test
## Dependencies ## Dependencies
Both frontend and backend share the same `package.json`. Both frontend and backend share the same `package.json`. However, the frontend
However, the frontend dependencies are eventually not used in the production environment, because it is usually also baked into `dist` files. So: dependencies are eventually not used in the production environment, because it
is usually also baked into `dist` files. So:
- Frontend dependencies = "devDependencies" - Frontend dependencies = "devDependencies"
- Examples: `vue`, `chart.js` - Examples: - `vue`, `chart.js`
- Backend dependencies = "dependencies" - Backend dependencies = "dependencies"
- Examples: `socket.io`, `sqlite3` - Examples: `socket.io`, `sqlite3`
- Development dependencies = "devDependencies" - Development dependencies = "devDependencies"
@ -340,31 +597,41 @@ However, the frontend dependencies are eventually not used in the production env
### Update Dependencies ### Update Dependencies
Since previously updating Vite 2.5.10 to 2.6.0 broke the application completely, from now on, it should update the patch release version only. Since previously updating Vite 2.5.10 to 2.6.0 broke the application completely,
from now on, it should update the patch release version only.
Patch release = the third digit ([Semantic Versioning](https://semver.org/)) Patch release = the third digit ([Semantic Versioning](https://semver.org/))
If for security / bug / other reasons, a library must be updated, breaking changes need to be checked by the person proposing the change. If for security / bug / other reasons, a library must be updated, breaking
changes need to be checked by the person proposing the change.
## Translations ## Translations
Please add **all** the strings which are translatable to `src/lang/en.json` (if translation keys are omitted, they can not be translated.) Please add **all** the strings which are translatable to `src/lang/en.json` (if
translation keys are omitted, they can not be translated.)
**Don't include any other languages in your initial pull request** (even if this is your mother tongue), to avoid merge-conflicts between weblate and `master`. **Don't include any other languages in your initial pull request** (even if this
The translations can then (after merging a PR into `master`) be translated by awesome people donating their language skills. is your mother tongue), to avoid merge-conflicts between weblate and `master`.
The translations can then (after merging a PR into `master`) be translated by
awesome people donating their language skills.
If you want to help by translating Uptime Kuma into your language, please visit the [instructions on how to translate using weblate](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md). If you want to help by translating Uptime Kuma into your language, please visit
the [instructions on how to translate using weblate].
[instructions on how to translate using weblate]:
https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md
## Spelling & Grammar ## Spelling & Grammar
Feel free to correct the grammar in the documentation or code. Feel free to correct the grammar in the documentation or code. My mother
My mother language is not English and my grammar is not that great. language is not English and my grammar is not that great.
## Wiki ## Wiki
Since there is no way to make a pull request to the wiki, I have set up another repo to do that. Since there is no way to make a pull request to the wiki, I have set up another
repo to do that.
https://github.com/louislam/uptime-kuma-wiki <https://github.com/louislam/uptime-kuma-wiki>
## Docker ## Docker
@ -405,7 +672,7 @@ https://github.com/louislam/uptime-kuma-wiki
## Maintainer ## Maintainer
Check the latest issues and pull requests: Check the latest issues and pull requests:
https://github.com/louislam/uptime-kuma/issues?q=sort%3Aupdated-desc <https://github.com/louislam/uptime-kuma/issues?q=sort%3Aupdated-desc>
### What is a maintainer and what are their roles? ### What is a maintainer and what are their roles?
@ -413,7 +680,7 @@ This project has multiple maintainers who specialise in different areas.
Currently, there are 3 maintainers: Currently, there are 3 maintainers:
| Person | Role | Main Area | | Person | Role | Main Area |
|-------------------|-------------------|------------------| | ----------------- | ----------------- | ---------------- |
| `@louislam` | senior maintainer | major features | | `@louislam` | senior maintainer | major features |
| `@chakflying` | junior maintainer | fixing bugs | | `@chakflying` | junior maintainer | fixing bugs |
| `@commanderstorm` | junior maintainer | issue-management | | `@commanderstorm` | junior maintainer | issue-management |
@ -421,39 +688,49 @@ Currently, there are 3 maintainers:
### Procedures ### Procedures
We have a few procedures we follow. These are documented here: We have a few procedures we follow. These are documented here:
- <details><summary>Set up a Docker Builder</summary>
- <details><summary><b>Set up a Docker Builder</b> (click to expand)</summary>
<p> <p>
- amd64, armv7 using local. - amd64, armv7 using local.
- arm64 using remote arm64 cpu, as the emulator is too slow and can no longer pass the `npm ci` command. - arm64 using remote arm64 cpu, as the emulator is too slow and can no longer
1. Add the public key to the remote server. pass the `npm ci` command.
2. Add the remote context. The remote machine must be arm64 and installed Docker CE.
``` 1. Add the public key to the remote server.
docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88" 2. Add the remote context. The remote machine must be arm64 and installed
``` Docker CE.
3. Create a new builder.
``` ```bash
docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7 docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88"
docker buildx use kuma-builder ```
docker buildx inspect --bootstrap
``` 3. Create a new builder.
4. Append the remote context to the builder.
``` ```bash
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7
``` docker buildx use kuma-builder
5. Verify the builder and check if the builder is using `kuma-builder`. docker buildx inspect --bootstrap
``` ```
docker buildx inspect kuma-builder
docker buildx ls 4. Append the remote context to the builder.
```
```bash
docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp
```
5. Verify the builder and check if the builder is using `kuma-builder`.
`docker buildx inspect kuma-builder docker buildx ls`
</p> </p>
</details> </details>
- <details><summary>Release</summary>
- <details><summary><b>Release</b> (click to expand)</summary>
<p> <p>
1. Draft a release note 1. Draft a release note
2. Make sure the repo is cleared 2. Make sure the repo is cleared
3. If the healthcheck is updated, remember to re-compile it: `npm run build-docker-builder-go` 3. If the healthcheck is updated, remember to re-compile it:
`npm run build-docker-builder-go`
4. `npm run release-final` with env vars: `VERSION` and `GITHUB_TOKEN` 4. `npm run release-final` with env vars: `VERSION` and `GITHUB_TOKEN`
5. Wait until the `Press any key to continue` 5. Wait until the `Press any key to continue`
6. `git push` 6. `git push`
@ -463,13 +740,16 @@ We have a few procedures we follow. These are documented here:
These Items need to be checked: These Items need to be checked:
- [ ] Check all tags is fine on https://hub.docker.com/r/louislam/uptime-kuma/tags - [ ] Check all tags is fine on
- [ ] Try the Docker image with tag 1.X.X (Clean install / amd64 / arm64 / armv7) <https://hub.docker.com/r/louislam/uptime-kuma/tags>
- [ ] Try the Docker image with tag 1.X.X (Clean install / amd64 / arm64 /
armv7)
- [ ] Try clean installation with Node.js - [ ] Try clean installation with Node.js
</p> </p>
</details> </details>
- <details><summary>Release Beta</summary>
- <details><summary><b>Release Beta</b> (click to expand)</summary>
<p> <p>
1. Draft a release note, check `This is a pre-release` 1. Draft a release note, check `This is a pre-release`
@ -481,7 +761,8 @@ We have a few procedures we follow. These are documented here:
</p> </p>
</details> </details>
- <details><summary>Release Wiki</summary>
- <details><summary><b>Release Wiki</b> (click to expand)</summary>
<p> <p>
**Setup Repo** **Setup Repo**
@ -501,7 +782,8 @@ We have a few procedures we follow. These are documented here:
</p> </p>
</details> </details>
- <details><summary>Change the base of a pull request such as <code>master</code> to <code>1.23.X</code></summary>
- <details><summary>Change the base of a pull request such as <code>master</code> to <code>1.23.X</code> (click to expand)</summary>
<p> <p>
```bash ```bash

View file

@ -2,29 +2,37 @@
## Reporting a Vulnerability ## Reporting a Vulnerability
1. Please report security issues to https://github.com/louislam/uptime-kuma/security/advisories/new. 1. Please report security issues to
2. Please also create an empty security issue to alert me, as GitHub Advisories do not send a notification, I probably will miss it without this. https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md <https://github.com/louislam/uptime-kuma/security/advisories/new>.
2. Please also create an empty security issue to alert me, as GitHub Advisories
do not send a notification, I probably will miss it without this.
<https://github.com/louislam/uptime-kuma/issues/new?assignees=&labels=help&template=security.md>
Do not use the public issue tracker or discuss it in public as it will cause more damage. Do not use the public issue tracker or discuss it in public as it will cause
more damage.
## Do you accept other 3rd-party bug bounty platforms? ## Do you accept other 3rd-party bug bounty platforms?
At this moment, I DO NOT accept other bug bounty platforms, because I am not familiar with these platforms and someone has tried to send a phishing link to me by doing this already. To minimize my own risk, please report through GitHub Advisories only. I will ignore all 3rd-party bug bounty platforms emails. At this moment, I DO NOT accept other bug bounty platforms, because I am not
familiar with these platforms and someone has tried to send a phishing link to
me by doing this already. To minimize my own risk, please report through GitHub
Advisories only. I will ignore all 3rd-party bug bounty platforms emails.
## Supported Versions ## Supported Versions
### Uptime Kuma Versions ### Uptime Kuma Versions
You should use or upgrade to the latest version of Uptime Kuma. All `1.X.X` versions are upgradable to the latest version. You should use or upgrade to the latest version of Uptime Kuma. All `1.X.X`
versions are upgradable to the latest version.
### Upgradable Docker Tags ### Upgradable Docker Tags
| Tag | Supported | | Tag | Supported |
|-|-| | -------------- | ------------------ |
| 1 | :white_check_mark: | | 1 | :white_check_mark: |
| 1-debian | :white_check_mark: | | 1-debian | :white_check_mark: |
| latest | :white_check_mark: | | latest | :white_check_mark: |
| debian | :white_check_mark: | | debian | :white_check_mark: |
| 1-alpine | ⚠️ Deprecated | | 1-alpine | ⚠️ Deprecated |
| alpine | ⚠️ Deprecated | | alpine | ⚠️ Deprecated |
| All other tags | ❌ | | All other tags | ❌ |

View file

@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.string("smtp_security").defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.dropColumn("smtp_security");
});
};

View file

@ -0,0 +1,24 @@
/* SQL:
ALTER TABLE monitor ADD ping_count INTEGER default 1 not null;
ALTER TABLE monitor ADD ping_numeric BOOLEAN default true not null;
ALTER TABLE monitor ADD ping_per_request_timeout INTEGER default 2 not null;
*/
exports.up = function (knex) {
// Add new columns to table monitor
return knex.schema
.alterTable("monitor", function (table) {
table.integer("ping_count").defaultTo(1).notNullable();
table.boolean("ping_numeric").defaultTo(true).notNullable();
table.integer("ping_per_request_timeout").defaultTo(2).notNullable();
});
};
exports.down = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.dropColumn("ping_count");
table.dropColumn("ping_numeric");
table.dropColumn("ping_per_request_timeout");
});
};

View file

@ -0,0 +1,13 @@
// Add column custom_url to monitor_group table
exports.up = function (knex) {
return knex.schema
.alterTable("monitor_group", function (table) {
table.text("custom_url", "text");
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor_group", function (table) {
table.dropColumn("custom_url");
});
};

View file

@ -0,0 +1,13 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.boolean("ip_family").defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.dropColumn("ip_family");
});
};

View file

@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.string("manual_status").defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.dropColumn("manual_status");
});
};

View file

@ -0,0 +1,34 @@
// Add column last_start_date to maintenance table
exports.up = async function (knex) {
await knex.schema
.alterTable("maintenance", function (table) {
table.datetime("last_start_date");
});
// Perform migration for recurring-interval strategy
const recurringMaintenances = await knex("maintenance").where({
strategy: "recurring-interval",
cron: "* * * * *"
}).select("id", "start_time");
// eslint-disable-next-line camelcase
const maintenanceUpdates = recurringMaintenances.map(async ({ start_time, id }) => {
// eslint-disable-next-line camelcase
const [ hourStr, minuteStr ] = start_time.split(":");
const hour = parseInt(hourStr, 10);
const minute = parseInt(minuteStr, 10);
const cron = `${minute} ${hour} * * *`;
await knex("maintenance")
.where({ id })
.update({ cron });
});
await Promise.all(maintenanceUpdates);
};
exports.down = function (knex) {
return knex.schema.alterTable("maintenance", function (table) {
table.dropColumn("last_start_date");
});
};

View file

@ -0,0 +1,13 @@
// Fix: Change manual_status column type to smallint
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.smallint("manual_status").alter();
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.string("manual_status").alter();
});
};

View file

@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.string("oauth_audience").nullable().defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.string("oauth_audience").alter();
});
};

View file

@ -79,6 +79,10 @@ USER node
RUN git config --global user.email "no-reply@no-reply.com" RUN git config --global user.email "no-reply@no-reply.com"
RUN git config --global user.name "PR Tester" RUN git config --global user.name "PR Tester"
RUN git clone https://github.com/louislam/uptime-kuma.git . RUN git clone https://github.com/louislam/uptime-kuma.git .
# Hide the warning when running in detached head state
RUN git config --global advice.detachedHead false
RUN npm ci RUN npm ci
EXPOSE 3000 3001 EXPOSE 3000 3001

View file

@ -1,33 +0,0 @@
const childProcess = require("child_process");
if (!process.env.UPTIME_KUMA_GH_REPO) {
console.error("Please set a repo to the environment variable 'UPTIME_KUMA_GH_REPO' (e.g. mhkarimi1383:goalert-notification)");
process.exit(1);
}
let inputArray = process.env.UPTIME_KUMA_GH_REPO.split(":");
if (inputArray.length !== 2) {
console.error("Invalid format. Please set a repo to the environment variable 'UPTIME_KUMA_GH_REPO' (e.g. mhkarimi1383:goalert-notification)");
}
let name = inputArray[0];
let branch = inputArray[1];
console.log("Checkout pr");
// Checkout the pr
let result = childProcess.spawnSync("git", [ "remote", "add", name, `https://github.com/${name}/uptime-kuma` ]);
console.log(result.stdout.toString());
console.error(result.stderr.toString());
result = childProcess.spawnSync("git", [ "fetch", name, branch ]);
console.log(result.stdout.toString());
console.error(result.stderr.toString());
result = childProcess.spawnSync("git", [ "checkout", `${name}/${branch}`, "--force" ]);
console.log(result.stdout.toString());
console.error(result.stderr.toString());

34
extra/checkout-pr.mjs Normal file
View file

@ -0,0 +1,34 @@
import childProcess from "child_process";
import { parsePrName } from "./kuma-pr/pr-lib.mjs";
let { name, branch } = parsePrName(process.env.UPTIME_KUMA_GH_REPO);
console.log(`Checking out PR from ${name}:${branch}`);
// Checkout the pr
let result = childProcess.spawnSync("git", [ "remote", "add", name, `https://github.com/${name}/uptime-kuma` ], {
stdio: "inherit"
});
if (result.status !== 0) {
console.error("Failed to add remote repository.");
process.exit(1);
}
result = childProcess.spawnSync("git", [ "fetch", name, branch ], {
stdio: "inherit"
});
if (result.status !== 0) {
console.error("Failed to fetch the branch.");
process.exit(1);
}
result = childProcess.spawnSync("git", [ "checkout", `${name}/${branch}`, "--force" ], {
stdio: "inherit"
});
if (result.status !== 0) {
console.error("Failed to checkout the branch.");
process.exit(1);
}

View file

@ -37,7 +37,7 @@ const github = require("@actions/github");
owner: issue.owner, owner: issue.owner,
repo: issue.repo, repo: issue.repo,
issue_number: issue.number, issue_number: issue.number,
body: `@${username}: Hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template. Please **DO NOT open blank issues and use our [issue-templates](https://github.com/louislam/uptime-kuma/issues/new/choose) instead**.\nBlank Issues do not contain the context nessesary for a good discussions.` body: `@${username}: Hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template. Please **DO NOT open blank issues and use our [issue-templates](https://github.com/louislam/uptime-kuma/issues/new/choose) instead**.\nBlank Issues do not contain the context necessary for a good discussions.`
}); });
// Close the issue // Close the issue

26
extra/kuma-pr/index.mjs Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env node
import { spawn } from "child_process";
import { parsePrName } from "./pr-lib.mjs";
const prName = process.argv[2];
// Pre-check the prName here, so testers don't need to wait until the Docker image is pulled to see the error.
try {
parsePrName(prName);
} catch (error) {
console.error(error.message);
process.exit(1);
}
spawn("docker", [
"run",
"--rm",
"-it",
"-p", "3000:3000",
"-p", "3001:3001",
"--pull", "always",
"-e", `UPTIME_KUMA_GH_REPO=${prName}`,
"louislam/uptime-kuma:pr-test2"
], {
stdio: "inherit",
});

View file

@ -0,0 +1,8 @@
{
"name": "kuma-pr",
"version": "1.0.0",
"type": "module",
"bin": {
"kuma-pr": "./index.mjs"
}
}

39
extra/kuma-pr/pr-lib.mjs Normal file
View file

@ -0,0 +1,39 @@
/**
* Parse <name>:<branch> to an object.
* @param {string} prName <name>:<branch>
* @returns {object} An object with name and branch properties.
*/
export function parsePrName(prName) {
let name = "louislam";
let branch;
const errorMessage = "Please set a repo to the environment variable 'UPTIME_KUMA_GH_REPO' (e.g. mhkarimi1383:goalert-notification)";
if (!prName) {
throw new Error(errorMessage);
}
prName = prName.trim();
if (prName === "") {
throw new Error(errorMessage);
}
let inputArray = prName.split(":");
// Just realized that owner's prs are not prefixed with "louislam:"
if (inputArray.length === 1) {
branch = inputArray[0];
} else if (inputArray.length === 2) {
name = inputArray[0];
branch = inputArray[1];
} else {
throw new Error("Invalid format. The format is like this: mhkarimi1383:goalert-notification");
}
return {
name,
branch
};
}

View file

@ -3,6 +3,7 @@ console.log("== Uptime Kuma Reset Password Tool ==");
const Database = require("../server/database"); const Database = require("../server/database");
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const readline = require("readline"); const readline = require("readline");
const { passwordStrength } = require("check-password-strength");
const { initJWTSecret } = require("../server/util-server"); const { initJWTSecret } = require("../server/util-server");
const User = require("../server/model/user"); const User = require("../server/model/user");
const { io } = require("socket.io-client"); const { io } = require("socket.io-client");
@ -42,8 +43,15 @@ const main = async () => {
console.log("Using password from argument"); console.log("Using password from argument");
console.warn("\x1b[31m%s\x1b[0m", "Warning: the password might be stored, in plain text, in your shell's history"); console.warn("\x1b[31m%s\x1b[0m", "Warning: the password might be stored, in plain text, in your shell's history");
password = confirmPassword = args["new-password"] + ""; password = confirmPassword = args["new-password"] + "";
if (passwordStrength(password).value === "Too weak") {
throw new Error("Password is too weak, please use a stronger password.");
}
} else { } else {
password = await question("New Password: "); password = await question("New Password: ");
if (passwordStrength(password).value === "Too weak") {
console.log("Password is too weak, please try again.");
continue;
}
confirmPassword = await question("Confirm New Password: "); confirmPassword = await question("Confirm New Password: ");
} }

2126
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "uptime-kuma", "name": "uptime-kuma",
"version": "2.0.0-beta.2", "version": "2.0.0-beta.3",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@ -32,7 +32,7 @@
"test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063", "test-e2e-ui": "playwright test --config ./config/playwright.config.js --ui --ui-port=51063",
"playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json", "playwright-codegen": "playwright codegen localhost:3000 --save-storage=./private/e2e-auth.json",
"playwright-show-report": "playwright show-report ./private/playwright-report", "playwright-show-report": "playwright show-report ./private/playwright-report",
"tsc": "tsc", "tsc": "tsc --project ./tsconfig-backend.json",
"vite-preview-dist": "vite preview --host --config ./config/vite.config.js", "vite-preview-dist": "vite preview --host --config ./config/vite.config.js",
"build-docker-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2 --target base2 . --push", "build-docker-base": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2 --target base2 . --push",
"build-docker-base-slim": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2-slim --target base2-slim . --push", "build-docker-base-slim": "docker buildx build -f docker/debian-base.dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:base2-slim --target base2-slim . --push",
@ -57,7 +57,7 @@
"release-nightly": "node ./extra/release/nightly.mjs", "release-nightly": "node ./extra/release/nightly.mjs",
"git-remove-tag": "git tag -d", "git-remove-tag": "git tag -d",
"build-dist-and-restart": "npm run build && npm run start-server-dev", "build-dist-and-restart": "npm run build && npm run start-server-dev",
"start-pr-test": "node extra/checkout-pr.js && npm install && npm run dev", "start-pr-test": "node extra/checkout-pr.mjs && npm install && npm run dev",
"build-healthcheck-armv7": "cross-env GOOS=linux GOARCH=arm GOARM=7 go build -x -o ./extra/healthcheck-armv7 ./extra/healthcheck.go", "build-healthcheck-armv7": "cross-env GOOS=linux GOARCH=arm GOARM=7 go build -x -o ./extra/healthcheck-armv7 ./extra/healthcheck.go",
"deploy-demo-server": "node extra/deploy-demo-server.js", "deploy-demo-server": "node extra/deploy-demo-server.js",
"sort-contributors": "node extra/sort-contributors.js", "sort-contributors": "node extra/sort-contributors.js",
@ -72,7 +72,7 @@
"@louislam/sqlite3": "15.1.6", "@louislam/sqlite3": "15.1.6",
"@vvo/tzdb": "^6.125.0", "@vvo/tzdb": "^6.125.0",
"args-parser": "~1.3.0", "args-parser": "~1.3.0",
"axios": "~0.29.0", "axios": "~0.30.0",
"badge-maker": "~3.3.1", "badge-maker": "~3.3.1",
"bcryptjs": "~2.4.3", "bcryptjs": "~2.4.3",
"chardet": "~1.4.0", "chardet": "~1.4.0",
@ -82,6 +82,7 @@
"command-exists": "~1.2.9", "command-exists": "~1.2.9",
"compare-versions": "~3.6.0", "compare-versions": "~3.6.0",
"compression": "~1.7.4", "compression": "~1.7.4",
"country-flag-emoji-polyfill": "^0.1.8",
"croner": "~8.1.0", "croner": "~8.1.0",
"dayjs": "~1.11.5", "dayjs": "~1.11.5",
"dev-null": "^0.1.1", "dev-null": "^0.1.1",

View file

@ -26,7 +26,7 @@ exports.login = async function (username, password) {
// Upgrade the hash to bcrypt // Upgrade the hash to bcrypt
if (passwordHash.needRehash(user.password)) { if (passwordHash.needRehash(user.password)) {
await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [ await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [
passwordHash.generate(password), await passwordHash.generate(password),
user.id, user.id,
]); ]);
} }

View file

@ -1,4 +1,5 @@
const fs = require("fs"); const fs = require("fs");
const fsAsync = fs.promises;
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const { setSetting, setting } = require("./util-server"); const { setSetting, setting } = require("./util-server");
const { log, sleep } = require("../src/util"); const { log, sleep } = require("../src/util");
@ -18,7 +19,7 @@ const KumaColumnCompiler = require("./utils/knex/lib/dialects/mysql2/schema/mysq
class Database { class Database {
/** /**
* Boostrap database for SQLite * Bootstrap database for SQLite
* @type {string} * @type {string}
*/ */
static templatePath = "./db/kuma.db"; static templatePath = "./db/kuma.db";
@ -707,12 +708,12 @@ class Database {
/** /**
* Get the size of the database (SQLite only) * Get the size of the database (SQLite only)
* @returns {number} Size of database * @returns {Promise<number>} Size of database
*/ */
static getSize() { static async getSize() {
if (Database.dbConfig.type === "sqlite") { if (Database.dbConfig.type === "sqlite") {
log.debug("db", "Database.getSize()"); log.debug("db", "Database.getSize()");
let stats = fs.statSync(Database.sqlitePath); let stats = await fsAsync.stat(Database.sqlitePath);
log.debug("db", stats); log.debug("db", stats);
return stats.size; return stats.size;
} }
@ -736,7 +737,7 @@ class Database {
if (Database.dbConfig.type === "sqlite") { if (Database.dbConfig.type === "sqlite") {
return "DATETIME('now', ? || ' hours')"; return "DATETIME('now', ? || ' hours')";
} else { } else {
return "DATE_ADD(NOW(), INTERVAL ? HOUR)"; return "DATE_ADD(UTC_TIMESTAMP(), INTERVAL ? HOUR)";
} }
} }

View file

@ -1,10 +1,10 @@
const axios = require("axios"); const axios = require("axios");
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const https = require("https"); const https = require("https");
const fs = require("fs"); const fsAsync = require("fs").promises;
const path = require("path"); const path = require("path");
const Database = require("./database"); const Database = require("./database");
const { axiosAbortSignal } = require("./util-server"); const { axiosAbortSignal, fsExists } = require("./util-server");
class DockerHost { class DockerHost {
@ -81,7 +81,7 @@ class DockerHost {
options.socketPath = dockerHost.dockerDaemon; options.socketPath = dockerHost.dockerDaemon;
} else if (dockerHost.dockerType === "tcp") { } else if (dockerHost.dockerType === "tcp") {
options.baseURL = DockerHost.patchDockerURL(dockerHost.dockerDaemon); options.baseURL = DockerHost.patchDockerURL(dockerHost.dockerDaemon);
options.httpsAgent = new https.Agent(DockerHost.getHttpsAgentOptions(dockerHost.dockerType, options.baseURL)); options.httpsAgent = new https.Agent(await DockerHost.getHttpsAgentOptions(dockerHost.dockerType, options.baseURL));
} }
try { try {
@ -141,9 +141,9 @@ class DockerHost {
* File names can also be overridden via 'DOCKER_TLS_FILE_NAME_(CA|KEY|CERT)'. * File names can also be overridden via 'DOCKER_TLS_FILE_NAME_(CA|KEY|CERT)'.
* @param {string} dockerType i.e. "tcp" or "socket" * @param {string} dockerType i.e. "tcp" or "socket"
* @param {string} url The docker host URL rewritten to https:// * @param {string} url The docker host URL rewritten to https://
* @returns {object} HTTP agent options * @returns {Promise<object>} HTTP agent options
*/ */
static getHttpsAgentOptions(dockerType, url) { static async getHttpsAgentOptions(dockerType, url) {
let baseOptions = { let baseOptions = {
maxCachedSessions: 0, maxCachedSessions: 0,
rejectUnauthorized: true rejectUnauthorized: true
@ -156,10 +156,10 @@ class DockerHost {
let certPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameCert); let certPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameCert);
let keyPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameKey); let keyPath = path.join(Database.dockerTLSDir, dirName, DockerHost.CertificateFileNameKey);
if (dockerType === "tcp" && fs.existsSync(caPath) && fs.existsSync(certPath) && fs.existsSync(keyPath)) { if (dockerType === "tcp" && await fsExists(caPath) && await fsExists(certPath) && await fsExists(keyPath)) {
let ca = fs.readFileSync(caPath); let ca = await fsAsync.readFile(caPath);
let key = fs.readFileSync(keyPath); let key = await fsAsync.readFile(keyPath);
let cert = fs.readFileSync(certPath); let cert = await fsAsync.readFile(certPath);
certOptions = { certOptions = {
ca, ca,
key, key,

View file

@ -33,7 +33,7 @@ class Group extends BeanModel {
*/ */
async getMonitorList() { async getMonitorList() {
return R.convertToBeans("monitor", await R.getAll(` return R.convertToBeans("monitor", await R.getAll(`
SELECT monitor.*, monitor_group.send_url FROM monitor, monitor_group SELECT monitor.*, monitor_group.send_url, monitor_group.custom_url FROM monitor, monitor_group
WHERE monitor.id = monitor_group.monitor_id WHERE monitor.id = monitor_group.monitor_id
AND group_id = ? AND group_id = ?
ORDER BY monitor_group.weight ORDER BY monitor_group.weight

View file

@ -158,12 +158,22 @@ class Maintenance extends BeanModel {
bean.active = obj.active; bean.active = obj.active;
if (obj.dateRange[0]) { if (obj.dateRange[0]) {
const parsedDate = new Date(obj.dateRange[0]);
if (isNaN(parsedDate.getTime()) || parsedDate.getFullYear() > 9999) {
throw new Error("Invalid start date");
}
bean.start_date = obj.dateRange[0]; bean.start_date = obj.dateRange[0];
} else { } else {
bean.start_date = null; bean.start_date = null;
} }
if (obj.dateRange[1]) { if (obj.dateRange[1]) {
const parsedDate = new Date(obj.dateRange[1]);
if (isNaN(parsedDate.getTime()) || parsedDate.getFullYear() > 9999) {
throw new Error("Invalid end date");
}
bean.end_date = obj.dateRange[1]; bean.end_date = obj.dateRange[1];
} else { } else {
bean.end_date = null; bean.end_date = null;
@ -192,7 +202,7 @@ class Maintenance extends BeanModel {
* @returns {void} * @returns {void}
*/ */
static validateCron(cron) { static validateCron(cron) {
let job = new Cron(cron, () => {}); let job = new Cron(cron, () => { });
job.stop(); job.stop();
} }
@ -229,11 +239,13 @@ class Maintenance extends BeanModel {
apicache.clear(); apicache.clear();
}); });
} else if (this.cron != null) { } else if (this.cron != null) {
let current = dayjs();
// Here should be cron or recurring // Here should be cron or recurring
try { try {
this.beanMeta.status = "scheduled"; this.beanMeta.status = "scheduled";
let startEvent = (customDuration = 0) => { let startEvent = async (customDuration = 0) => {
log.info("maintenance", "Maintenance id: " + this.id + " is under maintenance now"); log.info("maintenance", "Maintenance id: " + this.id + " is under maintenance now");
this.beanMeta.status = "under-maintenance"; this.beanMeta.status = "under-maintenance";
@ -248,6 +260,10 @@ class Maintenance extends BeanModel {
this.beanMeta.status = "scheduled"; this.beanMeta.status = "scheduled";
UptimeKumaServer.getInstance().sendMaintenanceListByUserID(this.user_id); UptimeKumaServer.getInstance().sendMaintenanceListByUserID(this.user_id);
}, duration); }, duration);
// Set last start date to current time
this.last_start_date = current.toISOString();
R.store(this);
}; };
// Create Cron // Create Cron
@ -258,9 +274,25 @@ class Maintenance extends BeanModel {
const startDateTime = startDate.hour(hour).minute(minute); const startDateTime = startDate.hour(hour).minute(minute);
this.beanMeta.job = new Cron(this.cron, { this.beanMeta.job = new Cron(this.cron, {
timezone: await this.getTimezone(), timezone: await this.getTimezone(),
interval: this.interval_day * 24 * 60 * 60,
startAt: startDateTime.toISOString(), startAt: startDateTime.toISOString(),
}, startEvent); }, () => {
if (!this.lastStartDate || this.interval_day === 1) {
return startEvent();
}
// If last start date is set, it means the maintenance has been started before
let lastStartDate = dayjs(this.lastStartDate)
.subtract(1.1, "hour"); // Subtract 1.1 hour to avoid issues with timezone differences
// Check if the interval is enough
if (current.diff(lastStartDate, "day") < this.interval_day) {
log.debug("maintenance", "Maintenance id: " + this.id + " is still in the window, skipping start event");
return;
}
log.debug("maintenance", "Maintenance id: " + this.id + " is not in the window, starting event");
return startEvent();
});
} else { } else {
this.beanMeta.job = new Cron(this.cron, { this.beanMeta.job = new Cron(this.cron, {
timezone: await this.getTimezone(), timezone: await this.getTimezone(),
@ -269,7 +301,6 @@ class Maintenance extends BeanModel {
// Continue if the maintenance is still in the window // Continue if the maintenance is still in the window
let runningTimeslot = this.getRunningTimeslot(); let runningTimeslot = this.getRunningTimeslot();
let current = dayjs();
if (runningTimeslot) { if (runningTimeslot) {
let duration = dayjs(runningTimeslot.endDate).diff(current, "second") * 1000; let duration = dayjs(runningTimeslot.endDate).diff(current, "second") * 1000;
@ -413,8 +444,11 @@ class Maintenance extends BeanModel {
} else if (!this.strategy.startsWith("recurring-")) { } else if (!this.strategy.startsWith("recurring-")) {
this.cron = ""; this.cron = "";
} else if (this.strategy === "recurring-interval") { } else if (this.strategy === "recurring-interval") {
// For intervals, the pattern is calculated in the run function as the interval-option is set // For intervals, the pattern is used to check if the execution should be started
this.cron = "* * * * *"; let array = this.start_time.split(":");
let hour = parseInt(array[0]);
let minute = parseInt(array[1]);
this.cron = `${minute} ${hour} * * *`;
this.duration = this.calcDuration(); this.duration = this.calcDuration();
log.debug("maintenance", "Cron: " + this.cron); log.debug("maintenance", "Cron: " + this.cron);
log.debug("maintenance", "Duration: " + this.duration); log.debug("maintenance", "Duration: " + this.duration);

View file

@ -2,7 +2,11 @@ const dayjs = require("dayjs");
const axios = require("axios"); const axios = require("axios");
const { Prometheus } = require("../prometheus"); const { Prometheus } = require("../prometheus");
const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, MAX_INTERVAL_SECOND, MIN_INTERVAL_SECOND, const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, MAX_INTERVAL_SECOND, MIN_INTERVAL_SECOND,
SQL_DATETIME_FORMAT, evaluateJsonQuery SQL_DATETIME_FORMAT, evaluateJsonQuery,
PING_PACKET_SIZE_MIN, PING_PACKET_SIZE_MAX, PING_PACKET_SIZE_DEFAULT,
PING_GLOBAL_TIMEOUT_MIN, PING_GLOBAL_TIMEOUT_MAX, PING_GLOBAL_TIMEOUT_DEFAULT,
PING_COUNT_MIN, PING_COUNT_MAX, PING_COUNT_DEFAULT,
PING_PER_REQUEST_TIMEOUT_MIN, PING_PER_REQUEST_TIMEOUT_MAX, PING_PER_REQUEST_TIMEOUT_DEFAULT
} = require("../../src/util"); } = require("../../src/util");
const { tcping, ping, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mysqlQuery, setSetting, httpNtlm, radius, grpcQuery, const { tcping, ping, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mysqlQuery, setSetting, httpNtlm, radius, grpcQuery,
redisPingAsync, kafkaProducerAsync, getOidcTokenClientCredentials, rootCertificatesFingerprints, axiosAbortSignal redisPingAsync, kafkaProducerAsync, getOidcTokenClientCredentials, rootCertificatesFingerprints, axiosAbortSignal
@ -53,7 +57,7 @@ class Monitor extends BeanModel {
}; };
if (this.sendUrl) { if (this.sendUrl) {
obj.url = this.url; obj.url = this.customUrl ?? this.url;
} }
if (showTags) { if (showTags) {
@ -153,8 +157,15 @@ class Monitor extends BeanModel {
snmpOid: this.snmpOid, snmpOid: this.snmpOid,
jsonPathOperator: this.jsonPathOperator, jsonPathOperator: this.jsonPathOperator,
snmpVersion: this.snmpVersion, snmpVersion: this.snmpVersion,
smtpSecurity: this.smtpSecurity,
rabbitmqNodes: JSON.parse(this.rabbitmqNodes), rabbitmqNodes: JSON.parse(this.rabbitmqNodes),
conditions: JSON.parse(this.conditions), conditions: JSON.parse(this.conditions),
ipFamily: this.ipFamily,
// ping advanced options
ping_numeric: this.isPingNumeric(),
ping_count: this.ping_count,
ping_per_request_timeout: this.ping_per_request_timeout,
}; };
if (includeSensitiveData) { if (includeSensitiveData) {
@ -170,6 +181,7 @@ class Monitor extends BeanModel {
oauth_client_secret: this.oauth_client_secret, oauth_client_secret: this.oauth_client_secret,
oauth_token_url: this.oauth_token_url, oauth_token_url: this.oauth_token_url,
oauth_scopes: this.oauth_scopes, oauth_scopes: this.oauth_scopes,
oauth_audience: this.oauth_audience,
oauth_auth_method: this.oauth_auth_method, oauth_auth_method: this.oauth_auth_method,
pushToken: this.pushToken, pushToken: this.pushToken,
databaseConnectionString: this.databaseConnectionString, databaseConnectionString: this.databaseConnectionString,
@ -247,6 +259,14 @@ class Monitor extends BeanModel {
return Boolean(this.expiryNotification); return Boolean(this.expiryNotification);
} }
/**
* Check if ping should use numeric output only
* @returns {boolean} True if IP addresses will be output instead of symbolic hostnames
*/
isPingNumeric() {
return Boolean(this.ping_numeric);
}
/** /**
* Parse to boolean * Parse to boolean
* @returns {boolean} Should TLS errors be ignored? * @returns {boolean} Should TLS errors be ignored?
@ -380,39 +400,6 @@ class Monitor extends BeanModel {
if (await Monitor.isUnderMaintenance(this.id)) { if (await Monitor.isUnderMaintenance(this.id)) {
bean.msg = "Monitor under maintenance"; bean.msg = "Monitor under maintenance";
bean.status = MAINTENANCE; bean.status = MAINTENANCE;
} else if (this.type === "group") {
const children = await Monitor.getChildren(this.id);
if (children.length > 0) {
bean.status = UP;
bean.msg = "All children up and running";
for (const child of children) {
if (!child.active) {
// Ignore inactive childs
continue;
}
const lastBeat = await Monitor.getPreviousHeartbeat(child.id);
// Only change state if the monitor is in worse conditions then the ones before
// lastBeat.status could be null
if (!lastBeat) {
bean.status = PENDING;
} else if (bean.status === UP && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
bean.status = lastBeat.status;
} else if (bean.status === PENDING && lastBeat.status === DOWN) {
bean.status = lastBeat.status;
}
}
if (bean.status !== UP) {
bean.msg = "Child inaccessible";
}
} else {
// Set status pending if group is empty
bean.status = PENDING;
bean.msg = "Group empty";
}
} else if (this.type === "http" || this.type === "keyword" || this.type === "json-query") { } else if (this.type === "http" || this.type === "keyword" || this.type === "json-query") {
// Do not do any queries/high loading things before the "bean.ping" // Do not do any queries/high loading things before the "bean.ping"
let startTime = dayjs().valueOf(); let startTime = dayjs().valueOf();
@ -441,10 +428,26 @@ class Monitor extends BeanModel {
} }
} }
let agentFamily = undefined;
if (this.ipFamily === "ipv4") {
agentFamily = 4;
}
if (this.ipFamily === "ipv6") {
agentFamily = 6;
}
const httpsAgentOptions = { const httpsAgentOptions = {
maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)
rejectUnauthorized: !this.getIgnoreTls(), rejectUnauthorized: !this.getIgnoreTls(),
secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT, secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,
autoSelectFamily: true,
...(agentFamily ? { family: agentFamily } : {})
};
const httpAgentOptions = {
maxCachedSessions: 0,
autoSelectFamily: true,
...(agentFamily ? { family: agentFamily } : {})
}; };
log.debug("monitor", `[${this.name}] Prepare Options for axios`); log.debug("monitor", `[${this.name}] Prepare Options for axios`);
@ -506,6 +509,7 @@ class Monitor extends BeanModel {
if (proxy && proxy.active) { if (proxy && proxy.active) {
const { httpAgent, httpsAgent } = Proxy.createAgents(proxy, { const { httpAgent, httpsAgent } = Proxy.createAgents(proxy, {
httpsAgentOptions: httpsAgentOptions, httpsAgentOptions: httpsAgentOptions,
httpAgentOptions: httpAgentOptions,
}); });
options.proxy = false; options.proxy = false;
@ -514,6 +518,10 @@ class Monitor extends BeanModel {
} }
} }
if (!options.httpAgent) {
options.httpAgent = new http.Agent(httpAgentOptions);
}
if (!options.httpsAgent) { if (!options.httpsAgent) {
let jar = new CookieJar(); let jar = new CookieJar();
let httpsCookieAgentOptions = { let httpsCookieAgentOptions = {
@ -617,7 +625,7 @@ class Monitor extends BeanModel {
bean.status = UP; bean.status = UP;
} else if (this.type === "ping") { } else if (this.type === "ping") {
bean.ping = await ping(this.hostname, this.packetSize); bean.ping = await ping(this.hostname, this.ping_count, "", this.ping_numeric, this.packetSize, this.timeout, this.ping_per_request_timeout);
bean.msg = ""; bean.msg = "";
bean.status = UP; bean.status = UP;
} else if (this.type === "push") { // Type: Push } else if (this.type === "push") { // Type: Push
@ -689,7 +697,7 @@ class Monitor extends BeanModel {
bean.msg = res.data.response.servers[0].name; bean.msg = res.data.response.servers[0].name;
try { try {
bean.ping = await ping(this.hostname, this.packetSize); bean.ping = await ping(this.hostname, PING_COUNT_DEFAULT, "", true, this.packetSize, PING_GLOBAL_TIMEOUT_DEFAULT, PING_PER_REQUEST_TIMEOUT_DEFAULT);
} catch (_) { } } catch (_) { }
} else { } else {
throw new Error("Server not found on Steam"); throw new Error("Server not found on Steam");
@ -739,7 +747,7 @@ class Monitor extends BeanModel {
} else if (dockerHost._dockerType === "tcp") { } else if (dockerHost._dockerType === "tcp") {
options.baseURL = DockerHost.patchDockerURL(dockerHost._dockerDaemon); options.baseURL = DockerHost.patchDockerURL(dockerHost._dockerDaemon);
options.httpsAgent = new https.Agent( options.httpsAgent = new https.Agent(
DockerHost.getHttpsAgentOptions(dockerHost._dockerType, options.baseURL) await DockerHost.getHttpsAgentOptions(dockerHost._dockerType, options.baseURL)
); );
} }
@ -1306,7 +1314,7 @@ class Monitor extends BeanModel {
/** /**
* Send a notification about a monitor * Send a notification about a monitor
* @param {boolean} isFirstBeat Is this beat the first of this monitor? * @param {boolean} isFirstBeat Is this beat the first of this monitor?
* @param {Monitor} monitor The monitor to send a notificaton about * @param {Monitor} monitor The monitor to send a notification about
* @param {Bean} bean Status information about monitor * @param {Bean} bean Status information about monitor
* @returns {void} * @returns {void}
*/ */
@ -1327,7 +1335,8 @@ class Monitor extends BeanModel {
try { try {
const heartbeatJSON = bean.toJSON(); const heartbeatJSON = bean.toJSON();
const monitorData = [{ id: monitor.id, const monitorData = [{ id: monitor.id,
active: monitor.active active: monitor.active,
name: monitor.name
}]; }];
const preloadData = await Monitor.preparePreloadData(monitorData); const preloadData = await Monitor.preparePreloadData(monitorData);
// Prevent if the msg is undefined, notifications such as Discord cannot send out. // Prevent if the msg is undefined, notifications such as Discord cannot send out.
@ -1500,6 +1509,31 @@ class Monitor extends BeanModel {
if (this.interval < MIN_INTERVAL_SECOND) { if (this.interval < MIN_INTERVAL_SECOND) {
throw new Error(`Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`); throw new Error(`Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds`);
} }
if (this.type === "ping") {
// ping parameters validation
if (this.packetSize && (this.packetSize < PING_PACKET_SIZE_MIN || this.packetSize > PING_PACKET_SIZE_MAX)) {
throw new Error(`Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PING_PACKET_SIZE_MAX} (default: ${PING_PACKET_SIZE_DEFAULT})`);
}
if (this.ping_per_request_timeout && (this.ping_per_request_timeout < PING_PER_REQUEST_TIMEOUT_MIN || this.ping_per_request_timeout > PING_PER_REQUEST_TIMEOUT_MAX)) {
throw new Error(`Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT})`);
}
if (this.ping_count && (this.ping_count < PING_COUNT_MIN || this.ping_count > PING_COUNT_MAX)) {
throw new Error(`Echo requests count must be between ${PING_COUNT_MIN} and ${PING_COUNT_MAX} (default: ${PING_COUNT_DEFAULT})`);
}
if (this.timeout) {
const pingGlobalTimeout = Math.round(Number(this.timeout));
if (pingGlobalTimeout < this.ping_per_request_timeout || pingGlobalTimeout < PING_GLOBAL_TIMEOUT_MIN || pingGlobalTimeout > PING_GLOBAL_TIMEOUT_MAX) {
throw new Error(`Timeout must be between ${PING_GLOBAL_TIMEOUT_MIN} and ${PING_GLOBAL_TIMEOUT_MAX} seconds (default: ${PING_GLOBAL_TIMEOUT_DEFAULT})`);
}
this.timeout = pingGlobalTimeout;
}
}
} }
/** /**
@ -1625,7 +1659,7 @@ class Monitor extends BeanModel {
/** /**
* Gets all Children of the monitor * Gets all Children of the monitor
* @param {number} monitorID ID of monitor to get * @param {number} monitorID ID of monitor to get
* @returns {Promise<LooseObject<any>>} Children * @returns {Promise<LooseObject<any>[]>} Children
*/ */
static async getChildren(monitorID) { static async getChildren(monitorID) {
return await R.getAll(` return await R.getAll(`
@ -1713,7 +1747,7 @@ class Monitor extends BeanModel {
*/ */
async makeOidcTokenClientCredentialsRequest() { async makeOidcTokenClientCredentialsRequest() {
log.debug("monitor", `[${this.name}] The oauth access-token undefined or expired. Requesting a new token`); log.debug("monitor", `[${this.name}] The oauth access-token undefined or expired. Requesting a new token`);
const oAuthAccessToken = await getOidcTokenClientCredentials(this.oauth_token_url, this.oauth_client_id, this.oauth_client_secret, this.oauth_scopes, this.oauth_auth_method); const oAuthAccessToken = await getOidcTokenClientCredentials(this.oauth_token_url, this.oauth_client_id, this.oauth_client_secret, this.oauth_scopes, this.oauth_audience, this.oauth_auth_method);
if (this.oauthAccessToken?.expires_at) { if (this.oauthAccessToken?.expires_at) {
log.debug("monitor", `[${this.name}] Obtained oauth access-token. Expires at ${new Date(this.oauthAccessToken?.expires_at * 1000)}`); log.debug("monitor", `[${this.name}] Obtained oauth access-token. Expires at ${new Date(this.oauthAccessToken?.expires_at * 1000)}`);
} else { } else {

View file

@ -120,8 +120,8 @@ class StatusPage extends BeanModel {
const head = $("head"); const head = $("head");
if (statusPage.googleAnalyticsTagId) { if (statusPage.google_analytics_tag_id) {
let escapedGoogleAnalyticsScript = googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId); let escapedGoogleAnalyticsScript = googleAnalytics.getGoogleAnalyticsScript(statusPage.google_analytics_tag_id);
head.append($(escapedGoogleAnalyticsScript)); head.append($(escapedGoogleAnalyticsScript));
} }

View file

@ -14,7 +14,7 @@ class User extends BeanModel {
*/ */
static async resetPassword(userID, newPassword) { static async resetPassword(userID, newPassword) {
await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [ await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [
passwordHash.generate(newPassword), await passwordHash.generate(newPassword),
userID userID
]); ]);
} }
@ -25,7 +25,7 @@ class User extends BeanModel {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async resetPassword(newPassword) { async resetPassword(newPassword) {
const hashedPassword = passwordHash.generate(newPassword); const hashedPassword = await passwordHash.generate(newPassword);
await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [ await R.exec("UPDATE `user` SET password = ? WHERE id = ? ", [
hashedPassword, hashedPassword,

View file

@ -89,6 +89,9 @@ function NtlmClient(credentials, AxiosConfig) {
switch (_b.label) { switch (_b.label) {
case 0: case 0:
error = err.response; error = err.response;
// The header may look like this: `Negotiate, NTLM, Basic realm="itsahiddenrealm.example.net"`Add commentMore actions
// so extract the 'NTLM' part first
const ntlmheader = error.headers['www-authenticate'].split(',').find(_ => _.match(/ *NTLM/))?.trim() || '';
if (!(error && error.status === 401 if (!(error && error.status === 401
&& error.headers['www-authenticate'] && error.headers['www-authenticate']
&& error.headers['www-authenticate'].includes('NTLM'))) return [3 /*break*/, 3]; && error.headers['www-authenticate'].includes('NTLM'))) return [3 /*break*/, 3];
@ -96,12 +99,12 @@ function NtlmClient(credentials, AxiosConfig) {
// include the Negotiate option when responding with the T2 message // include the Negotiate option when responding with the T2 message
// There is nore we could do to ensure we are processing correctly, // There is nore we could do to ensure we are processing correctly,
// but this is the easiest option for now // but this is the easiest option for now
if (error.headers['www-authenticate'].length < 50) { if (ntlmheader.length < 50) {
t1Msg = ntlm.createType1Message(credentials.workstation, credentials.domain); t1Msg = ntlm.createType1Message(credentials.workstation, credentials.domain);
error.config.headers["Authorization"] = t1Msg; error.config.headers["Authorization"] = t1Msg;
} }
else { else {
t2Msg = ntlm.decodeType2Message((error.headers['www-authenticate'].match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1]); t2Msg = ntlm.decodeType2Message((ntlmheader.match(/^NTLM\s+(.+?)(,|\s+|$)/) || [])[1]);
t3Msg = ntlm.createType3Message(t2Msg, credentials.username, credentials.password, credentials.workstation, credentials.domain); t3Msg = ntlm.createType3Message(t2Msg, credentials.username, credentials.password, credentials.workstation, credentials.domain);
error.config.headers["X-retry"] = "false"; error.config.headers["X-retry"] = "false";
error.config.headers["Authorization"] = t3Msg; error.config.headers["Authorization"] = t3Msg;

View file

@ -34,12 +34,16 @@ class DnsMonitorType extends MonitorType {
switch (monitor.dns_resolve_type) { switch (monitor.dns_resolve_type) {
case "A": case "A":
case "AAAA": case "AAAA":
case "TXT":
case "PTR": case "PTR":
dnsMessage = `Records: ${dnsRes.join(" | ")}`; dnsMessage = `Records: ${dnsRes.join(" | ")}`;
conditionsResult = dnsRes.some(record => handleConditions({ record })); conditionsResult = dnsRes.some(record => handleConditions({ record }));
break; break;
case "TXT":
dnsMessage = `Records: ${dnsRes.join(" | ")}`;
conditionsResult = dnsRes.flat().some(record => handleConditions({ record }));
break;
case "CNAME": case "CNAME":
dnsMessage = dnsRes[0]; dnsMessage = dnsRes[0];
conditionsResult = handleConditions({ record: dnsRes[0] }); conditionsResult = handleConditions({ record: dnsRes[0] });

View file

@ -0,0 +1,49 @@
const { UP, PENDING, DOWN } = require("../../src/util");
const { MonitorType } = require("./monitor-type");
const Monitor = require("../model/monitor");
class GroupMonitorType extends MonitorType {
name = "group";
/**
* @inheritdoc
*/
async check(monitor, heartbeat, _server) {
const children = await Monitor.getChildren(monitor.id);
if (children.length > 0) {
heartbeat.status = UP;
heartbeat.msg = "All children up and running";
for (const child of children) {
if (!child.active) {
// Ignore inactive childs
continue;
}
const lastBeat = await Monitor.getPreviousHeartbeat(child.id);
// Only change state if the monitor is in worse conditions then the ones before
// lastBeat.status could be null
if (!lastBeat) {
heartbeat.status = PENDING;
} else if (heartbeat.status === UP && (lastBeat.status === PENDING || lastBeat.status === DOWN)) {
heartbeat.status = lastBeat.status;
} else if (heartbeat.status === PENDING && lastBeat.status === DOWN) {
heartbeat.status = lastBeat.status;
}
}
if (heartbeat.status !== UP) {
heartbeat.msg = "Child inaccessible";
}
} else {
// Set status pending if group is empty
heartbeat.status = PENDING;
heartbeat.msg = "Group empty";
}
}
}
module.exports = {
GroupMonitorType,
};

View file

@ -0,0 +1,36 @@
const { MonitorType } = require("./monitor-type");
const { UP, DOWN, PENDING } = require("../../src/util");
class ManualMonitorType extends MonitorType {
name = "Manual";
type = "manual";
description = "A monitor that allows manual control of the status";
supportsConditions = false;
conditionVariables = [];
/**
* @inheritdoc
*/
async check(monitor, heartbeat) {
if (monitor.manual_status !== null) {
heartbeat.status = monitor.manual_status;
switch (monitor.manual_status) {
case UP:
heartbeat.msg = "Up";
break;
case DOWN:
heartbeat.msg = "Down";
break;
default:
heartbeat.msg = "Pending";
}
} else {
heartbeat.status = PENDING;
heartbeat.msg = "Manual monitoring - No status set";
}
}
}
module.exports = {
ManualMonitorType
};

View file

@ -0,0 +1,35 @@
const { MonitorType } = require("./monitor-type");
const { UP } = require("../../src/util");
const nodemailer = require("nodemailer");
class SMTPMonitorType extends MonitorType {
name = "smtp";
/**
* @inheritdoc
*/
async check(monitor, heartbeat, _server) {
let options = {
port: monitor.port || 25,
host: monitor.hostname,
secure: monitor.smtpSecurity === "secure", // use SMTPS (not STARTTLS)
ignoreTLS: monitor.smtpSecurity === "nostarttls", // don't use STARTTLS even if it's available
requireTLS: monitor.smtpSecurity === "starttls", // use STARTTLS or fail
};
let transporter = nodemailer.createTransport(options);
try {
await transporter.verify();
heartbeat.status = UP;
heartbeat.msg = "SMTP connection verifies successfully";
} catch (e) {
throw new Error(`SMTP connection doesn't verify: ${e}`);
} finally {
transporter.close();
}
}
}
module.exports = {
SMTPMonitorType,
};

View file

@ -18,17 +18,28 @@ class Discord extends NotificationProvider {
webhookUrl.searchParams.append("thread_id", notification.threadId); webhookUrl.searchParams.append("thread_id", notification.threadId);
} }
// Check if the webhook has an avatar
let webhookHasAvatar = true;
try {
const webhookInfo = await axios.get(webhookUrl.toString());
webhookHasAvatar = !!webhookInfo.data.avatar;
} catch (e) {
// If we can't verify, we assume he has an avatar to avoid forcing the default avatar
webhookHasAvatar = true;
}
// If heartbeatJSON is null, assume we're testing. // If heartbeatJSON is null, assume we're testing.
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
let discordtestdata = { let discordtestdata = {
username: discordDisplayName, username: discordDisplayName,
content: msg, content: msg,
}; };
if (!webhookHasAvatar) {
discordtestdata.avatar_url = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png";
}
if (notification.discordChannelType === "createNewForumPost") { if (notification.discordChannelType === "createNewForumPost") {
discordtestdata.thread_name = notification.postName; discordtestdata.thread_name = notification.postName;
} }
await axios.post(webhookUrl.toString(), discordtestdata); await axios.post(webhookUrl.toString(), discordtestdata);
return okMsg; return okMsg;
} }
@ -46,10 +57,10 @@ class Discord extends NotificationProvider {
name: "Service Name", name: "Service Name",
value: monitorJSON["name"], value: monitorJSON["name"],
}, },
{ ...(!notification.disableUrl ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON), value: this.extractAddress(monitorJSON),
}, }] : []),
{ {
name: `Time (${heartbeatJSON["timezone"]})`, name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"], value: heartbeatJSON["localDateTime"],
@ -61,6 +72,9 @@ class Discord extends NotificationProvider {
], ],
}], }],
}; };
if (!webhookHasAvatar) {
discorddowndata.avatar_url = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png";
}
if (notification.discordChannelType === "createNewForumPost") { if (notification.discordChannelType === "createNewForumPost") {
discorddowndata.thread_name = notification.postName; discorddowndata.thread_name = notification.postName;
} }
@ -83,10 +97,10 @@ class Discord extends NotificationProvider {
name: "Service Name", name: "Service Name",
value: monitorJSON["name"], value: monitorJSON["name"],
}, },
{ ...(!notification.disableUrl ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON), value: this.extractAddress(monitorJSON),
}, }] : []),
{ {
name: `Time (${heartbeatJSON["timezone"]})`, name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"], value: heartbeatJSON["localDateTime"],
@ -98,6 +112,9 @@ class Discord extends NotificationProvider {
], ],
}], }],
}; };
if (!webhookHasAvatar) {
discordupdata.avatar_url = "https://github.com/louislam/uptime-kuma/raw/master/public/icon.png";
}
if (notification.discordChannelType === "createNewForumPost") { if (notification.discordChannelType === "createNewForumPost") {
discordupdata.thread_name = notification.postName; discordupdata.thread_name = notification.postName;

View file

@ -38,7 +38,7 @@ class FlashDuty extends NotificationProvider {
} }
/** /**
* Generate a monitor url from the monitors infomation * Generate a monitor url from the monitors information
* @param {object} monitorInfo Monitor details * @param {object} monitorInfo Monitor details
* @returns {string|undefined} Monitor URL * @returns {string|undefined} Monitor URL
*/ */
@ -73,13 +73,13 @@ class FlashDuty extends NotificationProvider {
} }
const options = { const options = {
method: "POST", method: "POST",
url: "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey, url: notification.flashdutyIntegrationKey.startsWith("http") ? notification.flashdutyIntegrationKey : "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey,
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
data: { data: {
description: `[${title}] [${monitorInfo.name}] ${body}`, description: `[${title}] [${monitorInfo.name}] ${body}`,
title, title,
event_status: eventStatus || "Info", event_status: eventStatus || "Info",
alert_key: String(monitorInfo.id) || Math.random().toString(36).substring(7), alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7),
labels, labels,
} }
}; };

View file

@ -0,0 +1,53 @@
const { getMonitorRelativeURL, UP } = require("../../src/util");
const { setting } = require("../util-server");
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class Notifery extends NotificationProvider {
name = "notifery";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://api.notifery.com/event";
let data = {
title: notification.notiferyTitle || "Uptime Kuma Alert",
message: msg,
};
if (notification.notiferyGroup) {
data.group = notification.notiferyGroup;
}
// Link to the monitor
const baseURL = await setting("primaryBaseURL");
if (baseURL && monitorJSON) {
data.message += `\n\nMonitor: ${baseURL}${getMonitorRelativeURL(monitorJSON.id)}`;
}
if (heartbeatJSON) {
data.code = heartbeatJSON.status === UP ? 0 : 1;
if (heartbeatJSON.ping) {
data.duration = heartbeatJSON.ping;
}
}
try {
const headers = {
"Content-Type": "application/json",
"x-api-key": notification.notiferyApiKey,
};
await axios.post(url, data, { headers });
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Notifery;

View file

@ -41,8 +41,8 @@ class Ntfy extends NotificationProvider {
if (heartbeatJSON.status === DOWN) { if (heartbeatJSON.status === DOWN) {
tags = [ "red_circle" ]; tags = [ "red_circle" ];
status = "Down"; status = "Down";
// if priority is not 5, increase priority for down alerts // defaults to max(priority + 1, 5)
priority = priority === 5 ? priority : priority + 1; priority = notification.ntfyPriorityDown || (priority === 5 ? priority : priority + 1);
} else if (heartbeatJSON["status"] === UP) { } else if (heartbeatJSON["status"] === UP) {
tags = [ "green_circle" ]; tags = [ "green_circle" ];
status = "Up"; status = "Up";

View file

@ -0,0 +1,73 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class OneChat extends NotificationProvider {
name = "OneChat";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://chat-api.one.th/message/api/v1/push_message";
try {
const config = {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + notification.accessToken,
},
};
if (heartbeatJSON == null) {
const testMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message: "Test Successful!",
};
await axios.post(url, testMessage, config);
} else if (heartbeatJSON["status"] === DOWN) {
const downMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message:
`UptimeKuma Alert:
[🔴 Down]
Name: ${monitorJSON["name"]}
${heartbeatJSON["msg"]}
Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
};
await axios.post(url, downMessage, config);
} else if (heartbeatJSON["status"] === UP) {
const upMessage = {
to: notification.recieverId,
bot_id: notification.botId,
type: "text",
message:
`UptimeKuma Alert:
[🟢 Up]
Name: ${monitorJSON["name"]}
${heartbeatJSON["msg"]}
Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
};
await axios.post(url, upMessage, config);
}
return okMsg;
} catch (error) {
// Handle errors and throw a descriptive message
if (error.response) {
const errorMessage =
error.response.data?.message ||
"Unknown API error occurred.";
throw new Error(`OneChat API Error: ${errorMessage}`);
} else {
this.throwGeneralAxiosError(error);
}
}
}
}
module.exports = OneChat;

View file

@ -15,7 +15,7 @@ class PromoSMS extends NotificationProvider {
notification.promosmsAllowLongSMS = false; notification.promosmsAllowLongSMS = false;
} }
//TODO: Add option for enabling special characters. It will decrese message max length from 160 to 70 chars. //TODO: Add option for enabling special characters. It will decrease message max length from 160 to 70 chars.
//Lets remove non ascii char //Lets remove non ascii char
let cleanMsg = msg.replace(/[^\x00-\x7F]/g, ""); let cleanMsg = msg.replace(/[^\x00-\x7F]/g, "");

View file

@ -0,0 +1,48 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { UP } = require("../../src/util");
class Pumble extends NotificationProvider {
name = "pumble";
/**
* @inheritDoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
if (heartbeatJSON === null && monitorJSON === null) {
let data = {
"attachments": [
{
"title": "Uptime Kuma Alert",
"text": msg,
"color": "#5BDD8B"
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
}
let data = {
"attachments": [
{
"title": `${monitorJSON["name"]} is ${heartbeatJSON["status"] === UP ? "up" : "down"}`,
"text": heartbeatJSON["msg"],
"color": (heartbeatJSON["status"] === UP ? "#5BDD8B" : "#DC3645"),
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Pumble;

View file

@ -11,7 +11,7 @@ class PushDeer extends NotificationProvider {
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully."; const okMsg = "Sent Successfully.";
const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com"; const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com";
// capture group below is nessesary to prevent an ReDOS-attack // capture group below is necessary to prevent an ReDOS-attack
const url = `${serverUrl.trim().replace(/([^/])\/+$/, "$1")}/message/push`; const url = `${serverUrl.trim().replace(/([^/])\/+$/, "$1")}/message/push`;
let valid = msg != null && monitorJSON != null && heartbeatJSON != null; let valid = msg != null && monitorJSON != null && heartbeatJSON != null;

View file

@ -1,5 +1,6 @@
const { getMonitorRelativeURL } = require("../../src/util"); const { getMonitorRelativeURL } = require("../../src/util");
const { setting } = require("../util-server"); const { setting } = require("../util-server");
const { UP } = require("../../src/util");
const NotificationProvider = require("./notification-provider"); const NotificationProvider = require("./notification-provider");
const axios = require("axios"); const axios = require("axios");
@ -43,15 +44,20 @@ class Pushover extends NotificationProvider {
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
await axios.post(url, data); await axios.post(url, data);
return okMsg; return okMsg;
} else {
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>:${heartbeatJSON["localDateTime"]}`;
await axios.post(url, data);
return okMsg;
} }
if (heartbeatJSON.status === UP && notification.pushoversounds_up) {
// default = DOWN => DOWN-sound is also played for non-UP/DOWN notiifcations
data.sound = notification.pushoversounds_up;
}
data.message += `\n<b>Time (${heartbeatJSON["timezone"]})</b>: ${heartbeatJSON["localDateTime"]}`;
await axios.post(url, data);
return okMsg;
} catch (error) { } catch (error) {
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} }
} }
} }

View file

@ -145,6 +145,7 @@ class Slack extends NotificationProvider {
const title = "Uptime Kuma Alert"; const title = "Uptime Kuma Alert";
let data = { let data = {
"text": msg,
"channel": notification.slackchannel, "channel": notification.slackchannel,
"username": notification.slackusername, "username": notification.slackusername,
"icon_emoji": notification.slackiconemo, "icon_emoji": notification.slackiconemo,

View file

@ -0,0 +1,40 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
class SMSPlanet extends NotificationProvider {
name = "SMSPlanet";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://api2.smsplanet.pl/sms";
try {
let config = {
headers: {
"Authorization": "Bearer " + notification.smsplanetApiToken,
"content-type": "multipart/form-data"
}
};
let data = {
"from": notification.smsplanetSenderName,
"to": notification.smsplanetPhoneNumbers,
"msg": msg.replace(/🔴/, "❌")
};
let response = await axios.post(url, data, config);
if (!response.data?.messageId) {
throw new Error(response.data?.errorMsg ?? "SMSPlanet server did not respond with the expected result");
}
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = SMSPlanet;

View file

@ -11,59 +11,127 @@ class SMSEagle extends NotificationProvider {
const okMsg = "Sent Successfully."; const okMsg = "Sent Successfully.";
try { try {
let config = { if (notification.smseagleApiType === "smseagle-apiv1") { // according to https://www.smseagle.eu/apiv1/
headers: { let config = {
"Content-Type": "application/json", headers: {
"Content-Type": "application/x-www-form-urlencoded",
}
};
let sendMethod;
let recipientType;
let duration;
let voiceId;
if (notification.smseagleRecipientType === "smseagle-contact") {
recipientType = "contactname";
sendMethod = "/send_tocontact";
} else if (notification.smseagleRecipientType === "smseagle-group") {
recipientType = "groupname";
sendMethod = "/send_togroup";
} else if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to";
sendMethod = "/send_sms";
if (notification.smseagleMsgType !== "smseagle-sms") {
duration = notification.smseagleDuration ?? 10;
if (notification.smseagleMsgType === "smseagle-ring") {
sendMethod = "/ring_call";
} else if (notification.smseagleMsgType === "smseagle-tts") {
sendMethod = "/tts_call";
} else if (notification.smseagleMsgType === "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call";
voiceId = notification.smseagleTtsModel ? notification.smseagleTtsModel : 1;
}
}
} }
};
let postData; const url = new URL(notification.smseagleUrl + "/http_api" + sendMethod);
let sendMethod;
let recipientType;
let encoding = (notification.smseagleEncoding) ? "1" : "0"; url.searchParams.append("access_token", notification.smseagleToken);
let priority = (notification.smseaglePriority) ? notification.smseaglePriority : "0"; url.searchParams.append(recipientType, notification.smseagleRecipient);
if (!notification.smseagleRecipientType || notification.smseagleRecipientType === "smseagle-sms") {
if (notification.smseagleRecipientType === "smseagle-contact") { url.searchParams.append("unicode", (notification.smseagleEncoding) ? "1" : "0");
recipientType = "contactname"; url.searchParams.append("highpriority", notification.smseaglePriority ?? "0");
sendMethod = "sms.send_tocontact";
}
if (notification.smseagleRecipientType === "smseagle-group") {
recipientType = "groupname";
sendMethod = "sms.send_togroup";
}
if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to";
sendMethod = "sms.send_sms";
}
let params = {
access_token: notification.smseagleToken,
[recipientType]: notification.smseagleRecipient,
message: msg,
responsetype: "extended",
unicode: encoding,
highpriority: priority
};
postData = {
method: sendMethod,
params: params
};
let resp = await axios.post(notification.smseagleUrl + "/jsonrpc/sms", postData, config);
if ((JSON.stringify(resp.data)).indexOf("message_id") === -1) {
let error = "";
if (resp.data.result && resp.data.result.error_text) {
error = `SMSEagle API returned error: ${JSON.stringify(resp.data.result.error_text)}`;
} else { } else {
error = "SMSEagle API returned an unexpected response"; url.searchParams.append("duration", duration);
}
if (notification.smseagleRecipientType !== "smseagle-ring") {
url.searchParams.append("message", msg);
}
if (voiceId) {
url.searchParams.append("voice_id", voiceId);
} }
throw new Error(error);
}
return okMsg; let resp = await axios.get(url.toString(), config);
if (resp.data.indexOf("OK") === -1) {
let error = `SMSEagle API returned error: ${resp.data}`;
throw new Error(error);
}
return okMsg;
} else if (notification.smseagleApiType === "smseagle-apiv2") { // according to https://www.smseagle.eu/docs/apiv2/
let config = {
headers: {
"access-token": notification.smseagleToken,
"Content-Type": "application/json",
}
};
let encoding = (notification.smseagleEncoding) ? "unicode" : "standard";
let priority = (notification.smseaglePriority) ?? 0;
let postData = {
text: msg,
encoding: encoding,
priority: priority
};
if (notification.smseagleRecipientContact) {
postData["contacts"] = notification.smseagleRecipientContact.split(",").map(Number);
}
if (notification.smseagleRecipientGroup) {
postData["groups"] = notification.smseagleRecipientGroup.split(",").map(Number);
}
if (notification.smseagleRecipientTo) {
postData["to"] = notification.smseagleRecipientTo.split(",");
}
let endpoint = "/messages/sms";
if (notification.smseagleMsgType !== "smseagle-sms") {
postData["duration"] = notification.smseagleDuration ?? 10;
if (notification.smseagleMsgType === "smseagle-ring") {
endpoint = "/calls/ring";
} else if (notification.smseagleMsgType === "smseagle-tts") {
endpoint = "/calls/tts";
} else if (notification.smseagleMsgType === "smseagle-tts-advanced") {
endpoint = "/calls/tts_advanced";
postData["voice_id"] = notification.smseagleTtsModel ?? 1;
}
}
let resp = await axios.post(notification.smseagleUrl + "/api/v2" + endpoint, postData, config);
const queuedCount = resp.data.filter(x => x.status === "queued").length;
const unqueuedCount = resp.data.length - queuedCount;
if (resp.status !== 200 || queuedCount === 0) {
if (!resp.data.length) {
throw new Error("SMSEagle API returned an empty response");
}
throw new Error(`SMSEagle API returned error: ${JSON.stringify(resp.data)}`);
}
if (unqueuedCount) {
return `Sent ${queuedCount}/${resp.data.length} Messages Successfully.`;
}
return okMsg;
}
} catch (error) { } catch (error) {
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} }

View file

@ -42,6 +42,7 @@ class SMTP extends NotificationProvider {
// default values in case the user does not want to template // default values in case the user does not want to template
let subject = msg; let subject = msg;
let body = msg; let body = msg;
let useHTMLBody = false;
if (heartbeatJSON) { if (heartbeatJSON) {
body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`; body = `${msg}\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`;
} }
@ -50,11 +51,11 @@ class SMTP extends NotificationProvider {
// cannot end with whitespace as this often raises spam scores // cannot end with whitespace as this often raises spam scores
const customSubject = notification.customSubject?.trim() || ""; const customSubject = notification.customSubject?.trim() || "";
const customBody = notification.customBody?.trim() || ""; const customBody = notification.customBody?.trim() || "";
if (customSubject !== "") { if (customSubject !== "") {
subject = await this.renderTemplate(customSubject, msg, monitorJSON, heartbeatJSON); subject = await this.renderTemplate(customSubject, msg, monitorJSON, heartbeatJSON);
} }
if (customBody !== "") { if (customBody !== "") {
useHTMLBody = notification.htmlBody || false;
body = await this.renderTemplate(customBody, msg, monitorJSON, heartbeatJSON); body = await this.renderTemplate(customBody, msg, monitorJSON, heartbeatJSON);
} }
} }
@ -67,7 +68,8 @@ class SMTP extends NotificationProvider {
bcc: notification.smtpBCC, bcc: notification.smtpBCC,
to: notification.smtpTo, to: notification.smtpTo,
subject: subject, subject: subject,
text: body, // If the email body is custom, and the user wants it, set the email body as HTML
[useHTMLBody ? "html" : "text"]: body
}); });
return okMsg; return okMsg;

View file

@ -0,0 +1,37 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class SpugPush extends NotificationProvider {
name = "SpugPush";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully.";
try {
let formData = {
title: "Uptime Kuma Message",
content: msg
};
if (heartbeatJSON) {
if (heartbeatJSON["status"] === UP) {
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
formData.content = `[✅ Up] ${heartbeatJSON["msg"]}`;
} else if (heartbeatJSON["status"] === DOWN) {
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
formData.content = `[🔴 Down] ${heartbeatJSON["msg"]}`;
}
}
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
await axios.post(apiUrl, formData);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = SpugPush;

View file

@ -13,6 +13,7 @@ const DingDing = require("./notification-providers/dingding");
const Discord = require("./notification-providers/discord"); const Discord = require("./notification-providers/discord");
const Elks = require("./notification-providers/46elks"); const Elks = require("./notification-providers/46elks");
const Feishu = require("./notification-providers/feishu"); const Feishu = require("./notification-providers/feishu");
const Notifery = require("./notification-providers/notifery");
const FreeMobile = require("./notification-providers/freemobile"); const FreeMobile = require("./notification-providers/freemobile");
const GoogleChat = require("./notification-providers/google-chat"); const GoogleChat = require("./notification-providers/google-chat");
const Gorush = require("./notification-providers/gorush"); const Gorush = require("./notification-providers/gorush");
@ -30,9 +31,11 @@ const Mattermost = require("./notification-providers/mattermost");
const Nostr = require("./notification-providers/nostr"); const Nostr = require("./notification-providers/nostr");
const Ntfy = require("./notification-providers/ntfy"); const Ntfy = require("./notification-providers/ntfy");
const Octopush = require("./notification-providers/octopush"); const Octopush = require("./notification-providers/octopush");
const OneChat = require("./notification-providers/onechat");
const OneBot = require("./notification-providers/onebot"); const OneBot = require("./notification-providers/onebot");
const Opsgenie = require("./notification-providers/opsgenie"); const Opsgenie = require("./notification-providers/opsgenie");
const PagerDuty = require("./notification-providers/pagerduty"); const PagerDuty = require("./notification-providers/pagerduty");
const Pumble = require("./notification-providers/pumble");
const FlashDuty = require("./notification-providers/flashduty"); const FlashDuty = require("./notification-providers/flashduty");
const PagerTree = require("./notification-providers/pagertree"); const PagerTree = require("./notification-providers/pagertree");
const PromoSMS = require("./notification-providers/promosms"); const PromoSMS = require("./notification-providers/promosms");
@ -72,6 +75,8 @@ const Onesender = require("./notification-providers/onesender");
const Wpush = require("./notification-providers/wpush"); const Wpush = require("./notification-providers/wpush");
const SendGrid = require("./notification-providers/send-grid"); const SendGrid = require("./notification-providers/send-grid");
const YZJ = require("./notification-providers/yzj"); const YZJ = require("./notification-providers/yzj");
const SMSPlanet = require("./notification-providers/sms-planet");
const SpugPush = require("./notification-providers/spugpush");
class Notification { class Notification {
@ -119,6 +124,7 @@ class Notification {
new Nostr(), new Nostr(),
new Ntfy(), new Ntfy(),
new Octopush(), new Octopush(),
new OneChat(),
new OneBot(), new OneBot(),
new Onesender(), new Onesender(),
new Opsgenie(), new Opsgenie(),
@ -126,6 +132,7 @@ class Notification {
new FlashDuty(), new FlashDuty(),
new PagerTree(), new PagerTree(),
new PromoSMS(), new PromoSMS(),
new Pumble(),
new Pushbullet(), new Pushbullet(),
new PushDeer(), new PushDeer(),
new Pushover(), new Pushover(),
@ -160,7 +167,10 @@ class Notification {
new Cellsynt(), new Cellsynt(),
new Wpush(), new Wpush(),
new SendGrid(), new SendGrid(),
new YZJ() new YZJ(),
new SMSPlanet(),
new SpugPush(),
new Notifery(),
]; ];
for (let item of list) { for (let item of list) {
if (! item.name) { if (! item.name) {

View file

@ -5,10 +5,10 @@ const saltRounds = 10;
/** /**
* Hash a password * Hash a password
* @param {string} password Password to hash * @param {string} password Password to hash
* @returns {string} Hash * @returns {Promise<string>} Hash
*/ */
exports.generate = function (password) { exports.generate = function (password) {
return bcrypt.hashSync(password, saltRounds); return bcrypt.hash(password, saltRounds);
}; };
/** /**

View file

@ -2,6 +2,7 @@ const PrometheusClient = require("prom-client");
const { log } = require("../src/util"); const { log } = require("../src/util");
const commonLabels = [ const commonLabels = [
"monitor_id",
"monitor_name", "monitor_name",
"monitor_type", "monitor_type",
"monitor_url", "monitor_url",
@ -40,6 +41,7 @@ class Prometheus {
*/ */
constructor(monitor) { constructor(monitor) {
this.monitorLabelValues = { this.monitorLabelValues = {
monitor_id: monitor.id,
monitor_name: monitor.name, monitor_name: monitor.name,
monitor_type: monitor.type, monitor_type: monitor.type,
monitor_url: monitor.url, monitor_url: monitor.url,

View file

@ -50,7 +50,7 @@ router.all("/api/push/:pushToken", async (request, response) => {
let msg = request.query.msg || "OK"; let msg = request.query.msg || "OK";
let ping = parseFloat(request.query.ping) || null; let ping = parseFloat(request.query.ping) || null;
let statusString = request.query.status || "up"; let statusString = request.query.status || "up";
let status = (statusString === "up") ? UP : DOWN; const statusFromParam = (statusString === "up") ? UP : DOWN;
let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [ let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [
pushToken pushToken
@ -80,7 +80,7 @@ router.all("/api/push/:pushToken", async (request, response) => {
msg = "Monitor under maintenance"; msg = "Monitor under maintenance";
bean.status = MAINTENANCE; bean.status = MAINTENANCE;
} else { } else {
determineStatus(status, previousHeartbeat, monitor.maxretries, monitor.isUpsideDown(), bean); determineStatus(statusFromParam, previousHeartbeat, monitor.maxretries, monitor.isUpsideDown(), bean);
} }
// Calculate uptime // Calculate uptime
@ -92,21 +92,21 @@ router.all("/api/push/:pushToken", async (request, response) => {
log.debug("router", "PreviousStatus: " + previousHeartbeat?.status); log.debug("router", "PreviousStatus: " + previousHeartbeat?.status);
log.debug("router", "Current Status: " + bean.status); log.debug("router", "Current Status: " + bean.status);
bean.important = Monitor.isImportantBeat(isFirstBeat, previousHeartbeat?.status, status); bean.important = Monitor.isImportantBeat(isFirstBeat, previousHeartbeat?.status, bean.status);
if (Monitor.isImportantForNotification(isFirstBeat, previousHeartbeat?.status, status)) { if (Monitor.isImportantForNotification(isFirstBeat, previousHeartbeat?.status, bean.status)) {
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;
log.debug("monitor", `[${this.name}] sendNotification`); log.debug("monitor", `[${monitor.name}] sendNotification`);
await Monitor.sendNotification(isFirstBeat, monitor, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
} else { } else {
if (bean.status === DOWN && this.resendInterval > 0) { if (bean.status === DOWN && monitor.resendInterval > 0) {
++bean.downCount; ++bean.downCount;
if (bean.downCount >= this.resendInterval) { if (bean.downCount >= monitor.resendInterval) {
// Send notification again, because we are still DOWN // Send notification again, because we are still DOWN
log.debug("monitor", `[${this.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`); log.debug("monitor", `[${monitor.name}] sendNotification again: Down Count: ${bean.downCount} | Resend Interval: ${monitor.resendInterval}`);
await Monitor.sendNotification(isFirstBeat, this, bean); await Monitor.sendNotification(isFirstBeat, monitor, bean);
// Reset down count // Reset down count
bean.downCount = 0; bean.downCount = 0;

View file

@ -89,7 +89,7 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques
SELECT * FROM heartbeat SELECT * FROM heartbeat
WHERE monitor_id = ? WHERE monitor_id = ?
ORDER BY time DESC ORDER BY time DESC
LIMIT 50 LIMIT 100
`, [ `, [
monitorID, monitorID,
]); ]);

View file

@ -674,7 +674,7 @@ let needSetup = false;
let user = R.dispense("user"); let user = R.dispense("user");
user.username = username; user.username = username;
user.password = passwordHash.generate(password); user.password = await passwordHash.generate(password);
await R.store(user); await R.store(user);
needSetup = false; needSetup = false;
@ -792,6 +792,7 @@ let needSetup = false;
bean.url = monitor.url; bean.url = monitor.url;
bean.method = monitor.method; bean.method = monitor.method;
bean.body = monitor.body; bean.body = monitor.body;
bean.ipFamily = monitor.ipFamily;
bean.headers = monitor.headers; bean.headers = monitor.headers;
bean.basic_auth_user = monitor.basic_auth_user; bean.basic_auth_user = monitor.basic_auth_user;
bean.basic_auth_pass = monitor.basic_auth_pass; bean.basic_auth_pass = monitor.basic_auth_pass;
@ -801,6 +802,7 @@ let needSetup = false;
bean.oauth_auth_method = monitor.oauth_auth_method; bean.oauth_auth_method = monitor.oauth_auth_method;
bean.oauth_token_url = monitor.oauth_token_url; bean.oauth_token_url = monitor.oauth_token_url;
bean.oauth_scopes = monitor.oauth_scopes; bean.oauth_scopes = monitor.oauth_scopes;
bean.oauth_audience = monitor.oauth_audience;
bean.tlsCa = monitor.tlsCa; bean.tlsCa = monitor.tlsCa;
bean.tlsCert = monitor.tlsCert; bean.tlsCert = monitor.tlsCert;
bean.tlsKey = monitor.tlsKey; bean.tlsKey = monitor.tlsKey;
@ -866,6 +868,7 @@ let needSetup = false;
monitor.kafkaProducerAllowAutoTopicCreation; monitor.kafkaProducerAllowAutoTopicCreation;
bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly; bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly;
bean.remote_browser = monitor.remote_browser; bean.remote_browser = monitor.remote_browser;
bean.smtpSecurity = monitor.smtpSecurity;
bean.snmpVersion = monitor.snmpVersion; bean.snmpVersion = monitor.snmpVersion;
bean.snmpOid = monitor.snmpOid; bean.snmpOid = monitor.snmpOid;
bean.jsonPathOperator = monitor.jsonPathOperator; bean.jsonPathOperator = monitor.jsonPathOperator;
@ -874,6 +877,12 @@ let needSetup = false;
bean.rabbitmqUsername = monitor.rabbitmqUsername; bean.rabbitmqUsername = monitor.rabbitmqUsername;
bean.rabbitmqPassword = monitor.rabbitmqPassword; bean.rabbitmqPassword = monitor.rabbitmqPassword;
bean.conditions = JSON.stringify(monitor.conditions); bean.conditions = JSON.stringify(monitor.conditions);
bean.manual_status = monitor.manual_status;
// ping advanced options
bean.ping_numeric = monitor.ping_numeric;
bean.ping_count = monitor.ping_count;
bean.ping_per_request_timeout = monitor.ping_per_request_timeout;
bean.validate(); bean.validate();

View file

@ -20,14 +20,14 @@ module.exports.apiKeySocketHandler = (socket) => {
checkLogin(socket); checkLogin(socket);
let clearKey = nanoid(40); let clearKey = nanoid(40);
let hashedKey = passwordHash.generate(clearKey); let hashedKey = await passwordHash.generate(clearKey);
key["key"] = hashedKey; key["key"] = hashedKey;
let bean = await APIKey.save(key, socket.userID); let bean = await APIKey.save(key, socket.userID);
log.debug("apikeys", "Added API Key"); log.debug("apikeys", "Added API Key");
log.debug("apikeys", key); log.debug("apikeys", key);
// Append key ID and prefix to start of key seperated by _, used to get // Append key ID and prefix to start of key separated by _, used to get
// correct hash when validating key. // correct hash when validating key.
let formattedKey = "uk" + bean.id + "_" + clearKey; let formattedKey = "uk" + bean.id + "_" + clearKey;
await sendAPIKeyList(socket); await sendAPIKeyList(socket);

View file

@ -14,7 +14,7 @@ module.exports.databaseSocketHandler = (socket) => {
checkLogin(socket); checkLogin(socket);
callback({ callback({
ok: true, ok: true,
size: Database.getSize(), size: await Database.getSize(),
}); });
} catch (error) { } catch (error) {
callback({ callback({

View file

@ -4,7 +4,7 @@ const { sendInfo } = require("../client");
const { checkLogin } = require("../util-server"); const { checkLogin } = require("../util-server");
const GameResolver = require("gamedig/lib/GameResolver"); const GameResolver = require("gamedig/lib/GameResolver");
const { testChrome } = require("../monitor-types/real-browser-monitor-type"); const { testChrome } = require("../monitor-types/real-browser-monitor-type");
const fs = require("fs"); const fsAsync = require("fs").promises;
const path = require("path"); const path = require("path");
let gameResolver = new GameResolver(); let gameResolver = new GameResolver();
@ -90,17 +90,29 @@ module.exports.generalSocketHandler = (socket, server) => {
} }
}); });
socket.on("getPushExample", (language, callback) => { socket.on("getPushExample", async (language, callback) => {
try {
checkLogin(socket);
if (!/^[a-z-]+$/.test(language)) {
throw new Error("Invalid language");
}
} catch (e) {
callback({
ok: false,
msg: e.message,
});
return;
}
try { try {
let dir = path.join("./extra/push-examples", language); let dir = path.join("./extra/push-examples", language);
let files = fs.readdirSync(dir); let files = await fsAsync.readdir(dir);
for (let file of files) { for (let file of files) {
if (file.startsWith("index.")) { if (file.startsWith("index.")) {
callback({ callback({
ok: true, ok: true,
code: fs.readFileSync(path.join(dir, file), "utf8"), code: await fsAsync.readFile(path.join(dir, file), "utf8"),
}); });
return; return;
} }

View file

@ -211,6 +211,10 @@ module.exports.statusPageSocketHandler = (socket) => {
relationBean.send_url = monitor.sendUrl; relationBean.send_url = monitor.sendUrl;
} }
if (monitor.url !== undefined) {
relationBean.custom_url = monitor.url;
}
await R.store(relationBean); await R.store(relationBean);
} }

View file

@ -582,7 +582,7 @@ class UptimeCalculator {
let totalPing = 0; let totalPing = 0;
let endTimestamp; let endTimestamp;
// Get the eariest timestamp of the required period based on the type // Get the earliest timestamp of the required period based on the type
switch (type) { switch (type) {
case "day": case "day":
endTimestamp = key - 86400 * (num - 1); endTimestamp = key - 86400 * (num - 1);
@ -710,7 +710,7 @@ class UptimeCalculator {
let endTimestamp; let endTimestamp;
// Get the eariest timestamp of the required period based on the type // Get the earliest timestamp of the required period based on the type
switch (type) { switch (type) {
case "day": case "day":
endTimestamp = key - 86400 * (num - 1); endTimestamp = key - 86400 * (num - 1);

View file

@ -113,9 +113,12 @@ class UptimeKumaServer {
UptimeKumaServer.monitorTypeList["tailscale-ping"] = new TailscalePing(); UptimeKumaServer.monitorTypeList["tailscale-ping"] = new TailscalePing();
UptimeKumaServer.monitorTypeList["dns"] = new DnsMonitorType(); UptimeKumaServer.monitorTypeList["dns"] = new DnsMonitorType();
UptimeKumaServer.monitorTypeList["mqtt"] = new MqttMonitorType(); UptimeKumaServer.monitorTypeList["mqtt"] = new MqttMonitorType();
UptimeKumaServer.monitorTypeList["smtp"] = new SMTPMonitorType();
UptimeKumaServer.monitorTypeList["group"] = new GroupMonitorType();
UptimeKumaServer.monitorTypeList["snmp"] = new SNMPMonitorType(); UptimeKumaServer.monitorTypeList["snmp"] = new SNMPMonitorType();
UptimeKumaServer.monitorTypeList["mongodb"] = new MongodbMonitorType(); UptimeKumaServer.monitorTypeList["mongodb"] = new MongodbMonitorType();
UptimeKumaServer.monitorTypeList["rabbitmq"] = new RabbitMqMonitorType(); UptimeKumaServer.monitorTypeList["rabbitmq"] = new RabbitMqMonitorType();
UptimeKumaServer.monitorTypeList["manual"] = new ManualMonitorType();
// Allow all CORS origins (polling) in development // Allow all CORS origins (polling) in development
let cors = undefined; let cors = undefined;
@ -551,7 +554,10 @@ const { RealBrowserMonitorType } = require("./monitor-types/real-browser-monitor
const { TailscalePing } = require("./monitor-types/tailscale-ping"); const { TailscalePing } = require("./monitor-types/tailscale-ping");
const { DnsMonitorType } = require("./monitor-types/dns"); const { DnsMonitorType } = require("./monitor-types/dns");
const { MqttMonitorType } = require("./monitor-types/mqtt"); const { MqttMonitorType } = require("./monitor-types/mqtt");
const { SMTPMonitorType } = require("./monitor-types/smtp");
const { GroupMonitorType } = require("./monitor-types/group");
const { SNMPMonitorType } = require("./monitor-types/snmp"); const { SNMPMonitorType } = require("./monitor-types/snmp");
const { MongodbMonitorType } = require("./monitor-types/mongodb"); const { MongodbMonitorType } = require("./monitor-types/mongodb");
const { RabbitMqMonitorType } = require("./monitor-types/rabbitmq"); const { RabbitMqMonitorType } = require("./monitor-types/rabbitmq");
const { ManualMonitorType } = require("./monitor-types/manual");
const Monitor = require("./model/monitor"); const Monitor = require("./model/monitor");

View file

@ -1,7 +1,11 @@
const tcpp = require("tcp-ping"); const tcpp = require("tcp-ping");
const ping = require("@louislam/ping"); const ping = require("@louislam/ping");
const { R } = require("redbean-node"); const { R } = require("redbean-node");
const { log, genSecret, badgeConstants } = require("../src/util"); const {
log, genSecret, badgeConstants,
PING_PACKET_SIZE_DEFAULT, PING_GLOBAL_TIMEOUT_DEFAULT,
PING_COUNT_DEFAULT, PING_PER_REQUEST_TIMEOUT_DEFAULT
} = require("../src/util");
const passwordHash = require("./password-hash"); const passwordHash = require("./password-hash");
const { Resolver } = require("dns"); const { Resolver } = require("dns");
const iconv = require("iconv-lite"); const iconv = require("iconv-lite");
@ -19,6 +23,7 @@ const radiusClient = require("node-radius-client");
const redis = require("redis"); const redis = require("redis");
const oidc = require("openid-client"); const oidc = require("openid-client");
const tls = require("tls"); const tls = require("tls");
const { exists } = require("fs");
const { const {
dictionaries: { dictionaries: {
@ -47,13 +52,13 @@ exports.initJWTSecret = async () => {
jwtSecretBean.key = "jwtSecret"; jwtSecretBean.key = "jwtSecret";
} }
jwtSecretBean.value = passwordHash.generate(genSecret()); jwtSecretBean.value = await passwordHash.generate(genSecret());
await R.store(jwtSecretBean); await R.store(jwtSecretBean);
return jwtSecretBean; return jwtSecretBean;
}; };
/** /**
* Decodes a jwt and returns the payload portion without verifying the jqt. * Decodes a jwt and returns the payload portion without verifying the jwt.
* @param {string} jwt The input jwt as a string * @param {string} jwt The input jwt as a string
* @returns {object} Decoded jwt payload object * @returns {object} Decoded jwt payload object
*/ */
@ -62,15 +67,16 @@ exports.decodeJwt = (jwt) => {
}; };
/** /**
* Gets a Access Token form a oidc/oauth2 provider * Gets an Access Token from an oidc/oauth2 provider
* @param {string} tokenEndpoint The token URI form the auth service provider * @param {string} tokenEndpoint The token URI from the auth service provider
* @param {string} clientId The oidc/oauth application client id * @param {string} clientId The oidc/oauth application client id
* @param {string} clientSecret The oidc/oauth application client secret * @param {string} clientSecret The oidc/oauth application client secret
* @param {string} scope The scope the for which the token should be issued for * @param {string} scope The scope(s) for which the token should be issued for
* @param {string} authMethod The method on how to sent the credentials. Default client_secret_basic * @param {string} audience The audience for which the token should be issued for
* @param {string} authMethod The method used to send the credentials. Default client_secret_basic
* @returns {Promise<oidc.TokenSet>} TokenSet promise if the token request was successful * @returns {Promise<oidc.TokenSet>} TokenSet promise if the token request was successful
*/ */
exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSecret, scope, authMethod = "client_secret_basic") => { exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSecret, scope, audience, authMethod = "client_secret_basic") => {
const oauthProvider = new oidc.Issuer({ token_endpoint: tokenEndpoint }); const oauthProvider = new oidc.Issuer({ token_endpoint: tokenEndpoint });
let client = new oauthProvider.Client({ let client = new oauthProvider.Client({
client_id: clientId, client_id: clientId,
@ -86,6 +92,10 @@ exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSe
if (scope) { if (scope) {
grantParams.scope = scope; grantParams.scope = scope;
} }
if (audience) {
grantParams.audience = audience;
}
return await client.grant(grantParams); return await client.grant(grantParams);
}; };
@ -118,20 +128,33 @@ exports.tcping = function (hostname, port) {
/** /**
* Ping the specified machine * Ping the specified machine
* @param {string} hostname Hostname / address of machine * @param {string} destAddr Hostname / IP address of machine to ping
* @param {number} size Size of packet to send * @param {number} count Number of packets to send before stopping
* @param {string} sourceAddr Source address for sending/receiving echo requests
* @param {boolean} numeric If true, IP addresses will be output instead of symbolic hostnames
* @param {number} size Size (in bytes) of echo request to send
* @param {number} deadline Maximum time in seconds before ping stops, regardless of packets sent
* @param {number} timeout Maximum time in seconds to wait for each response
* @returns {Promise<number>} Time for ping in ms rounded to nearest integer * @returns {Promise<number>} Time for ping in ms rounded to nearest integer
*/ */
exports.ping = async (hostname, size = 56) => { exports.ping = async (
destAddr,
count = PING_COUNT_DEFAULT,
sourceAddr = "",
numeric = true,
size = PING_PACKET_SIZE_DEFAULT,
deadline = PING_GLOBAL_TIMEOUT_DEFAULT,
timeout = PING_PER_REQUEST_TIMEOUT_DEFAULT,
) => {
try { try {
return await exports.pingAsync(hostname, false, size); return await exports.pingAsync(destAddr, false, count, sourceAddr, numeric, size, deadline, timeout);
} catch (e) { } catch (e) {
// If the host cannot be resolved, try again with ipv6 // If the host cannot be resolved, try again with ipv6
log.debug("ping", "IPv6 error message: " + e.message); log.debug("ping", "IPv6 error message: " + e.message);
// As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what. // As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what.
if (!e.message) { if (!e.message) {
return await exports.pingAsync(hostname, true, size); return await exports.pingAsync(destAddr, true, count, sourceAddr, numeric, size, deadline, timeout);
} else { } else {
throw e; throw e;
} }
@ -140,18 +163,35 @@ exports.ping = async (hostname, size = 56) => {
/** /**
* Ping the specified machine * Ping the specified machine
* @param {string} hostname Hostname / address of machine to ping * @param {string} destAddr Hostname / IP address of machine to ping
* @param {boolean} ipv6 Should IPv6 be used? * @param {boolean} ipv6 Should IPv6 be used?
* @param {number} size Size of ping packet to send * @param {number} count Number of packets to send before stopping
* @param {string} sourceAddr Source address for sending/receiving echo requests
* @param {boolean} numeric If true, IP addresses will be output instead of symbolic hostnames
* @param {number} size Size (in bytes) of echo request to send
* @param {number} deadline Maximum time in seconds before ping stops, regardless of packets sent
* @param {number} timeout Maximum time in seconds to wait for each response
* @returns {Promise<number>} Time for ping in ms rounded to nearest integer * @returns {Promise<number>} Time for ping in ms rounded to nearest integer
*/ */
exports.pingAsync = function (hostname, ipv6 = false, size = 56) { exports.pingAsync = function (
destAddr,
ipv6 = false,
count = PING_COUNT_DEFAULT,
sourceAddr = "",
numeric = true,
size = PING_PACKET_SIZE_DEFAULT,
deadline = PING_GLOBAL_TIMEOUT_DEFAULT,
timeout = PING_PER_REQUEST_TIMEOUT_DEFAULT,
) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ping.promise.probe(hostname, { ping.promise.probe(destAddr, {
v6: ipv6, v6: ipv6,
min_reply: 1, min_reply: count,
deadline: 10, sourceAddr: sourceAddr,
numeric: numeric,
packetSize: size, packetSize: size,
deadline: deadline,
timeout: timeout
}).then((res) => { }).then((res) => {
// If ping failed, it will set field to unknown // If ping failed, it will set field to unknown
if (res.alive) { if (res.alive) {
@ -1062,3 +1102,17 @@ module.exports.axiosAbortSignal = (timeoutMs) => {
} }
} }
}; };
/**
* Async version of fs.existsSync
* @param {PathLike} path File path
* @returns {Promise<boolean>} True if file exists, false otherwise
*/
function fsExists(path) {
return new Promise(function (resolve, reject) {
exists(path, function (exists) {
resolve(exists);
});
});
}
module.exports.fsExists = fsExists;

View file

@ -4,9 +4,11 @@
<script> <script>
import { setPageLocale } from "./util-frontend"; import { setPageLocale } from "./util-frontend";
import { polyfillCountryFlagEmojis } from "country-flag-emoji-polyfill";
export default { export default {
created() { created() {
setPageLocale(); setPageLocale();
}, },
}; };
polyfillCountryFlagEmojis();
</script> </script>

View file

@ -3,7 +3,7 @@
@import "node_modules/bootstrap/scss/bootstrap"; @import "node_modules/bootstrap/scss/bootstrap";
#app { #app {
font-family: BlinkMacSystemFont, segoe ui, Roboto, helvetica neue, Arial, noto sans, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji; font-family: "Twemoji Country Flags", BlinkMacSystemFont, segoe ui, Roboto, helvetica neue, Arial, noto sans, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
} }
h1 { h1 {

View file

@ -42,6 +42,9 @@ export default {
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show the confirm dialog * Show the confirm dialog
@ -58,6 +61,19 @@ export default {
this.$emit("added", this.groupName); this.$emit("added", this.groupName);
this.modal.hide(); this.modal.hide();
}, },
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
}, },
}; };
</script> </script>

View file

@ -7,11 +7,17 @@
class="beat-hover-area" class="beat-hover-area"
:class="{ 'empty': (beat === 0) }" :class="{ 'empty': (beat === 0) }"
:style="beatHoverAreaStyle" :style="beatHoverAreaStyle"
:title="getBeatTitle(beat)" :aria-label="getBeatAriaLabel(beat)"
role="status"
tabindex="0"
@mouseenter="showTooltip(beat, $event)"
@mouseleave="hideTooltip"
@focus="showTooltip(beat, $event)"
@blur="hideTooltip"
> >
<div <div
class="beat" class="beat"
:class="{ 'empty': (beat === 0), 'down': (beat.status === 0), 'pending': (beat.status === 2), 'maintenance': (beat.status === 3) }" :class="{ 'empty': (beat === 0 || beat === null || beat.status === null), 'down': (beat.status === DOWN), 'pending': (beat.status === PENDING), 'maintenance': (beat.status === MAINTENANCE) }"
:style="beatStyle" :style="beatStyle"
/> />
</div> </div>
@ -24,13 +30,27 @@
<div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div> <div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div>
<div>{{ timeSinceLastBeat }}</div> <div>{{ timeSinceLastBeat }}</div>
</div> </div>
<!-- Custom Tooltip -->
<Tooltip
:visible="tooltipVisible"
:content="tooltipContent"
:x="tooltipX"
:y="tooltipY"
:position="tooltipPosition"
/>
</div> </div>
</template> </template>
<script> <script>
import dayjs from "dayjs"; import dayjs from "dayjs";
import { DOWN, UP, PENDING, MAINTENANCE } from "../util.ts";
import Tooltip from "./Tooltip.vue";
export default { export default {
components: {
Tooltip,
},
props: { props: {
/** Size of the heartbeat bar */ /** Size of the heartbeat bar */
size: { size: {
@ -46,6 +66,11 @@ export default {
heartbeatList: { heartbeatList: {
type: Array, type: Array,
default: null, default: null,
},
/** Heartbeat bar days */
heartbeatBarDays: {
type: Number,
default: 0
} }
}, },
data() { data() {
@ -56,10 +81,25 @@ export default {
beatHoverAreaPadding: 4, beatHoverAreaPadding: 4,
move: false, move: false,
maxBeat: -1, maxBeat: -1,
// Tooltip data
tooltipVisible: false,
tooltipContent: null,
tooltipX: 0,
tooltipY: 0,
tooltipPosition: "below",
tooltipTimeoutId: null,
}; };
}, },
computed: { computed: {
/**
* Normalized heartbeatBarDays as a number
* @returns {number} Number of days for heartbeat bar
*/
normalizedHeartbeatBarDays() {
return Math.max(0, Math.min(365, Math.floor(this.heartbeatBarDays || 0)));
},
/** /**
* If heartbeatList is null, get it from $root.heartbeatList * If heartbeatList is null, get it from $root.heartbeatList
* @returns {object} Heartbeat list * @returns {object} Heartbeat list
@ -80,6 +120,12 @@ export default {
if (!this.beatList) { if (!this.beatList) {
return 0; return 0;
} }
// For configured ranges, no padding needed since we show all beats
if (this.normalizedHeartbeatBarDays > 0) {
return 0;
}
let num = this.beatList.length - this.maxBeat; let num = this.beatList.length - this.maxBeat;
if (this.move) { if (this.move) {
@ -98,8 +144,20 @@ export default {
return []; return [];
} }
// If heartbeat days is configured (not auto), data is already aggregated from server
if (this.normalizedHeartbeatBarDays > 0 && this.beatList.length > 0) {
// Show all beats from server - they are already properly aggregated
return this.beatList;
}
// Original logic for auto mode (heartbeatBarDays = 0)
let placeholders = []; let placeholders = [];
// Handle case where maxBeat is -1 (no limit)
if (this.maxBeat <= 0) {
return this.beatList;
}
let start = this.beatList.length - this.maxBeat; let start = this.beatList.length - this.maxBeat;
if (this.move) { if (this.move) {
@ -172,13 +230,17 @@ export default {
* @returns {string} The time elapsed in minutes or hours. * @returns {string} The time elapsed in minutes or hours.
*/ */
timeSinceFirstBeat() { timeSinceFirstBeat() {
if (this.normalizedHeartbeatBarDays === 1) {
return (this.normalizedHeartbeatBarDays * 24) + "h";
}
if (this.normalizedHeartbeatBarDays >= 2) {
return this.normalizedHeartbeatBarDays + "d";
}
// Need to calculate from actual data
const firstValidBeat = this.shortBeatList.at(this.numPadding); const firstValidBeat = this.shortBeatList.at(this.numPadding);
const minutes = dayjs().diff(dayjs.utc(firstValidBeat?.time), "minutes"); const minutes = dayjs().diff(dayjs.utc(firstValidBeat?.time), "minutes");
if (minutes > 60) { return minutes > 60 ? Math.floor(minutes / 60) + "h" : minutes + "m";
return (minutes / 60).toFixed(0) + "h";
} else {
return minutes + "m";
}
}, },
/** /**
@ -205,7 +267,7 @@ export default {
}, },
watch: { watch: {
beatList: { beatList: {
handler(val, oldVal) { handler() {
this.move = true; this.move = true;
setTimeout(() => { setTimeout(() => {
@ -217,6 +279,10 @@ export default {
}, },
unmounted() { unmounted() {
window.removeEventListener("resize", this.resize); window.removeEventListener("resize", this.resize);
// Clean up tooltip timeout
if (this.tooltipTimeoutId) {
clearTimeout(this.tooltipTimeoutId);
}
}, },
beforeMount() { beforeMount() {
if (this.heartbeatList === null) { if (this.heartbeatList === null) {
@ -256,7 +322,23 @@ export default {
*/ */
resize() { resize() {
if (this.$refs.wrap) { if (this.$refs.wrap) {
this.maxBeat = Math.floor(this.$refs.wrap.clientWidth / (this.beatWidth + this.beatHoverAreaPadding * 2)); const newMaxBeat = Math.floor(this.$refs.wrap.clientWidth / (this.beatWidth + this.beatHoverAreaPadding * 2));
// If maxBeat changed and we're in configured days mode, notify parent to reload data
if (newMaxBeat !== this.maxBeat && this.normalizedHeartbeatBarDays > 0) {
this.maxBeat = newMaxBeat;
// Find the closest parent with reloadHeartbeatData method (StatusPage)
let parent = this.$parent;
while (parent && !parent.reloadHeartbeatData) {
parent = parent.$parent;
}
if (parent && parent.reloadHeartbeatData) {
parent.reloadHeartbeatData(newMaxBeat);
}
} else {
this.maxBeat = newMaxBeat;
}
} }
}, },
@ -267,7 +349,105 @@ export default {
* @returns {string} Beat title * @returns {string} Beat title
*/ */
getBeatTitle(beat) { getBeatTitle(beat) {
return `${this.$root.datetime(beat.time)}` + ((beat.msg) ? ` - ${beat.msg}` : ""); if (!beat) {
return "";
}
// Show timestamp for all beats (both individual and aggregated)
return `${this.$root.datetime(beat.time)}${beat.msg ? ` - ${beat.msg}` : ""}`;
},
/**
* Get the aria-label for accessibility
* @param {object} beat Beat to get aria-label from
* @returns {string} Aria label
*/
getBeatAriaLabel(beat) {
switch (beat?.status) {
case DOWN:
return `Down at ${this.$root.datetime(beat.time)}`;
case UP:
return `Up at ${this.$root.datetime(beat.time)}`;
case PENDING:
return `Pending at ${this.$root.datetime(beat.time)}`;
case MAINTENANCE:
return `Maintenance at ${this.$root.datetime(beat.time)}`;
default:
return "No data";
}
},
/**
* Show custom tooltip
* @param {object} beat Beat data
* @param {Event} event Mouse event
* @returns {void}
*/
showTooltip(beat, event) {
if (beat === 0 || !beat) {
this.hideTooltip();
return;
}
// Clear any existing timeout
if (this.tooltipTimeoutId) {
clearTimeout(this.tooltipTimeoutId);
}
// Small delay for better UX
this.tooltipTimeoutId = setTimeout(() => {
this.tooltipContent = beat;
// Calculate position relative to viewport
const rect = event.target.getBoundingClientRect();
// Position relative to viewport
const x = rect.left + (rect.width / 2);
const y = rect.top;
// Check if tooltip would go off-screen and adjust position
const tooltipHeight = 80; // Approximate tooltip height
const viewportHeight = window.innerHeight;
const spaceAbove = y;
const spaceBelow = viewportHeight - y - rect.height;
if (spaceAbove > tooltipHeight && spaceBelow < tooltipHeight) {
// Show above - arrow points down
this.tooltipPosition = "above";
this.tooltipY = y - 10;
} else {
// Show below - arrow points up
this.tooltipPosition = "below";
this.tooltipY = y + rect.height + 10;
}
// Ensure tooltip doesn't go off the left or right edge
const tooltipWidth = 120; // Approximate tooltip width
let adjustedX = x;
if ((x - tooltipWidth / 2) < 10) {
adjustedX = tooltipWidth / 2 + 10;
} else if ((x + tooltipWidth / 2) > (window.innerWidth - 10)) {
adjustedX = window.innerWidth - tooltipWidth / 2 - 10;
}
this.tooltipX = adjustedX;
this.tooltipVisible = true;
}, 150);
},
/**
* Hide custom tooltip
* @returns {void}
*/
hideTooltip() {
if (this.tooltipTimeoutId) {
clearTimeout(this.tooltipTimeoutId);
this.tooltipTimeoutId = null;
}
this.tooltipVisible = false;
this.tooltipContent = null;
}, },
}, },

View file

@ -14,7 +14,7 @@
<router-link :to="monitorURL(monitor.id)" class="item" :class="{ 'disabled': ! monitor.active }"> <router-link :to="monitorURL(monitor.id)" class="item" :class="{ 'disabled': ! monitor.active }">
<div class="row"> <div class="row">
<div class="col-9 col-md-8 small-padding" :class="{ 'monitor-item': $root.userHeartbeatBar == 'bottom' || $root.userHeartbeatBar == 'none' }"> <div class="col-6 small-padding" :class="{ 'monitor-item': $root.userHeartbeatBar == 'bottom' || $root.userHeartbeatBar == 'none' }">
<div class="info"> <div class="info">
<Uptime :monitor="monitor" type="24" :pill="true" /> <Uptime :monitor="monitor" type="24" :pill="true" />
<span v-if="hasChildren" class="collapse-padding" @click.prevent="changeCollapsed"> <span v-if="hasChildren" class="collapse-padding" @click.prevent="changeCollapsed">
@ -22,11 +22,11 @@
</span> </span>
{{ monitor.name }} {{ monitor.name }}
</div> </div>
<div v-if="monitor.tags.length > 0" class="tags"> <div v-if="monitor.tags.length > 0" class="tags gap-1">
<Tag v-for="tag in monitor.tags" :key="tag" :item="tag" :size="'sm'" /> <Tag v-for="tag in monitor.tags" :key="tag" :item="tag" :size="'sm'" />
</div> </div>
</div> </div>
<div v-show="$root.userHeartbeatBar == 'normal'" :key="$root.userHeartbeatBar" class="col-3 col-md-4"> <div v-show="$root.userHeartbeatBar == 'normal'" :key="$root.userHeartbeatBar" class="col-6">
<HeartbeatBar ref="heartbeatBar" size="small" :monitor-id="monitor.id" /> <HeartbeatBar ref="heartbeatBar" size="small" :monitor-id="monitor.id" />
</div> </div>
</div> </div>

View file

@ -10,7 +10,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="my-3 form-check"> <div class="my-3 form-check">
<input id="show-clickable-link" v-model="monitor.isClickAble" class="form-check-input" type="checkbox" @click="toggleLink(monitor.group_index, monitor.monitor_index)" /> <input id="show-clickable-link" v-model="monitor.isClickAble" class="form-check-input" type="checkbox" data-testid="show-clickable-link" @click="toggleLink(monitor.group_index, monitor.monitor_index)" />
<label class="form-check-label" for="show-clickable-link"> <label class="form-check-label" for="show-clickable-link">
{{ $t("Show Clickable Link") }} {{ $t("Show Clickable Link") }}
</label> </label>
@ -19,6 +19,16 @@
</div> </div>
</div> </div>
<!-- Custom URL -->
<template v-if="monitor.isClickAble">
<label for="customUrl" class="form-label">{{ $t("Custom URL") }}</label>
<input id="customUrl" :value="monitor.url" type="url" class="form-control" data-testid="custom-url-input" @input="e => changeUrl(monitor.group_index, monitor.monitor_index, e.target!.value)">
<div class="form-text mb-3">
{{ $t("customUrlDescription") }}
</div>
</template>
<button <button
class="btn btn-primary btn-add-group me-2" class="btn btn-primary btn-add-group me-2"
@click="$refs.badgeGeneratorDialog.show(monitor.id, monitor.name)" @click="$refs.badgeGeneratorDialog.show(monitor.id, monitor.name)"
@ -29,7 +39,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-danger" data-bs-dismiss="modal"> <button type="submit" class="btn btn-danger" data-bs-dismiss="modal" data-testid="monitor-settings-close">
{{ $t("Close") }} {{ $t("Close") }}
</button> </button>
</div> </div>
@ -78,6 +88,7 @@ export default {
monitor_index: monitor.index, monitor_index: monitor.index,
group_index: group.index, group_index: group.index,
isClickAble: this.showLink(monitor), isClickAble: this.showLink(monitor),
url: monitor.element.url,
}; };
this.MonitorSettingDialog.show(); this.MonitorSettingDialog.show();
@ -110,6 +121,17 @@ export default {
} }
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode; return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode;
}, },
/**
* Toggle the value of sendUrl
* @param {number} groupIndex Index of group monitor is member of
* @param {number} index Index of monitor within group
* @param {string} value The new value of the url
* @returns {void}
*/
changeUrl(groupIndex, index, value) {
this.$root.publicGroupList[groupIndex].monitorList[index].url = value;
},
}, },
}; };
</script> </script>

View file

@ -135,11 +135,13 @@ export default {
"nostr": "Nostr", "nostr": "Nostr",
"ntfy": "Ntfy", "ntfy": "Ntfy",
"octopush": "Octopush", "octopush": "Octopush",
"OneChat": "OneChat",
"OneBot": "OneBot", "OneBot": "OneBot",
"Onesender": "Onesender", "Onesender": "Onesender",
"Opsgenie": "Opsgenie", "Opsgenie": "Opsgenie",
"PagerDuty": "PagerDuty", "PagerDuty": "PagerDuty",
"PagerTree": "PagerTree", "PagerTree": "PagerTree",
"pumble": "Pumble",
"pushbullet": "Pushbullet", "pushbullet": "Pushbullet",
"PushByTechulus": "Push by Techulus", "PushByTechulus": "Push by Techulus",
"pushover": "Pushover", "pushover": "Pushover",
@ -166,7 +168,8 @@ export default {
"waha": "WhatsApp (WAHA)", "waha": "WhatsApp (WAHA)",
"gtxmessaging": "GtxMessaging", "gtxmessaging": "GtxMessaging",
"Cellsynt": "Cellsynt", "Cellsynt": "Cellsynt",
"SendGrid": "SendGrid" "SendGrid": "SendGrid",
"notifery": "Notifery"
}; };
// Put notifications here if it's not supported in most regions or its documentation is not in English // Put notifications here if it's not supported in most regions or its documentation is not in English
@ -183,9 +186,11 @@ export default {
"WeCom": "WeCom (企业微信群机器人)", "WeCom": "WeCom (企业微信群机器人)",
"ServerChan": "ServerChan (Server酱)", "ServerChan": "ServerChan (Server酱)",
"PushPlus": "PushPlus (推送加)", "PushPlus": "PushPlus (推送加)",
"SpugPush": "SpugPushSpug推送助手",
"smsc": "SMSC", "smsc": "SMSC",
"WPush": "WPush(wpush.cn)", "WPush": "WPush(wpush.cn)",
"YZJ": "YZJ (云之家自定义机器人)" "YZJ": "YZJ (云之家自定义机器人)",
"SMSPlanet": "SMSPlanet.pl"
}; };
// Sort by notification name // Sort by notification name
@ -235,6 +240,9 @@ export default {
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
@ -339,6 +347,20 @@ export default {
}); });
} while (this.$root.notificationList.find(it => it.name === name)); } while (this.$root.notificationList.find(it => it.name === name));
return name; return name;
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
} }
}, },
}; };

View file

@ -125,11 +125,12 @@ export default {
} }
}; };
}, },
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show dialog to confirm deletion * Show dialog to confirm deletion
@ -173,6 +174,38 @@ export default {
this.modal.show(); this.modal.show();
}, },
/**
* Show dialog to clone a proxy
* @param {number} proxyID ID of proxy to clone
* @returns {void}
*/
showClone(proxyID) {
if (proxyID) {
for (let proxy of this.$root.proxyList) {
if (proxy.id === proxyID) {
// Create a clone of the proxy data
this.proxy = {
protocol: proxy.protocol,
host: proxy.host,
port: proxy.port,
auth: proxy.auth,
username: proxy.username,
password: proxy.password,
active: proxy.active,
default: false, // Cloned proxy should not be default
applyExisting: false,
};
break;
}
}
}
// Set id to null to indicate this is a new proxy (clone)
this.id = null;
this.modal.show();
},
/** /**
* Submit form data for saving * Submit form data for saving
* @returns {void} * @returns {void}
@ -209,6 +242,20 @@ export default {
} }
}); });
}, },
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
}, },
}; };
</script> </script>

View file

@ -33,7 +33,7 @@
<template #item="monitor"> <template #item="monitor">
<div class="item" data-testid="monitor"> <div class="item" data-testid="monitor">
<div class="row"> <div class="row">
<div class="col-9 col-md-8 small-padding"> <div class="col-6 small-padding">
<div class="info"> <div class="info">
<font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" /> <font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" />
<font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" /> <font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" />
@ -58,6 +58,7 @@
v-if="editMode" v-if="editMode"
:class="{'link-active': true, 'btn-link': true}" :class="{'link-active': true, 'btn-link': true}"
icon="cog" class="action me-3" icon="cog" class="action me-3"
data-testid="monitor-settings"
@click="$refs.monitorSettingDialog.show(group, monitor)" @click="$refs.monitorSettingDialog.show(group, monitor)"
/> />
</span> </span>
@ -71,7 +72,7 @@
</div> </div>
</div> </div>
</div> </div>
<div :key="$root.userHeartbeatBar" class="col-3 col-md-4"> <div :key="$root.userHeartbeatBar" class="col-6">
<HeartbeatBar size="mid" :monitor-id="monitor.element.id" /> <HeartbeatBar size="mid" :monitor-id="monitor.element.id" />
</div> </div>
</div> </div>

View file

@ -6,7 +6,6 @@
'm-2': size == 'normal', 'm-2': size == 'normal',
'px-2': size == 'sm', 'px-2': size == 'sm',
'py-0': size == 'sm', 'py-0': size == 'sm',
'mx-1': size == 'sm',
}" }"
:style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }" :style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }"
> >
@ -48,7 +47,7 @@ export default {
}, },
computed: { computed: {
displayText() { displayText() {
if (this.item.value === "" || this.item.value === undefined) { if (this.item.value === "" || this.item.value === undefined || this.item.value === null) {
return this.item.name; return this.item.name;
} else { } else {
return `${this.item.name}: ${this.item.value}`; return `${this.item.name}: ${this.item.value}`;

View file

@ -4,7 +4,7 @@
<div v-if="selectedTags.length > 0" class="mb-2 p-1"> <div v-if="selectedTags.length > 0" class="mb-2 p-1">
<tag <tag
v-for="item in selectedTags" v-for="item in selectedTags"
:key="item.id" :key="`${item.tag_id || item.id}-${item.value || ''}`"
:item="item" :item="item"
:remove="deleteTag" :remove="deleteTag"
/> />
@ -20,10 +20,20 @@
<font-awesome-icon class="me-1" icon="plus" /> {{ $t("Add") }} <font-awesome-icon class="me-1" icon="plus" /> {{ $t("Add") }}
</button> </button>
</div> </div>
<div ref="modal" class="modal fade" tabindex="-1"> <div ref="modal" class="modal fade" tabindex="-1" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
<h4 v-if="stagedForBatchAdd.length > 0">{{ $t("Add Tags") }}</h4>
<div v-if="stagedForBatchAdd.length > 0" class="mb-3 staging-area" style="max-height: 150px; overflow-y: auto;">
<Tag
v-for="stagedTag in stagedForBatchAdd"
:key="stagedTag.keyForList"
:item="mapStagedTagToDisplayItem(stagedTag)"
:remove="() => unstageTag(stagedTag)"
/>
</div>
<vue-multiselect <vue-multiselect
v-model="newDraftTag.select" v-model="newDraftTag.select"
class="mb-2" class="mb-2"
@ -58,14 +68,11 @@
<div class="w-50 pe-2"> <div class="w-50 pe-2">
<input <input
v-model="newDraftTag.name" class="form-control" v-model="newDraftTag.name" class="form-control"
:class="{'is-invalid': validateDraftTag.nameInvalid}" :class="{'is-invalid': validateDraftTag.invalid && (validateDraftTag.messageKey === 'tagNameColorRequired' || validateDraftTag.messageKey === 'tagNameExists')}"
:placeholder="$t('Name')" :placeholder="$t('Name')"
data-testid="tag-name-input" data-testid="tag-name-input"
@keydown.enter.prevent="onEnter" @keydown.enter.prevent="onEnter"
/> />
<div class="invalid-feedback">
{{ $t("Tag with this name already exist.") }}
</div>
</div> </div>
<div class="w-50 ps-2"> <div class="w-50 ps-2">
<vue-multiselect <vue-multiselect
@ -104,27 +111,24 @@
<div class="mb-2"> <div class="mb-2">
<input <input
v-model="newDraftTag.value" class="form-control" v-model="newDraftTag.value" class="form-control"
:class="{'is-invalid': validateDraftTag.valueInvalid}" :class="{'is-invalid': validateDraftTag.invalid && validateDraftTag.messageKey === 'tagAlreadyOnMonitor'}"
:placeholder="$t('value (optional)')" :placeholder="$t('value (optional)')"
data-testid="tag-value-input" data-testid="tag-value-input"
@keydown.enter.prevent="onEnter" @keydown.enter.prevent="onEnter"
/> />
<div class="invalid-feedback">
{{ $t("Tag with this value already exist.") }}
</div>
</div> </div>
<div class="mb-2">
<button <div v-if="validateDraftTag.invalid && validateDraftTag.messageKey" class="form-text text-danger mb-2">
type="button" {{ $t(validateDraftTag.messageKey, validateDraftTag.messageParams) }}
class="btn btn-secondary float-end"
:disabled="processing || validateDraftTag.invalid"
data-testid="tag-submit-button"
@click.stop="addDraftTag"
>
{{ $t("Add") }}
</button>
</div> </div>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click.stop="clearStagingAndCloseModal">{{ $t("Cancel") }}</button>
<button type="button" class="btn btn-outline-primary me-2" :disabled="processing || validateDraftTag.invalid" @click.stop="stageCurrentTag">
{{ $t("Add Another Tag") }}
</button>
<button type="button" class="btn btn-primary" :disabled="processing || (stagedForBatchAdd.length === 0 && validateDraftTag.invalid)" data-testid="add-tags-final-button" @click.stop="confirmAndCommitStagedTags">{{ $t("Done") }}</button>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -176,71 +180,146 @@ export default {
newTags: [], newTags: [],
/** @type {Tag[]} */ /** @type {Tag[]} */
deleteTags: [], deleteTags: [],
/**
* @type {Array<object>} Holds tag objects staged for addition.
* Each object: { name, color, value, isNewSystemTag, systemTagId, keyForList }
*/
stagedForBatchAdd: [],
newDraftTag: { newDraftTag: {
name: null, name: null,
select: null, select: null,
color: null, color: null,
value: "", value: "",
invalid: true,
nameInvalid: false,
}, },
}; };
}, },
computed: { computed: {
tagOptions() { tagOptions() {
const tagOptions = this.existingTags; const tagOptions = [ ...this.existingTags ]; // Create a copy
// Add tags from newTags
for (const tag of this.newTags) { for (const tag of this.newTags) {
if (!tagOptions.find(t => t.name === tag.name && t.color === tag.color)) { if (!tagOptions.find(t => t.name === tag.name && t.color === tag.color)) {
tagOptions.push(tag); tagOptions.push(tag);
} }
} }
// Add newly created system tags from staging area
for (const stagedTag of this.stagedForBatchAdd) {
if (stagedTag.isNewSystemTag) {
// Check if this system tag is already in the options
if (!tagOptions.find(t => t.name === stagedTag.name && t.color === stagedTag.color)) {
// Create a tag option object for the dropdown
tagOptions.push({
id: null, // Will be assigned when actually created
name: stagedTag.name,
color: stagedTag.color
});
}
}
}
return tagOptions; return tagOptions;
}, },
selectedTags() { selectedTags() {
return this.preSelectedTags.concat(this.newTags).filter(tag => !this.deleteTags.find(monitorTag => monitorTag.tag_id === tag.tag_id)); // Helper function to normalize tag values for comparison
const normalizeValue = (value) => {
if (value === null || value === undefined) {
return "";
}
return String(value).trim();
};
// Helper function to get tag ID from different structures
const getTagId = (tag) => tag.tag_id || tag.id;
return this.preSelectedTags.concat(this.newTags).filter(tag =>
!this.deleteTags.find(monitorTag => {
const tagIdMatch = getTagId(monitorTag) === getTagId(tag);
const valueMatch = normalizeValue(monitorTag.value) === normalizeValue(tag.value);
return tagIdMatch && valueMatch;
})
);
}, },
/**
* @returns {boolean} True if more new system tags can be staged, false otherwise.
*/
canStageMoreNewSystemTags() {
return true; // Always allow adding more tags, no limit
},
/**
* Provides the color options for the tag color selector.
* @returns {Array<object>} Array of color options.
*/
colorOptions() { colorOptions() {
return colorOptions(this); return colorOptions(this);
}, },
/**
* Validates the current draft tag based on several conditions.
* @returns {{invalid: boolean, messageKey: string|null, messageParams: object|null}} Object indicating validity, and a message key/params if invalid.
*/
validateDraftTag() { validateDraftTag() {
let nameInvalid = false; // If defining a new system tag (newDraftTag.select == null)
let valueInvalid = false; if (this.newDraftTag.select == null) {
let invalid = true; if (!this.newDraftTag.name || this.newDraftTag.name.trim() === "" || !this.newDraftTag.color) {
if (this.deleteTags.find(tag => tag.name === this.newDraftTag.select?.name && tag.value === this.newDraftTag.value)) { // Keep button disabled, but don't show the explicit message for this case
// Undo removing a Tag return {
nameInvalid = false; invalid: true,
valueInvalid = false; messageKey: null,
invalid = false; messageParams: null,
} else if (this.existingTags.filter(tag => tag.name === this.newDraftTag.name).length > 0 && this.newDraftTag.select == null) { };
// Try to create new tag with existing name }
nameInvalid = true; if (this.tagOptions.find(opt => opt.name.toLowerCase() === this.newDraftTag.name.trim().toLowerCase())) {
invalid = true; return {
} else if (this.newTags.concat(this.preSelectedTags).filter(tag => ( invalid: true,
tag.name === this.newDraftTag.select?.name && tag.value === this.newDraftTag.value messageKey: "tagNameExists",
) || ( messageParams: null,
tag.name === this.newDraftTag.name && tag.value === this.newDraftTag.value };
)).length > 0) { }
// Try to add a tag with existing name and value
valueInvalid = true;
invalid = true;
} else if (this.newDraftTag.select != null) {
// Select an existing tag, no need to validate
invalid = false;
valueInvalid = false;
} else if (this.newDraftTag.color == null || this.newDraftTag.name === "") {
// Missing form inputs
nameInvalid = false;
invalid = true;
} else {
// Looks valid
invalid = false;
nameInvalid = false;
valueInvalid = false;
} }
// For any tag definition (new or existing system tag + value)
const draftTagName = this.newDraftTag.select ? this.newDraftTag.select.name : this.newDraftTag.name.trim();
const draftTagValue = this.newDraftTag.value ? this.newDraftTag.value.trim() : ""; // Treat null/undefined value as empty string for comparison
// Check if (name + value) combination already exists in this.stagedForBatchAdd
if (this.stagedForBatchAdd.find(staged => staged.name === draftTagName && staged.value === draftTagValue)) {
return {
invalid: true,
messageKey: "tagAlreadyStaged",
messageParams: null,
};
}
// Check if (name + value) combination already exists in this.selectedTags (final list on monitor)
// AND it's NOT an "undo delete"
const isUndoDelete = this.deleteTags.find(dTag =>
dTag.tag_id === (this.newDraftTag.select ? this.newDraftTag.select.id : null) &&
dTag.value === draftTagValue
);
if (!isUndoDelete && this.selectedTags.find(sTag => sTag.name === draftTagName && sTag.value === draftTagValue)) {
return {
invalid: true,
messageKey: "tagAlreadyOnMonitor",
messageParams: null,
};
}
// If an existing tag is selected at this point, it has passed all relevant checks
if (this.newDraftTag.select != null) {
return {
invalid: false,
messageKey: null,
messageParams: null,
};
}
// If it's a new tag definition, and it passed its specific checks, it's valid.
// (This also serves as a final default to valid if other logic paths were missed, though ideally covered above)
return { return {
invalid, invalid: false,
nameInvalid, messageKey: null,
valueInvalid, messageParams: null,
}; };
}, },
}, },
@ -248,12 +327,18 @@ export default {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
this.getExistingTags(); this.getExistingTags();
}, },
beforeUnmount() {
this.cleanupModal();
},
methods: { methods: {
/** /**
* Show the add tag dialog * Show the add tag dialog
* @returns {void} * @returns {void}
*/ */
showAddDialog() { showAddDialog() {
this.stagedForBatchAdd = [];
this.clearDraftTag();
this.getExistingTags();
this.modal.show(); this.modal.show();
}, },
/** /**
@ -297,37 +382,6 @@ export default {
return this.$root.theme === "light" ? "var(--bs-body-color)" : "inherit"; return this.$root.theme === "light" ? "var(--bs-body-color)" : "inherit";
} }
}, },
/**
* Add a draft tag
* @returns {void}
*/
addDraftTag() {
console.log("Adding Draft Tag: ", this.newDraftTag);
if (this.newDraftTag.select != null) {
if (this.deleteTags.find(tag => tag.name === this.newDraftTag.select.name && tag.value === this.newDraftTag.value)) {
// Undo removing a tag
this.deleteTags = this.deleteTags.filter(tag => !(tag.name === this.newDraftTag.select.name && tag.value === this.newDraftTag.value));
} else {
// Add an existing Tag
this.newTags.push({
id: this.newDraftTag.select.id,
color: this.newDraftTag.select.color,
name: this.newDraftTag.select.name,
value: this.newDraftTag.value,
new: true,
});
}
} else {
// Add new Tag
this.newTags.push({
color: this.newDraftTag.color.color,
name: this.newDraftTag.name.trim(),
value: this.newDraftTag.value,
new: true,
});
}
this.clearDraftTag();
},
/** /**
* Remove a draft tag * Remove a draft tag
* @returns {void} * @returns {void}
@ -338,10 +392,8 @@ export default {
select: null, select: null,
color: null, color: null,
value: "", value: "",
invalid: true, // invalid: true, // Initial validation will be handled by computed prop
nameInvalid: false,
}; };
this.modal.hide();
}, },
/** /**
* Add a tag asynchronously * Add a tag asynchronously
@ -383,7 +435,7 @@ export default {
*/ */
onEnter() { onEnter() {
if (!this.validateDraftTag.invalid) { if (!this.validateDraftTag.invalid) {
this.addDraftTag(); this.stageCurrentTag();
} }
}, },
/** /**
@ -459,7 +511,132 @@ export default {
this.newTags = []; this.newTags = [];
this.deleteTags = []; this.deleteTags = [];
this.processing = false; this.processing = false;
} },
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
this.stagedForBatchAdd = [];
},
/**
* Stages the current draft tag for batch addition.
* @returns {void}
*/
stageCurrentTag() {
if (this.validateDraftTag.invalid) {
return;
}
const isNew = this.newDraftTag.select == null;
const name = isNew ? this.newDraftTag.name.trim() : this.newDraftTag.select.name;
const color = isNew ? this.newDraftTag.color.color : this.newDraftTag.select.color;
const value = this.newDraftTag.value ? this.newDraftTag.value.trim() : "";
const stagedTagObject = {
name: name,
color: color,
value: value,
isNewSystemTag: isNew,
systemTagId: isNew ? null : this.newDraftTag.select.id,
keyForList: `staged-${Date.now()}-${Math.random().toString(36).substring(2, 15)}` // Unique key
};
this.stagedForBatchAdd.push(stagedTagObject);
this.clearDraftTag(); // Reset input fields for the next tag
},
/**
* Removes a tag from the staged list.
* @param {object} tagToUnstage The tag object to remove from staging.
* @returns {void}
*/
unstageTag(tagToUnstage) {
this.stagedForBatchAdd = this.stagedForBatchAdd.filter(tag => tag.keyForList !== tagToUnstage.keyForList);
},
/**
* Maps a staged tag object to the structure expected by the Tag component.
* @param {object} stagedTag The staged tag object.
* @returns {object} Object with name, color, value for the Tag component.
*/
mapStagedTagToDisplayItem(stagedTag) {
return {
name: stagedTag.name,
color: stagedTag.color,
value: stagedTag.value,
// id: stagedTag.keyForList, // Pass keyForList as id for the Tag component if it expects an id for display/keying internally beyond v-for key
};
},
/**
* Clears the staging list, draft inputs, and closes the modal.
* @returns {void}
*/
clearStagingAndCloseModal() {
this.stagedForBatchAdd = [];
this.clearDraftTag(); // Clears input fields
this.modal.hide();
},
/**
* Processes all staged tags, adds them to the monitor, and closes the modal.
* @returns {void}
*/
confirmAndCommitStagedTags() {
// Phase 1: If there's a currently valid newDraftTag that hasn't been staged yet,
// (e.g. user typed a full tag and directly clicked the footer "Add"), then stage it now.
// stageCurrentTag has its own check for validateDraftTag.invalid and will clear the draft.
if (!this.validateDraftTag.invalid) {
// Check if newDraftTag actually has content, to avoid staging an empty cleared draft.
// A valid draft implies it has content, but double-checking select or name is safer.
if (this.newDraftTag.select || (this.newDraftTag.name && this.newDraftTag.color)) {
this.stageCurrentTag();
}
}
// Phase 2: Process everything that is now in stagedForBatchAdd.
if (this.stagedForBatchAdd.length === 0) {
this.clearDraftTag(); // Ensure draft is clear even if nothing was committed
this.modal.hide();
return;
}
for (const sTag of this.stagedForBatchAdd) {
let isAnUndo = false; // Flag to track if this was an undo
// Check if it's an "undo delete"
if (sTag.systemTagId) { // Only existing system tags can be an undo delete
const undoDeleteIndex = this.deleteTags.findIndex(
dTag => dTag.tag_id === sTag.systemTagId && dTag.value === sTag.value
);
if (undoDeleteIndex > -1) {
this.deleteTags.splice(undoDeleteIndex, 1);
isAnUndo = true;
}
}
// Only add to newTags if it's not an "undo delete" operation.
// An "undo delete" means the tag is now considered active again from its previous state.
if (!isAnUndo) {
const tagObjectForNewTags = {
id: sTag.systemTagId, // This will be null for brand new system tags
color: sTag.color,
name: sTag.name,
value: sTag.value,
new: true, // As per plan, signals new to this monitor transaction
};
this.newTags.push(tagObjectForNewTags);
}
}
// newDraftTag should have been cleared if stageCurrentTag ran in Phase 1, or earlier.
// Call clearDraftTag again to be certain the form is reset before closing.
this.clearDraftTag();
this.modal.hide();
},
}, },
}; };
</script> </script>

276
src/components/Tooltip.vue Normal file
View file

@ -0,0 +1,276 @@
<template>
<teleport to="body">
<div
v-if="content"
ref="tooltip"
class="tooltip-wrapper"
:style="tooltipStyle"
:class="{ 'tooltip-above': position === 'above' }"
>
<div class="tooltip-content">
<slot :content="content">
<!-- Default content if no slot provided -->
<div class="tooltip-status" :class="statusClass">
{{ statusText }}
</div>
<div class="tooltip-time">{{ timeText }}</div>
<div v-if="content?.msg" class="tooltip-message">{{ content.msg }}</div>
</slot>
</div>
<div class="tooltip-arrow" :class="{ 'arrow-above': position === 'above' }"></div>
</div>
</teleport>
</template>
<script>
import { DOWN, UP, PENDING, MAINTENANCE } from "../util.ts";
export default {
name: "Tooltip",
props: {
/** Whether tooltip is visible */
visible: {
type: Boolean,
default: false
},
/** Content object to display */
content: {
type: Object,
default: null
},
/** X position (viewport coordinates) */
x: {
type: Number,
default: 0
},
/** Y position (viewport coordinates) */
y: {
type: Number,
default: 0
},
/** Position relative to target element */
position: {
type: String,
default: "below",
validator: (value) => [ "above", "below" ].includes(value)
}
},
computed: {
tooltipStyle() {
return {
left: this.x + "px",
top: this.y + "px",
};
},
statusText() {
if (!this.content || this.content === 0) {
return this.$t("Unknown");
}
switch (this.content.status) {
case DOWN:
return this.$t("Down");
case UP:
return this.$t("Up");
case PENDING:
return this.$t("Pending");
case MAINTENANCE:
return this.$t("Maintenance");
default:
return this.$t("Unknown");
}
},
statusClass() {
if (!this.content || this.content === 0) {
return "status-empty";
}
switch (this.content.status) {
case DOWN:
return "status-down";
case UP:
return "status-up";
case PENDING:
return "status-pending";
case MAINTENANCE:
return "status-maintenance";
default:
return "status-unknown";
}
},
timeText() {
if (!this.content || this.content === 0) {
return "";
}
return this.$root.datetime(this.content.time);
},
}
};
</script>
<style lang="scss" scoped>
@import "../assets/vars.scss";
.tooltip-wrapper {
position: fixed;
z-index: 9999;
pointer-events: none;
transform: translateX(-50%);
.tooltip-content {
background: rgba(17, 24, 39, 0.95);
backdrop-filter: blur(8px);
border: 1px solid rgba(75, 85, 99, 0.3);
border-radius: 8px;
padding: 8px 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
min-width: 120px;
text-align: center;
position: relative;
&::before {
content: "";
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 14px;
height: 2px;
background: rgba(17, 24, 39, 0.95);
top: -1px;
}
.tooltip-status {
font-size: 16px;
font-weight: 600;
margin-bottom: 4px;
text-transform: uppercase;
letter-spacing: 0.5px;
&.status-up {
color: $primary;
}
&.status-down {
color: $danger;
}
&.status-pending {
color: $warning;
}
&.status-maintenance {
color: $maintenance;
}
&.status-empty {
color: $secondary-text;
}
}
.tooltip-time {
color: #d1d5db;
font-size: 13px;
margin-bottom: 2px;
}
.tooltip-message {
color: #f3f4f6;
font-size: 12px;
margin-top: 4px;
padding-top: 4px;
border-top: 1px solid rgba(75, 85, 99, 0.3);
}
}
.tooltip-arrow {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 12px;
height: 6px;
overflow: hidden;
top: -6px;
&::before {
content: "";
position: absolute;
left: 50%;
top: 100%;
transform: translateX(-50%) translateY(-50%) rotate(45deg);
width: 8px;
height: 8px;
background: rgba(17, 24, 39, 0.95);
border: 1px solid rgba(75, 85, 99, 0.3);
border-bottom: none;
border-right: none;
}
&.arrow-above {
top: auto;
bottom: -6px;
&::before {
top: 0%;
transform: translateX(-50%) translateY(-50%) rotate(225deg);
border: 1px solid rgba(75, 85, 99, 0.3);
border-bottom: none;
border-right: none;
}
}
}
// Smooth entrance animation
animation: tooltip-fade-in 0.2s $easing-out;
&.tooltip-above {
transform: translateX(-50%) translateY(-8px);
.tooltip-content::before {
top: auto;
bottom: -1px;
}
}
}
// Dark theme adjustments
.dark .tooltip-wrapper {
.tooltip-content {
background: rgba(31, 41, 55, 0.95);
border-color: rgba(107, 114, 128, 0.3);
&::before {
background: rgba(31, 41, 55, 0.95);
}
}
.tooltip-arrow {
&::before {
background: rgba(31, 41, 55, 0.95);
border-color: rgba(107, 114, 128, 0.3);
}
}
}
@keyframes tooltip-fade-in {
from {
opacity: 0;
transform: translateX(-50%) translateY(4px);
}
to {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
}
// Accessibility improvements
@media (prefers-reduced-motion: reduce) {
.tooltip-wrapper {
animation: none !important;
}
}
</style>

View file

@ -53,6 +53,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="mb-3">
<div class="form-check form-switch">
<input id="discord-disable-url" v-model="$parent.notification.disableUrl" class="form-check-input" type="checkbox" role="switch">
<label class="form-check-label" for="discord-disable-url">{{ $t("Disable URL in Notification") }}</label>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
@ -60,6 +67,9 @@ export default {
if (!this.$parent.notification.discordChannelType) { if (!this.$parent.notification.discordChannelType) {
this.$parent.notification.discordChannelType = "channel"; this.$parent.notification.discordChannelType = "channel";
} }
if (this.$parent.notification.disableUrl === undefined) {
this.$parent.notification.disableUrl = false;
}
} }
}; };
</script> </script>

View file

@ -1,7 +1,10 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="flashduty-integration-url" class="form-label">Integration Key</label> <label for="flashduty-integration-url" class="form-label">{{ $t("FlashDuty Push URL") }} <span style="color: red;"><sup>*</sup></span></label>
<HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false"></HiddenInput> <HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false" :placeholder="$t('FlashDuty Push URL Placeholder')" />
<div class="form-text">
<p><span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}</p>
</div>
<i18n-t tag="div" keypath="wayToGetFlashDutyKey" class="form-text"> <i18n-t tag="div" keypath="wayToGetFlashDutyKey" class="form-text">
<a href="https://flashcat.cloud/product/flashduty?from=kuma" target="_blank">{{ $t("here") }}</a> <a href="https://flashcat.cloud/product/flashduty?from=kuma" target="_blank">{{ $t("here") }}</a>
</i18n-t> </i18n-t>
@ -18,7 +21,6 @@
<script> <script>
import HiddenInput from "../HiddenInput.vue"; import HiddenInput from "../HiddenInput.vue";
export default { export default {
components: { components: {
HiddenInput, HiddenInput,

View file

@ -18,7 +18,7 @@
{{ $t("matrixDesc1") }} {{ $t("matrixDesc1") }}
</p> </p>
<i18n-t tag="p" keypath="matrixDesc2" style="margin-top: 8px;"> <i18n-t tag="p" keypath="matrixDesc2" style="margin-top: 8px;">
<code>curl -XPOST -d '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/r0/login"</code>. <code>curl -XPOST --json '{"type": "m.login.password", "identifier": {"user": "botusername", "type": "m.id.user"}, "password": "passwordforuser"}' "https://home.server/_matrix/client/v3/login"</code>.
</i18n-t> </i18n-t>
</div> </div>
</template> </template>

View file

@ -0,0 +1,49 @@
<template>
<div class="mb-3">
<label for="notifery-api-key" class="form-label">{{
$t("API Key")
}}</label>
<HiddenInput
id="notifery-api-key"
v-model="$parent.notification.notiferyApiKey"
:required="true"
autocomplete="new-password"
></HiddenInput>
</div>
<div class="mb-3">
<label for="notifery-title" class="form-label">{{ $t("Title") }}</label>
<input
id="notifery-title"
v-model="$parent.notification.notiferyTitle"
type="text"
class="form-control"
placeholder="Uptime Kuma Alert"
/>
</div>
<div class="mb-3">
<label for="notifery-group" class="form-label">{{ $t("Group") }}</label>
<input
id="notifery-group"
v-model="$parent.notification.notiferyGroup"
type="text"
class="form-control"
:placeholder="$t('Optional')"
/>
</div>
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
<a href="https://docs.notifery.com/api/event/" target="_blank">https://docs.notifery.com/api/event/</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -13,13 +13,20 @@
<div class="mb-3"> <div class="mb-3">
<label for="ntfy-priority" class="form-label">{{ $t("Priority") }}</label> <label for="ntfy-priority" class="form-label">{{ $t("Priority") }}</label>
<input id="ntfy-priority" v-model="$parent.notification.ntfyPriority" type="number" class="form-control" required min="1" max="5" step="1"> <input id="ntfy-priority" v-model="$parent.notification.ntfyPriority" type="number" class="form-control" required min="1" max="5" step="1">
<label for="ntfy-priority-down" class="form-label">{{ $t("ntfyPriorityDown") }}</label>
<input id="ntfy-priority-down" v-model="$parent.notification.ntfyPriorityDown" type="number" class="form-control" required min="1" max="5" step="1">
<div class="form-text"> <div class="form-text">
<p v-if="$parent.notification.ntfyPriority >= 5"> <p v-if="$parent.notification.ntfyPriority == $parent.notification.ntfyPriorityDown && $parent.notification.ntfyPriority >= 5">
{{ $t("ntfyPriorityHelptextAllEvents") }} {{ $t("ntfyPriorityHelptextAllEvents") }}
</p> </p>
<i18n-t v-else-if="$parent.notification.ntfyPriority > $parent.notification.ntfyPriorityDown" tag="p" keypath="ntfyPriorityHelptextPriorityHigherThanDown">
<code>DOWN</code>
<code>{{ $parent.notification.ntfyPriority }}</code>
<code>{{ $parent.notification.ntfyPriorityDown }}</code>
</i18n-t>
<i18n-t v-else tag="p" keypath="ntfyPriorityHelptextAllExceptDown"> <i18n-t v-else tag="p" keypath="ntfyPriorityHelptextAllExceptDown">
<code>DOWN</code> <code>DOWN</code>
<code>{{ $parent.notification.ntfyPriority + 1 }}</code> <code>{{ $parent.notification.ntfyPriorityDown }}</code>
</i18n-t> </i18n-t>
</div> </div>
</div> </div>
@ -69,6 +76,11 @@ export default {
this.$parent.notification.ntfyPriority = 5; this.$parent.notification.ntfyPriority = 5;
} }
// Setting down priority if it's undefined
if (typeof this.$parent.notification.ntfyPriorityDown === "undefined") {
this.$parent.notification.ntfyPriorityDown = 5;
}
// Handling notifications that added before 1.22.0 // Handling notifications that added before 1.22.0
if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") { if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") {
if (!this.$parent.notification.ntfyusername) { if (!this.$parent.notification.ntfyusername) {

View file

@ -0,0 +1,64 @@
<template>
<div class="mb-3">
<!-- Access Token Input -->
<div class="mb-3">
<label for="onechat-access-token" class="form-label">
OneChat Access Token<span style="color: red;"><sup>*</sup></span>
</label>
<HiddenInput
id="onechat-access-token"
v-model="$parent.notification.accessToken"
:required="true"
>
</HiddenInput>
<div class="form-text">
<p>{{ $t("OneChatAccessToken") }}</p>
</div>
</div>
<!-- Receiver ID Input -->
<div class="mb-3">
<label for="onechat-receiver-id" class="form-label">
{{ $t("OneChatUserIdOrGroupId") }}<span style="color: red;"><sup>*</sup></span>
</label>
<input
id="onechat-receiver-id"
v-model="$parent.notification.recieverId"
type="text"
class="form-control"
required
/>
</div>
<!-- Bot ID Input -->
<div class="mb-3">
<label for="onechat-bot-id" class="form-label">
{{ $t("OneChatBotId") }}<span style="color: red;"><sup>*</sup></span>
</label>
<input
id="onechat-bot-id"
v-model="$parent.notification.botId"
type="text"
class="form-control"
required
/>
</div>
<!-- Document Link -->
<div class="form-text">
<i18n-t tag="p" keypath="Read more:">
<a href="https://chat-develop.one.th/docs" target="_blank">https://chat-develop.one.th/docs</a>
</i18n-t>
</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -0,0 +1,9 @@
<template>
<div class="mb-3">
<label for="pumble-webhook-url" class="form-label mb-2">{{ $t("Webhook URL") }}</label><span style="color: red;"><sup>*</sup></span>
<input id="pumble-webhook-url" v-model="$parent.notification.webhookURL" type="url" class="form-control" required>
</div>
<div class="mb-3">
<a href="https://pumble.com/help/integrations/add-pumble-apps/incoming-webhooks-for-pumble/" target="_blank">{{ $t("documentationOf", ["Pumble Webbhook"]) }}</a>
</div>
</template>

View file

@ -16,34 +16,24 @@
<option>1</option> <option>1</option>
<option>2</option> <option>2</option>
</select> </select>
<label for="pushover-sound" class="form-label">{{ $t("Notification Sound") }}</label>
<select id="pushover-sound" v-model="$parent.notification.pushoversounds" class="form-select"> <label for="pushover-sound-down" class="form-label">{{ $t("Notification Sound") }} - Up</label>
<option value="pushover">{{ $t("pushoversounds pushover") }}</option> <select id="pushover-sound-down" v-model="$parent.notification.pushoversounds" class="form-select">
<option value="bike">{{ $t("pushoversounds bike") }}</option> <option v-for="sound in soundOptions" :key="sound" :value="sound">
<option value="bugle">{{ $t("pushoversounds bugle") }}</option> {{ $t(`pushoversounds ${sound}`) }}
<option value="cashregister">{{ $t("pushoversounds cashregister") }}</option> </option>
<option value="classical">{{ $t("pushoversounds classical") }}</option>
<option value="cosmic">{{ $t("pushoversounds cosmic") }}</option>
<option value="falling">{{ $t("pushoversounds falling") }}</option>
<option value="gamelan">{{ $t("pushoversounds gamelan") }}</option>
<option value="incoming">{{ $t("pushoversounds incoming") }}</option>
<option value="intermission">{{ $t("pushoversounds intermission") }}</option>
<option value="magic">{{ $t("pushoversounds magic") }}</option>
<option value="mechanical">{{ $t("pushoversounds mechanical") }}</option>
<option value="pianobar">{{ $t("pushoversounds pianobar") }}</option>
<option value="siren">{{ $t("pushoversounds siren") }}</option>
<option value="spacealarm">{{ $t("pushoversounds spacealarm") }}</option>
<option value="tugboat">{{ $t("pushoversounds tugboat") }}</option>
<option value="alien">{{ $t("pushoversounds alien") }}</option>
<option value="climb">{{ $t("pushoversounds climb") }}</option>
<option value="persistent">{{ $t("pushoversounds persistent") }}</option>
<option value="echo">{{ $t("pushoversounds echo") }}</option>
<option value="updown">{{ $t("pushoversounds updown") }}</option>
<option value="vibrate">{{ $t("pushoversounds vibrate") }}</option>
<option value="none">{{ $t("pushoversounds none") }}</option>
</select> </select>
<label for="pushover-sound-up" class="form-label">{{ $t("Notification Sound") }} - Down</label>
<select id="pushover-sound-up" v-model="$parent.notification.pushoversounds_up" class="form-select">
<option v-for="sound in soundOptions" :key="sound" :value="sound">
{{ $t(`pushoversounds ${sound}`) }}
</option>
</select>
<label for="pushover-ttl" class="form-label">{{ $t("pushoverMessageTtl") }}</label> <label for="pushover-ttl" class="form-label">{{ $t("pushoverMessageTtl") }}</label>
<input id="pushover-ttl" v-model="$parent.notification.pushoverttl" type="number" min="0" step="1" class="form-control"> <input id="pushover-ttl" v-model="$parent.notification.pushoverttl" type="number" min="0" step="1" class="form-control">
<div class="form-text"> <div class="form-text">
<span style="color: red;"><sup>*</sup></span>{{ $t("Required") }} <span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;"> <i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
@ -66,5 +56,34 @@ export default {
components: { components: {
HiddenInput, HiddenInput,
}, },
data() {
return {
soundOptions: [
"pushover",
"bike",
"bugle",
"cashregister",
"classical",
"cosmic",
"falling",
"gamelan",
"incoming",
"intermission",
"magic",
"mechanical",
"pianobar",
"siren",
"spacealarm",
"tugboat",
"alien",
"climb",
"persistent",
"echo",
"updown",
"vibrate",
"none",
],
};
},
}; };
</script> </script>

View file

@ -1,31 +1,123 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-url" class="form-label">{{ $t("smseagleUrl") }}</label> <label for="smseagle-url" class="form-label">{{ $t("smseagleUrl") }}</label>
<input id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7" class="form-control" placeholder="http://127.0.0.1" required> <input
id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7"
class="form-control" placeholder="http://127.0.0.1" required
>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-token" class="form-label">{{ $t("smseagleToken") }}</label> <label for="smseagle-token" class="form-label">{{ $t("smseagleToken") }}</label>
<HiddenInput id="smseagle-token" v-model="$parent.notification.smseagleToken" :required="true"></HiddenInput> <HiddenInput id="smseagle-token" v-model="$parent.notification.smseagleToken" :required="true"></HiddenInput>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipientType") }}</label> <label for="smseagle-api-type" class="form-label">{{ $t("smseagleApiType") }} </label>
<select id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType" class="form-select"> <select id="smseagle-api-type" v-model="$parent.notification.smseagleApiType" class="form-select">
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option> <option value="smseagle-apiv1" selected>{{ $t("smseagleApiv1") }} </option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option> <option value="smseagle-apiv2">{{ $t("smseagleApiv2") }} </option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
</select> </select>
<i18n-t tag="div" keypath="smseagleDocs" class="form-text">
<a href="https://www.smseagle.eu/api/" target="_blank">https://www.smseagle.eu/api/</a>
</i18n-t>
</div> </div>
<div class="mb-3"> <div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv1'" class="mb-3">
<label for="smseagle-recipient" class="form-label">{{ $t("smseagleRecipient") }}</label> <div class="mb-3">
<input id="smseagle-recipient" v-model="$parent.notification.smseagleRecipient" type="text" class="form-control" required> <label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipientType") }}</label>
<select
id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType"
class="form-select"
>
<!-- phone number -->
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
</select>
</div>
<div class="mb-3">
<label for="smseagle-recipient" class="form-label">{{ $t("smseagleRecipient") }}</label>
<input id="smseagle-recipient" v-model="$parent.notification.smseagleRecipient" type="text" class="form-control" required>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-sms'
|| $parent.notification.smseagleRecipientType !== 'smseagle-to'" class="mb-3"
>
<label for="smseagle-priority" class="form-label">{{ $t("smseaglePriority") }}</label>
<input id="smseagle-priority" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0" required>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-sms'
|| $parent.notification.smseagleRecipientType !== 'smseagle-to'" class="mb-3 form-check form-switch"
>
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-to'" class="mb-3">
<div class="mb-3">
<label for="smseagle-msg-type" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div
v-if="$parent.notification.smseagleMsgType === 'smseagle-ring'
|| $parent.notification.smseagleMsgType === 'smseagle-tts'
|| $parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3"
>
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div>
</div> </div>
<div class="mb-3">
<label for="smseagle-priority" class="form-label">{{ $t("smseaglePriority") }}</label> <div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv2'" class="mb-3">
<input id="smseagle-priority" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0"> <div class="mb-3">
</div> <!-- phone number -->
<div class="mb-3 form-check form-switch"> <label for="smseagle-recipient-to" class="form-label">{{ $t("smseagleTo") }}</label>
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label> <input id="smseagle-recipient-to" v-model="$parent.notification.smseagleRecipientTo" type="text" class="form-control">
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input"> <i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-recipient-group" class="form-label">{{ $t("smseagleGroupV2") }}</label>
<input id="smseagle-recipient-group" v-model="$parent.notification.smseagleRecipientGroup" type="text" class="form-control">
<i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-recipient-contact" class="form-label">{{ $t("smseagleContactV2") }}</label>
<input id="smseagle-recipient-contact" v-model="$parent.notification.smseagleRecipientContact" type="text" class="form-control">
<i18n-t tag="div" keypath="smseagleComma" class="form-text" />
</div>
<div class="mb-3">
<label for="smseagle-priority-v2" class="form-label">{{ $t("smseaglePriority") }}</label>
<input id="smseagle-priority-v2" v-model="$parent.notification.smseaglePriority" type="number" class="form-control" min="0" max="9" step="1" placeholder="0">
</div>
<div class="mb-3 form-check form-switch">
<label for="smseagle-encoding-v2" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding-v2" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div class="mb-3">
<label for="smseagle-msg-type-v2" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type-v2" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div v-if="$parent.notification.smseagleMsgType && $parent.notification.smseagleMsgType !== 'smseagle-sms'" class="mb-3">
<label for="smseagle-duration-v2" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration-v2" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model-v2" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model-v2" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" placeholder="1" required>
</div>
</div> </div>
</template> </template>
@ -36,5 +128,16 @@ export default {
components: { components: {
HiddenInput, HiddenInput,
}, },
mounted() {
if (!this.$parent.notification.smseagleApiType) {
this.$parent.notification.smseagleApiType = "smseagle-apiv1";
}
if (!this.$parent.notification.smseagleMsgType) {
this.$parent.notification.smseagleMsgType = "smseagle-sms";
}
if (!this.$parent.notification.smseagleRecipientType) {
this.$parent.notification.smseagleRecipientType = "smseagle-to";
}
}
}; };
</script> </script>

View file

@ -0,0 +1,46 @@
<template>
<div class="mb-3">
<label for="smsplanet-api-token" class="form-label">{{ $t('smsplanetApiToken') }}</label>
<HiddenInput id="smsplanet-api-token" v-model="$parent.notification.smsplanetApiToken" :required="true"></HiddenInput>
<i18n-t tag="div" keypath="smsplanetApiDocs" class="form-text">
<template #the_smsplanet_documentation>
<a
href="https://smsplanet.pl/doc/slate/index.html#introduction"
target="_blank"
>{{ $t("the smsplanet documentation") }}</a>
</template>
</i18n-t>
</div>
<div class="mb-3">
<label for="smsplanet-phone-numbers" class="form-label">{{ $t("Phone numbers") }}</label>
<textarea
id="smsplanet-phone-numbers"
v-model="$parent.notification.smsplanetPhoneNumbers"
class="form-control"
:placeholder="smsplanetPhoneNumbers"
required
></textarea>
</div>
<div class="mb-3">
<label for="smsplanet-sender-name" class="form-label">{{ $t("Sender name") }}</label>
<input id="smsplanet-sender-name" v-model="$parent.notification.smsplanetSenderName" type="text" minlength="3" maxlength="11" class="form-control">
<div class="form-text">{{ $t("smsplanetNeedToApproveName") }}</div>
</div>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
computed: {
smsplanetPhoneNumbers() {
return this.$t("Example:", [
"+48123456789,+48111222333",
]);
}
}
};
</script>

View file

@ -79,6 +79,15 @@
<div class="form-text">{{ $t("leave blank for default body") }}</div> <div class="form-text">{{ $t("leave blank for default body") }}</div>
</div> </div>
<div class="mb-3">
<div class="form-check">
<input id="use-html-body" v-model="$parent.notification.htmlBody" class="form-check-input" type="checkbox" value="">
<label class="form-check-label" for="use-html-body">
{{ $t("Use HTML for custom E-mail body") }}
</label>
</div>
</div>
<ToggleSection :heading="$t('smtpDkimSettings')"> <ToggleSection :heading="$t('smtpDkimSettings')">
<i18n-t tag="div" keypath="smtpDkimDesc" class="form-text mb-3"> <i18n-t tag="div" keypath="smtpDkimDesc" class="form-text mb-3">
<a href="https://nodemailer.com/dkim/" target="_blank">{{ $t("documentation") }}</a> <a href="https://nodemailer.com/dkim/" target="_blank">{{ $t("documentation") }}</a>

View file

@ -0,0 +1,19 @@
<template>
<div class="mb-3">
<label for="spugpush-templateKey" class="form-label">{{ $t("SpugPush Template Code") }}</label>
<HiddenInput id="spugpush-templateKey" v-model="$parent.notification.templateKey" :required="true" autocomplete="new-password"></HiddenInput>
</div>
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
<a href="https://push.spug.cc/guide/plugin/kuma" rel="noopener noreferrer" target="_blank">https://push.spug.cc</a>
</i18n-t>
</template>
<script>
import HiddenInput from "../HiddenInput.vue";
export default {
components: {
HiddenInput,
},
};
</script>

View file

@ -4,6 +4,7 @@ import AliyunSMS from "./AliyunSms.vue";
import Apprise from "./Apprise.vue"; import Apprise from "./Apprise.vue";
import Bark from "./Bark.vue"; import Bark from "./Bark.vue";
import Bitrix24 from "./Bitrix24.vue"; import Bitrix24 from "./Bitrix24.vue";
import Notifery from "./Notifery.vue";
import ClickSendSMS from "./ClickSendSMS.vue"; import ClickSendSMS from "./ClickSendSMS.vue";
import CallMeBot from "./CallMeBot.vue"; import CallMeBot from "./CallMeBot.vue";
import SMSC from "./SMSC.vue"; import SMSC from "./SMSC.vue";
@ -29,6 +30,7 @@ import Mattermost from "./Mattermost.vue";
import Nostr from "./Nostr.vue"; import Nostr from "./Nostr.vue";
import Ntfy from "./Ntfy.vue"; import Ntfy from "./Ntfy.vue";
import Octopush from "./Octopush.vue"; import Octopush from "./Octopush.vue";
import OneChat from "./OneChat.vue";
import OneBot from "./OneBot.vue"; import OneBot from "./OneBot.vue";
import Onesender from "./Onesender.vue"; import Onesender from "./Onesender.vue";
import Opsgenie from "./Opsgenie.vue"; import Opsgenie from "./Opsgenie.vue";
@ -36,6 +38,7 @@ import PagerDuty from "./PagerDuty.vue";
import FlashDuty from "./FlashDuty.vue"; import FlashDuty from "./FlashDuty.vue";
import PagerTree from "./PagerTree.vue"; import PagerTree from "./PagerTree.vue";
import PromoSMS from "./PromoSMS.vue"; import PromoSMS from "./PromoSMS.vue";
import Pumble from "./Pumble.vue";
import Pushbullet from "./Pushbullet.vue"; import Pushbullet from "./Pushbullet.vue";
import PushDeer from "./PushDeer.vue"; import PushDeer from "./PushDeer.vue";
import Pushover from "./Pushover.vue"; import Pushover from "./Pushover.vue";
@ -62,6 +65,7 @@ import WeCom from "./WeCom.vue";
import GoAlert from "./GoAlert.vue"; import GoAlert from "./GoAlert.vue";
import ZohoCliq from "./ZohoCliq.vue"; import ZohoCliq from "./ZohoCliq.vue";
import Splunk from "./Splunk.vue"; import Splunk from "./Splunk.vue";
import SpugPush from "./SpugPush.vue";
import SevenIO from "./SevenIO.vue"; import SevenIO from "./SevenIO.vue";
import Whapi from "./Whapi.vue"; import Whapi from "./Whapi.vue";
import WAHA from "./WAHA.vue"; import WAHA from "./WAHA.vue";
@ -70,6 +74,7 @@ import WPush from "./WPush.vue";
import SIGNL4 from "./SIGNL4.vue"; import SIGNL4 from "./SIGNL4.vue";
import SendGrid from "./SendGrid.vue"; import SendGrid from "./SendGrid.vue";
import YZJ from "./YZJ.vue"; import YZJ from "./YZJ.vue";
import SMSPlanet from "./SMSPlanet.vue";
/** /**
* Manage all notification form. * Manage all notification form.
@ -106,6 +111,7 @@ const NotificationFormList = {
"nostr": Nostr, "nostr": Nostr,
"ntfy": Ntfy, "ntfy": Ntfy,
"octopush": Octopush, "octopush": Octopush,
"OneChat": OneChat,
"OneBot": OneBot, "OneBot": OneBot,
"Onesender": Onesender, "Onesender": Onesender,
"Opsgenie": Opsgenie, "Opsgenie": Opsgenie,
@ -113,6 +119,7 @@ const NotificationFormList = {
"FlashDuty": FlashDuty, "FlashDuty": FlashDuty,
"PagerTree": PagerTree, "PagerTree": PagerTree,
"promosms": PromoSMS, "promosms": PromoSMS,
"pumble": Pumble,
"pushbullet": Pushbullet, "pushbullet": Pushbullet,
"PushByTechulus": TechulusPush, "PushByTechulus": TechulusPush,
"PushDeer": PushDeer, "PushDeer": PushDeer,
@ -135,6 +142,7 @@ const NotificationFormList = {
"threema": Threema, "threema": Threema,
"twilio": Twilio, "twilio": Twilio,
"Splunk": Splunk, "Splunk": Splunk,
"SpugPush": SpugPush,
"webhook": Webhook, "webhook": Webhook,
"WeCom": WeCom, "WeCom": WeCom,
"GoAlert": GoAlert, "GoAlert": GoAlert,
@ -142,12 +150,14 @@ const NotificationFormList = {
"ZohoCliq": ZohoCliq, "ZohoCliq": ZohoCliq,
"SevenIO": SevenIO, "SevenIO": SevenIO,
"whapi": Whapi, "whapi": Whapi,
"notifery": Notifery,
"waha": WAHA, "waha": WAHA,
"gtxmessaging": GtxMessaging, "gtxmessaging": GtxMessaging,
"Cellsynt": Cellsynt, "Cellsynt": Cellsynt,
"WPush": WPush, "WPush": WPush,
"SendGrid": SendGrid, "SendGrid": SendGrid,
"YZJ": YZJ, "YZJ": YZJ,
"SMSPlanet": SMSPlanet,
}; };
export default NotificationFormList; export default NotificationFormList;

View file

@ -21,6 +21,9 @@
<label><input v-model="settings.checkBeta" type="checkbox" :disabled="!settings.checkUpdate" @change="saveSettings()" /> {{ $t("Also check beta release") }}</label> <label><input v-model="settings.checkBeta" type="checkbox" :disabled="!settings.checkUpdate" @change="saveSettings()" /> {{ $t("Also check beta release") }}</label>
</div> </div>
</div> </div>
<div class="mt-5">
<p>{{ $t("Font Twemoji by Twitter licensed under") }} <a href="https://creativecommons.org/licenses/by/4.0/">CC-BY 4.0</a></p>
</div>
</div> </div>
</div> </div>
</template> </template>

View file

@ -13,7 +13,8 @@
<li v-for="(proxy, index) in $root.proxyList" :key="index" class="list-group-item"> <li v-for="(proxy, index) in $root.proxyList" :key="index" class="list-group-item">
{{ proxy.host }}:{{ proxy.port }} ({{ proxy.protocol }}) {{ proxy.host }}:{{ proxy.port }} ({{ proxy.protocol }})
<span v-if="proxy.default === true" class="badge bg-primary ms-2">{{ $t("Default") }}</span><br> <span v-if="proxy.default === true" class="badge bg-primary ms-2">{{ $t("Default") }}</span><br>
<a href="#" @click="$refs.proxyDialog.show(proxy.id)">{{ $t("Edit") }}</a> <a href="#" @click="$refs.proxyDialog.show(proxy.id)">{{ $t("Edit") }}</a> |
<a href="#" @click="$refs.proxyDialog.showClone(proxy.id)">{{ $t("Clone") }}</a>
</li> </li>
</ul> </ul>

View file

@ -75,11 +75,20 @@ export function currentLocale() {
if (locale in messages) { if (locale in messages) {
return locale; return locale;
} }
// some locales are further specified such as "en-US". // If the locale is a 2-letter code, we can try to find a regional variant
// If we only have a generic locale for this, we can use it too // e.g. "fr" may not be in the messages, but "fr-FR" is
const genericLocale = locale.split("-")[0]; if (locale.length === 2) {
if (genericLocale in messages) { const regionalLocale = `${locale}-${locale.toUpperCase()}`;
return genericLocale; if (regionalLocale in messages) {
return regionalLocale;
}
} else {
// Some locales are further specified such as "en-US".
// If we only have a generic locale for this, we can use it too
const genericLocale = locale.slice(0, 2);
if (genericLocale in messages) {
return genericLocale;
}
} }
} }
return "en"; return "en";

3
src/lang/ang.json Normal file
View file

@ -0,0 +1,3 @@
{
"languageName": "RTSP Username"
}

View file

@ -145,7 +145,7 @@
"Save": "يحفظ", "Save": "يحفظ",
"Notifications": "إشعارات", "Notifications": "إشعارات",
"Not available, please setup.": "غير متوفر من فضلك الإعداد.", "Not available, please setup.": "غير متوفر من فضلك الإعداد.",
"Setup Notification": "إشعار الإعداد", "Setup Notification": "إشعار جديد",
"Light": "نور", "Light": "نور",
"Dark": "داكن", "Dark": "داكن",
"Auto": "آلي", "Auto": "آلي",
@ -598,7 +598,7 @@
"Retry": "إعادة المحاولة", "Retry": "إعادة المحاولة",
"Topic": "عنوان", "Topic": "عنوان",
"WeCom Bot Key": "WECOM BOT KEY", "WeCom Bot Key": "WECOM BOT KEY",
"Setup Proxy": "وكيل الإعداد", "Setup Proxy": "إعداد الوكيل",
"Proxy Protocol": "بروتوكول الوكيل", "Proxy Protocol": "بروتوكول الوكيل",
"Proxy Server": "مخدم بروكسي", "Proxy Server": "مخدم بروكسي",
"Proxy server has authentication": "خادم الوكيل لديه مصادقة", "Proxy server has authentication": "خادم الوكيل لديه مصادقة",
@ -740,5 +740,26 @@
"leave blank for default body": "اترك فارغاً ليتم تعيين النص تلقائياً", "leave blank for default body": "اترك فارغاً ليتم تعيين النص تلقائياً",
"emailTemplateServiceName": "اسم الخدمة", "emailTemplateServiceName": "اسم الخدمة",
"emailTemplateHostnameOrURL": "اسم المضيف أو عنوان URL", "emailTemplateHostnameOrURL": "اسم المضيف أو عنوان URL",
"smspartnerPhoneNumber": "رقم الهاتف" "smspartnerPhoneNumber": "رقم الهاتف",
"endDateTime": "تاريخ/وقت الإنتهاء",
"chromeExecutableAutoDetect": "كشف تلقائي",
"Edit Maintenance": "تعديل الصيانة",
"smspartnerSenderName": "اسم مرسل الرسائل القصيرة",
"telegramServerUrl": "(اختياري) رابط الخادم",
"emailCustomisableContent": "محتوى قابل للتخصيص",
"emailTemplateMsg": "رسالة الإشعار",
"Select message type": "اختر نوع الرسالة",
"Your User ID": "معرف المستخدم الخاص بك",
"setup a new monitor group": "إنشاء مجموعة مراقبة جديدة",
"Expires": "تاريخ الانتهاء",
"templateStatus": "الحالة",
"telegramUseTemplate": "استخدم قالب رسالة مخصص",
"telegramUseTemplateDescription": "إذا تم التفعيل، سيتم إرسال الرسالة باستخدام قالب مخصص.",
"now": "الآن",
"-year": "-سنة",
"and": "و",
"Add a domain": "إضافة نطاق",
"Remove domain": "إزالة النطاق '{0}'",
"time ago": "منذ {0}",
"startDateTime": "تاريخ/وقت البدء"
} }

Some files were not shown because too many files have changed in this diff Show more