From 7a659cc0442511463539cf55ee50a09c33c695fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Z=C3=ADpek?= Date: Sat, 11 Apr 2026 20:02:08 +0200 Subject: [PATCH] NTFY integration --- .../components/ContactPointFormModal.tsx | 34 ++++ .../src/utils/tryParseContactPointConfig.ts | 18 +- server/integrations/ntfy.go | 158 ++++++++++++++++++ server/routes/contact_points.go | 4 +- server/services/contact_points_service.go | 12 ++ server/services/services.go | 2 + 6 files changed, 225 insertions(+), 3 deletions(-) create mode 100644 server/integrations/ntfy.go diff --git a/client/src/pages/alerts/components/ContactPointsTable/components/ContactPointFormModal.tsx b/client/src/pages/alerts/components/ContactPointsTable/components/ContactPointFormModal.tsx index 11eff34..da95203 100644 --- a/client/src/pages/alerts/components/ContactPointsTable/components/ContactPointFormModal.tsx +++ b/client/src/pages/alerts/components/ContactPointsTable/components/ContactPointFormModal.tsx @@ -20,6 +20,8 @@ type FormValues = { type: string telegramApiKey?: string telegramTargetChannel?: number + ntfyEndpoint?: string + ntfyAuthToken?: string } export const ContactPointFormModal = ({ @@ -45,6 +47,13 @@ export const ContactPointFormModal = ({ } } + if (v.type === 'ntfy') { + return { + endpoint: v.ntfyEndpoint, + authToken: v.ntfyAuthToken, + } + } + return {} } @@ -56,6 +65,10 @@ export const ContactPointFormModal = ({ telegramApiKey: parsedTypeConfig.apiKey ?? '', telegramTargetChannel: parsedTypeConfig.targetChannel, }), + ...(parsedTypeConfig?.type === 'ntfy' && { + ntfyEndpoint: parsedTypeConfig.endpoint ?? '', + ntfyAuthToken: parsedTypeConfig.authToken ?? '', + }), }), onSubmit: async (v) => { if (isLoading) { @@ -105,6 +118,7 @@ export const ContactPointFormModal = ({ @@ -132,6 +146,26 @@ export const ContactPointFormModal = ({ )} + {type === 'ntfy' && ( + <> +
+ + +
+ +
+ + +
+ + )} +