diff --git a/application/public/upload/notification/ntfy.png b/application/public/upload/notification/ntfy.png new file mode 100644 index 0000000..ad57c98 Binary files /dev/null and b/application/public/upload/notification/ntfy.png differ diff --git a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx index 87ce90a..4d47b44 100644 --- a/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx +++ b/application/src/components/settings/notification-settings/NotificationChannelDialog.tsx @@ -36,7 +36,7 @@ interface NotificationChannelDialogProps { const baseSchema = z.object({ notify_name: z.string().min(1, "Name is required"), - notification_type: z.enum(["telegram", "discord", "slack", "signal", "google_chat", "email", "webhook"]), + notification_type: z.enum(["telegram", "discord", "slack", "signal", "google_chat", "email", "ntfy", "webhook"]), enabled: z.boolean().default(true), service_id: z.string().default("global"), template_id: z.string().optional(), @@ -78,6 +78,11 @@ const emailSchema = baseSchema.extend({ smtp_password: z.string().min(1, "SMTP password is required"), }); +const ntfySchema = baseSchema.extend({ + notification_type: z.literal("ntfy"), + ntfy_endpoint: z.string().url("Must be a valid NTFY endpoint URL"), +}); + const webhookSchema = baseSchema.extend({ notification_type: z.literal("webhook"), webhook_url: z.string().url("Must be a valid URL"), @@ -91,6 +96,7 @@ const formSchema = z.discriminatedUnion("notification_type", [ signalSchema, googleChatSchema, emailSchema, + ntfySchema, webhookSchema ]); @@ -133,6 +139,12 @@ const notificationTypeOptions = [ description: "Send notifications via email", icon: "/upload/notification/email.png" }, + { + value: "ntfy", + label: "NTFY", + description: "Send notifications via NTFY push service", + icon: "/upload/notification/ntfy.png" + }, { value: "webhook", label: "Webhook", @@ -540,6 +552,25 @@ export const NotificationChannelDialog = ({ )} + {notificationType === "ntfy" && ( + ( + + NTFY Endpoint + + + + + The NTFY endpoint URL including your topic (e.g., https://ntfy.sh/checkcle) + + + + )} + /> + )} + {notificationType === "webhook" && ( <>