Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
feat: gotfy notifcation provider (#1588)
Kyle Mendell3450a6b94a3a
diff --git a/backend/internal/models/notification.go b/backend/internal/models/notification.goindex d3a85c377..4be50061f 100644--- a/backend/internal/models/notification.go+++ b/backend/internal/models/notification.go@@ -14,6 +14,7 @@ const (NotificationProviderSlack NotificationProvider = "slack"NotificationProviderNtfy NotificationProvider = "ntfy"NotificationProviderPushover NotificationProvider = "pushover"+ NotificationProviderGotify NotificationProvider = "gotify"NotificationProviderGeneric NotificationProvider = "generic")@@ -25,6 +26,7 @@ var validNotificationProviders = map[NotificationProvider]struct{}{NotificationProviderSlack: {},NotificationProviderNtfy: {},NotificationProviderPushover: {},+ NotificationProviderGotify: {},NotificationProviderGeneric: {},}@@ -153,6 +155,17 @@ type PushoverConfig struct {Events map[NotificationEventType]bool `json:"events,omitempty"`}+type GotifyConfig struct {+ Host string `json:"host"`+ Port int `json:"port,omitempty"`+ Token string `json:"token"`+ Path string `json:"path,omitempty"`+ Priority int `json:"priority,omitempty"`+ Title string `json:"title,omitempty"`+ DisableTLS bool `json:"disableTls"`+ Events map[NotificationEventType]bool `json:"events,omitempty"`+}+type GenericConfig struct {WebhookURL string `json:"webhookUrl"`Method string `json:"method,omitempty"`diff --git a/backend/internal/services/notification_service.go b/backend/internal/services/notification_service.goindex 9366d2104..7d24e09e9 100644--- a/backend/internal/services/notification_service.go+++ b/backend/internal/services/notification_service.go@@ -129,6 +129,8 @@ func (s *NotificationService) SendImageUpdateNotification(ctx context.Context, isendErr = s.sendNtfyNotification(ctx, imageRef, updateInfo, setting.Config)case models.NotificationProviderPushover:sendErr = s.sendPushoverNotification(ctx, imageRef, updateInfo, setting.Config)+ case models.NotificationProviderGotify:+ sendErr = s.sendGotifyNotification(ctx, imageRef, updateInfo, setting.Config)case models.NotificationProviderGeneric:sendErr = s.sendGenericNotification(ctx, imageRef, updateInfo, setting.Config)default:@@ -224,6 +226,8 @@ func (s *NotificationService) SendContainerUpdateNotification(ctx context.ContexsendErr = s.sendNtfyContainerUpdateNotification(ctx, containerName, imageRef, oldDigest, newDigest, setting.Config)case models.NotificationProviderPushover:sendErr = s.sendPushoverContainerUpdateNotification(ctx, containerName, imageRef, oldDigest, newDigest, setting.Config)+ case models.NotificationProviderGotify:+ sendErr = s.sendGotifyContainerUpdateNotification(ctx, containerName, imageRef, oldDigest, newDigest, setting.Config)case models.NotificationProviderGeneric:sendErr = s.sendGenericContainerUpdateNotification(ctx, containerName, imageRef, oldDigest, newDigest, setting.Config)default:@@ -713,6 +717,8 @@ func (s *NotificationService) TestNotification(ctx context.Context, provider modreturn s.sendNtfyNotification(ctx, "test/image:latest", testUpdate, setting.Config)case models.NotificationProviderPushover:return s.sendPushoverNotification(ctx, "test/image:latest", testUpdate, setting.Config)+ case models.NotificationProviderGotify:+ return s.sendGotifyNotification(ctx, "test/image:latest", testUpdate, setting.Config)case models.NotificationProviderGeneric:return s.sendGenericNotification(ctx, "test/image:latest", testUpdate, setting.Config)default:@@ -873,6 +879,8 @@ func (s *NotificationService) SendBatchImageUpdateNotification(ctx context.ContesendErr = s.sendBatchNtfyNotification(ctx, updatesWithChanges, setting.Config)case models.NotificationProviderPushover:sendErr = s.sendBatchPushoverNotification(ctx, updatesWithChanges, setting.Config)+ case models.NotificationProviderGotify:+ sendErr = s.sendBatchGotifyNotification(ctx, updatesWithChanges, setting.Config)case models.NotificationProviderGeneric:sendErr = s.sendBatchGenericNotification(ctx, updatesWithChanges, setting.Config)default:@@ -1841,6 +1849,132 @@ func (s *NotificationService) sendBatchGenericNotification(ctx context.Context,return nil}+func (s *NotificationService) sendGotifyNotification(ctx context.Context, imageRef string, updateInfo *imageupdate.Response, config models.JSON) error {+ var gotifyConfig models.GotifyConfig+ configBytes, err := json.Marshal(config)+ if err != nil {+ return fmt.Errorf("failed to marshal Gotify config: %w", err)+ }+ if err := json.Unmarshal(configBytes, &gotifyConfig); err != nil {+ return fmt.Errorf("failed to unmarshal Gotify config: %w", err)+ }++ if gotifyConfig.Token != "" {+ if decrypted, err := crypto.Decrypt(gotifyConfig.Token); err == nil {+ gotifyConfig.Token = decrypted+ } else {+ slog.Warn("Failed to decrypt Gotify token, using raw value (may be unencrypted legacy value)", "error", err)+ }+ }++ updateStatus := "No Update"+ if updateInfo.HasUpdate {+ updateStatus = "⚠️ Update Available"+ }++ message := fmt.Sprintf("🔔 Container Image Update Notification\n\n"++ "Image: %s\n"++ "Status: %s\n"++ "Update Type: %s\n",+ imageRef, updateStatus, updateInfo.UpdateType)++ if updateInfo.CurrentDigest != "" {+ message += fmt.Sprintf("Current Digest: %s\n", updateInfo.CurrentDigest)+ }+ if updateInfo.LatestDigest != "" {+ message += fmt.Sprintf("Latest Digest: %s\n", updateInfo.LatestDigest)+ }++ if err := notifications.SendGotify(ctx, gotifyConfig, message); err != nil {+ return fmt.Errorf("failed to send Gotify notification: %w", err)+ }++ return nil+}++func (s *NotificationService) sendGotifyContainerUpdateNotification(ctx context.Context, containerName, imageRef, oldDigest, newDigest string, config models.JSON) error {+ var gotifyConfig models.GotifyConfig+ configBytes, err := json.Marshal(config)+ if err != nil {+ return fmt.Errorf("failed to marshal Gotify config: %w", err)+ }+ if err := json.Unmarshal(configBytes, &gotifyConfig); err != nil {+ return fmt.Errorf("failed to unmarshal Gotify config: %w", err)+ }++ if gotifyConfig.Token != "" {+ if decrypted, err := crypto.Decrypt(gotifyConfig.Token); err == nil {+ gotifyConfig.Token = decrypted+ } else {+ slog.Warn("Failed to decrypt Gotify token, using raw value (may be unencrypted legacy value)", "error", err)+ }+ }++ message := fmt.Sprintf("✅ Container Successfully Updated\n\n"++ "Your container has been updated with the latest image version.\n\n"++ "Container: %s\n"++ "Image: %s\n"++ "Status: ✅ Updated Successfully\n",+ containerName, imageRef)++ if oldDigest != "" {+ message += fmt.Sprintf("Previous Version: %s\n", oldDigest)+ }+ if newDigest != "" {+ message += fmt.Sprintf("Current Version: %s\n", newDigest)+ }++ if err := notifications.SendGotify(ctx, gotifyConfig, message); err != nil {+ return fmt.Errorf("failed to send Gotify notification: %w", err)+ }++ return nil+}++func (s *NotificationService) sendBatchGotifyNotification(ctx context.Context, updates map[string]*imageupdate.Response, config models.JSON) error {+ var gotifyConfig models.GotifyConfig+ configBytes, err := json.Marshal(config)+ if err != nil {+ return fmt.Errorf("failed to marshal gotify config: %w", err)+ }+ if err := json.Unmarshal(configBytes, &gotifyConfig); err != nil {+ return fmt.Errorf("failed to unmarshal gotify config: %w", err)+ }++ if gotifyConfig.Token != "" {+ if decrypted, err := crypto.Decrypt(gotifyConfig.Token); err == nil {+ gotifyConfig.Token = decrypted+ }+ }++ // Build batch message content+ title := "Container Image Updates Available"+ description := fmt.Sprintf("%d container image(s) have updates available.", len(updates))+ if len(updates) == 1 {+ description = "1 container image has an update available."+ }++ message := fmt.Sprintf("%s\n\n%s\n\n", title, description)++ for imageRef, update := range updates {+ message += fmt.Sprintf("%s\n"++ "• Type: %s\n"++ "• Current: %s\n"++ "• Latest: %s\n\n",+ imageRef,+ update.UpdateType,+ update.CurrentDigest,+ update.LatestDigest,+ )+ }++ if err := notifications.SendGotify(ctx, gotifyConfig, message); err != nil {+ return fmt.Errorf("failed to send batch Gotify notification: %w", err)+ }++ return nil+}+// MigrateDiscordWebhookUrlToFields migrates legacy Discord webhookUrl to separate webhookId and token fields.// This should be called during bootstrap to ensure existing Discord configurations are preserved.func (s *NotificationService) MigrateDiscordWebhookUrlToFields(ctx context.Context) error {diff --git a/backend/internal/utils/notifications/gotify_sender.go b/backend/internal/utils/notifications/gotify_sender.gonew file mode 100644index 000000000..36cb47a3b--- /dev/null+++ b/backend/internal/utils/notifications/gotify_sender.go@@ -0,0 +1,79 @@+package notifications++import (+ "context"+ "fmt"+ "net/url"+ "strings"++ "github.com/getarcaneapp/arcane/backend/internal/models"+ "github.com/nicholas-fedor/shoutrrr"+ shoutrrrTypes "github.com/nicholas-fedor/shoutrrr/pkg/types"+)++// BuildGotifyURL converts GotifyConfig to Shoutrrr URL format+// URL example: gotify://host[:port][/path]/token[?query]+func BuildGotifyURL(config models.GotifyConfig) (string, error) {+ if config.Host == "" {+ return "", fmt.Errorf("gotify host is required")+ }++ if config.Token == "" {+ return "", fmt.Errorf("gotify token is required")+ }++ u := &url.URL{+ Scheme: "gotify",+ }++ host := config.Host+ if config.Port > 0 {+ u.Host = fmt.Sprintf("%s:%d", host, config.Port)+ } else {+ u.Host = host+ }++ path := config.Path+ if path != "" && !strings.HasPrefix(path, "/") {+ path = "/" + path+ }+ path = strings.TrimSuffix(path, "/")+ u.Path = path + "/" + config.Token++ q := u.Query()+ // Always set priority if it's within valid range, 0 is a valid priority+ q.Set("priority", fmt.Sprintf("%d", config.Priority))++ if config.Title != "" {+ q.Set("title", config.Title)+ }+ if config.DisableTLS {+ q.Set("disabletls", "yes")+ }++ u.RawQuery = q.Encode()+ return u.String(), nil+}++// SendGotify sends a message via Shoutrrr Gotify using proper service configuration+func SendGotify(ctx context.Context, config models.GotifyConfig, message string) error {+ shoutrrrURL, err := BuildGotifyURL(config)+ if err != nil {+ return fmt.Errorf("failed to build shoutrrr Gotify URL: %w", err)+ }++ sender, err := shoutrrr.CreateSender(shoutrrrURL)+ if err != nil {+ return fmt.Errorf("failed to create shoutrrr Gotify sender: %w", err)+ }++ params := &shoutrrrTypes.Params{}++ errs := sender.Send(message, params)+ for _, err := range errs {+ if err != nil {+ return fmt.Errorf("failed to send Gotify message via shoutrrr: %w", err)+ }+ }+ return nil+}diff --git a/backend/internal/utils/notifications/gotify_sender_test.go b/backend/internal/utils/notifications/gotify_sender_test.gonew file mode 100644index 000000000..8f9a43c71--- /dev/null+++ b/backend/internal/utils/notifications/gotify_sender_test.go@@ -0,0 +1,107 @@+package notifications++import (+ "testing"++ "github.com/getarcaneapp/arcane/backend/internal/models"+ "github.com/stretchr/testify/assert"+ "github.com/stretchr/testify/require"+)++func TestBuildGotifyURL(t *testing.T) {+ tests := []struct {+ name string+ config models.GotifyConfig+ wantErr bool+ expected string+ }{+ {+ name: "basic config (host + token)",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Token: "A12345678901234",+ },+ wantErr: false,+ expected: "gotify://gotify.example.com/A12345678901234?priority=0",+ },+ {+ name: "config with port",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Port: 8443,+ Token: "A12345678901234",+ },+ wantErr: false,+ expected: "gotify://gotify.example.com:8443/A12345678901234?priority=0",+ },+ {+ name: "config with path",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Path: "/gotify",+ Token: "A12345678901234",+ },+ wantErr: false,+ expected: "gotify://gotify.example.com/gotify/A12345678901234?priority=0",+ },+ {+ name: "config with all options",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Port: 80,+ Path: "mysubpath",+ Token: "A12345678901234",+ Priority: 5,+ Title: "My Title",+ DisableTLS: true,+ },+ wantErr: false,+ expected: "gotify://gotify.example.com:80/mysubpath/A12345678901234?disabletls=yes&priority=5&title=My+Title",+ },+ {+ name: "missing host",+ config: models.GotifyConfig{+ Token: "A12345678901234",+ },+ wantErr: true,+ },+ {+ name: "missing token",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ },+ wantErr: true,+ },+ {+ name: "custom token format",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Token: "custom_token_123",+ },+ wantErr: false,+ expected: "gotify://gotify.example.com/custom_token_123?priority=0",+ },+ {+ name: "negative priority valid",+ config: models.GotifyConfig{+ Host: "gotify.example.com",+ Token: "A12345678901234",+ Priority: -1,+ },+ wantErr: false,+ expected: "gotify://gotify.example.com/A12345678901234?priority=-1",+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ gotURL, err := BuildGotifyURL(tt.config)+ if tt.wantErr {+ require.Error(t, err)+ } else {+ require.NoError(t, err)+ assert.Equal(t, tt.expected, gotURL)+ }+ })+ }+}diff --git a/cliff.toml b/cliff.tomlindex 7960db8da..8426106f7 100644--- a/cliff.toml+++ b/cliff.toml@@ -12,16 +12,16 @@ tag_pattern = "v[0-9]*"commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]commit_parsers = [{ message = "^feat\\(cli\\)", group = "<!-- 01 --> CLI - New features" },- { message = "^feat", group = "<!-- 00 --> Backend - New features" },+ { message = "^feat", group = "<!-- 00 --> New features" },{ message = "^fix\\(cli\\)", group = "<!-- 11 --> CLI - Bug fixes" },- { message = "^fix", group = "<!-- 10 --> Backend - Bug fixes" },+ { message = "^fix", group = "<!-- 10 --> Bug fixes" },{ message = "^perf\\(cli\\)", group = "<!-- 21 --> CLI - Performance improvements" },- { message = "^perf", group = "<!-- 20 --> Backend - Performance improvements" },+ { message = "^perf", group = "<!-- 20 --> Performance improvements" },{ message = "^docs\\(cli\\)", group = "<!-- 31 --> CLI - Documentation", default_scope = "other" },- { message = "^docs", group = "<!-- 30 --> Backend - Documentation", default_scope = "other" },+ { message = "^docs", group = "<!-- 30 --> Documentation", default_scope = "other" },{ message = "^chore\\(deps\\)", group = "<!-- 40 --> Dependencies" },{ message = "^chore", skip = true },diff --git a/frontend/check_output.txt b/frontend/check_output.txtnew file mode 100644index 000000000..783fe7cf7--- /dev/null+++ b/frontend/check_output.txt@@ -0,0 +1,16 @@++> [email protected] check:ci /Users/kylemendell/dev/getarcaneapp/arcane/frontend+> svelte-kit sync && svelte-check --tsconfig ./tsconfig.json++Loading svelte-check in workspace: /Users/kylemendell/dev/getarcaneapp/arcane/frontend+Getting Svelte diagnostics...++/Users/kylemendell/dev/getarcaneapp/arcane/frontend/src/lib/components/resizable-split.svelte:50:17+Warn: This reference only captures the initial value of `minSize`. Did you mean to reference it inside a closure instead?+https://svelte.dev/e/state_referenced_locally (svelte)+ let collapsedSide = $state<'first' | 'second' | null>(null);+ let lastSize = minSize;+ let persistedState = $state<PersistedState<number | null> | null>(null);++====================================+svelte-check found 0 errors and 1 warning in 1 filediff --git a/frontend/messages/en.json b/frontend/messages/en.jsonindex bf3c5d776..e398eb9c2 100644--- a/frontend/messages/en.json+++ b/frontend/messages/en.json@@ -1694,6 +1694,27 @@"notifications_pushover_title_label": "Title (Optional)","notifications_pushover_title_placeholder": "Container Update","notifications_pushover_title_help": "Optional title override for notifications",+ "notifications_gotify_description": "Send notifications via Gotify when container updates are detected",+ "notifications_gotify_enabled_label": "Enable Gotify Notifications",+ "notifications_gotify_host_label": "Server Host",+ "notifications_gotify_host_placeholder": "gotify.example.com",+ "notifications_gotify_host_help": "Your Gotify server hostname or IP address",+ "notifications_gotify_port_label": "Port (Optional)",+ "notifications_gotify_port_placeholder": "443",+ "notifications_gotify_port_help": "Server port. Leave at 0 to use default (443 for HTTPS, 80 for HTTP)",+ "notifications_gotify_token_label": "Application Token",+ "notifications_gotify_token_placeholder": "Enter application token",+ "notifications_gotify_token_help": "Your Gotify application token",+ "notifications_gotify_path_label": "Path (Optional)",+ "notifications_gotify_path_placeholder": "/gotify",+ "notifications_gotify_path_help": "Optional subpath if Gotify is installed in a subdirectory",+ "notifications_gotify_priority_label": "Priority",+ "notifications_gotify_priority_help": "Priority level (-2 to 10). Higher values are more urgent",+ "notifications_gotify_title_label": "Title (Optional)",+ "notifications_gotify_title_placeholder": "Container Update",+ "notifications_gotify_title_help": "Optional title override for notifications",+ "notifications_gotify_disable_tls_label": "Disable TLS",+ "notifications_gotify_disable_tls_help": "Use HTTP instead of HTTPS (not recommended for production)","notifications_generic_title": "Generic Webhook","notifications_generic_description": "Send notifications to any webhook endpoint that accepts HTTP POST requests","notifications_generic_enabled_label": "Enable Generic Webhook Notifications",diff --git a/frontend/src/lib/types/notification-providers.ts b/frontend/src/lib/types/notification-providers.tsindex 92772bb4d..892f94052 100644--- a/frontend/src/lib/types/notification-providers.ts+++ b/frontend/src/lib/types/notification-providers.ts@@ -5,6 +5,7 @@ export const NOTIFICATION_PROVIDER_KEYS = ['discord','email','generic',+ 'gotify','ntfy','pushover','signal',@@ -89,6 +90,16 @@ export interface PushoverFormValues extends BaseProviderFormValues {title: string;}+export interface GotifyFormValues extends BaseProviderFormValues {+ host: string;+ port: number;+ token: string;+ path: string;+ priority: number;+ title: string;+ disableTls: boolean;+}+export interface GenericFormValues extends BaseProviderFormValues {webhookUrl: string;method: string;@@ -114,6 +125,7 @@ export type ProviderFormValues =| SlackFormValues| NtfyFormValues| PushoverFormValues+ | GotifyFormValues| GenericFormValues;// Map provider keys to their form value types@@ -125,6 +137,7 @@ export type ProviderFormValuesMap = {slack: SlackFormValues;ntfy: NtfyFormValues;pushover: PushoverFormValues;+ gotify: GotifyFormValues;generic: GenericFormValues;};@@ -370,6 +383,23 @@ export function pushoverSettingsToFormValues(settings?: NotificationSettings): P};}+export function gotifySettingsToFormValues(settings?: NotificationSettings): GotifyFormValues {+ const cfg = (settings?.config ?? {}) as Record<string, unknown>;+ const events = (cfg?.events ?? {}) as Record<string, boolean>;+ return {+ enabled: settings?.enabled ?? false,+ host: (cfg?.host as string) || '',+ port: (cfg?.port as number) || 0,+ token: (cfg?.token as string) || '',+ path: (cfg?.path as string) || '',+ priority: Number(cfg?.priority ?? 0),+ title: (cfg?.title as string) || '',+ disableTls: (cfg?.disableTls as boolean) ?? false,+ eventImageUpdate: events?.image_update ?? true,+ eventContainerUpdate: events?.container_update ?? true+ };+}+export function genericSettingsToFormValues(settings?: NotificationSettings): GenericFormValues {const cfg = (settings?.config ?? {}) as Record<string, unknown>;const events = (cfg?.events ?? {}) as Record<string, boolean>;@@ -441,6 +471,26 @@ export function pushoverFormValuesToSettings(values: PushoverFormValues): Notifi};}+export function gotifyFormValuesToSettings(values: GotifyFormValues): NotificationSettings {+ return {+ provider: 'gotify',+ enabled: values.enabled,+ config: {+ host: values.host,+ port: values.port,+ token: values.token,+ path: values.path,+ priority: values.priority,+ title: values.title,+ disableTls: values.disableTls,+ events: {+ image_update: values.eventImageUpdate,+ container_update: values.eventContainerUpdate+ }+ }+ };+}+export function genericFormValuesToSettings(values: GenericFormValues): NotificationSettings {// Parse customHeaders string (format: "key1:value1, key2:value2") into objectconst customHeaders: Record<string, string> = {};diff --git a/frontend/src/lib/types/notification.type.ts b/frontend/src/lib/types/notification.type.tsindex 3b965013b..81bd0bc29 100644--- a/frontend/src/lib/types/notification.type.ts+++ b/frontend/src/lib/types/notification.type.ts@@ -1,4 +1,13 @@-export type NotificationProvider = 'discord' | 'email' | 'telegram' | 'signal' | 'slack' | 'ntfy' | 'pushover' | 'generic';+export type NotificationProvider =+ | 'discord'+ | 'email'+ | 'telegram'+ | 'signal'+ | 'slack'+ | 'ntfy'+ | 'pushover'+ | 'gotify'+ | 'generic';export type EmailTLSMode = 'none' | 'starttls' | 'ssl';export interface NotificationSettings {diff --git a/frontend/src/routes/(app)/settings/notifications/+page.svelte b/frontend/src/routes/(app)/settings/notifications/+page.svelteindex daf9e4224..53e34502b 100644--- a/frontend/src/routes/(app)/settings/notifications/+page.svelte+++ b/frontend/src/routes/(app)/settings/notifications/+page.svelte@@ -18,6 +18,7 @@type SlackFormValues,type NtfyFormValues,type PushoverFormValues,+ type GotifyFormValues,type GenericFormValues,type AppriseFormValues,type NotificationProviderKey,@@ -29,6 +30,7 @@slackSettingsToFormValues,ntfySettingsToFormValues,pushoverSettingsToFormValues,+ gotifySettingsToFormValues,genericSettingsToFormValues,appriseSettingsToFormValues,discordFormValuesToSettings,@@ -38,6 +40,7 @@slackFormValuesToSettings,ntfyFormValuesToSettings,pushoverFormValuesToSettings,+ gotifyFormValuesToSettings,genericFormValuesToSettings,appriseFormValuesToSettings} from '$lib/types/notification-providers';@@ -50,6 +53,7 @@SlackProviderForm,NtfyProviderForm,PushoverProviderForm,+ GotifyProviderForm,GenericProviderForm,AppriseProviderForm} from './providers';@@ -82,6 +86,7 @@let slackFormRef: SlackProviderForm;let ntfyFormRef: NtfyProviderForm;let pushoverFormRef: PushoverProviderForm;+ let gotifyFormRef: GotifyProviderForm;let genericFormRef: GenericProviderForm;// Saved settings from server (used to detect if settings exist)@@ -93,6 +98,7 @@slack: null,ntfy: null,pushover: null,+ gotify: null,generic: null});@@ -104,6 +110,7 @@let slackValues = $state<SlackFormValues>(slackSettingsToFormValues());let ntfyValues = $state<NtfyFormValues>(ntfySettingsToFormValues());let pushoverValues = $state<PushoverFormValues>(pushoverSettingsToFormValues());+ let gotifyValues = $state<GotifyFormValues>(gotifySettingsToFormValues());let genericValues = $state<GenericFormValues>(genericSettingsToFormValues());let appriseValues = $state<AppriseFormValues>(appriseSettingsToFormValues());@@ -115,6 +122,7 @@let slackBaseline = $state<SlackFormValues>(slackSettingsToFormValues());let ntfyBaseline = $state<NtfyFormValues>(ntfySettingsToFormValues());let pushoverBaseline = $state<PushoverFormValues>(pushoverSettingsToFormValues());+ let gotifyBaseline = $state<GotifyFormValues>(gotifySettingsToFormValues());let genericBaseline = $state<GenericFormValues>(genericSettingsToFormValues());let appriseBaseline = $state<AppriseFormValues>(appriseSettingsToFormValues());@@ -126,6 +134,7 @@const slackHasChanges = $derived(JSON.stringify(slackValues) !== JSON.stringify(slackBaseline));const ntfyHasChanges = $derived(JSON.stringify(ntfyValues) !== JSON.stringify(ntfyBaseline));const pushoverHasChanges = $derived(JSON.stringify(pushoverValues) !== JSON.stringify(pushoverBaseline));+ const gotifyHasChanges = $derived(JSON.stringify(gotifyValues) !== JSON.stringify(gotifyBaseline));const genericHasChanges = $derived(JSON.stringify(genericValues) !== JSON.stringify(genericBaseline));const appriseHasChanges = $derived(JSON.stringify(appriseValues) !== JSON.stringify(appriseBaseline));const hasChanges = $derived(@@ -136,6 +145,7 @@slackHasChanges ||ntfyHasChanges ||pushoverHasChanges ||+ gotifyHasChanges ||genericHasChanges ||appriseHasChanges);@@ -180,6 +190,9 @@pushoverValues = pushoverSettingsToFormValues(savedSettings.pushover ?? undefined);pushoverBaseline = { ...pushoverValues };+ gotifyValues = gotifySettingsToFormValues(savedSettings.gotify ?? undefined);+ gotifyBaseline = { ...gotifyValues };+genericValues = genericSettingsToFormValues(savedSettings.generic ?? undefined);genericBaseline = { ...genericValues };@@ -202,10 +215,21 @@const slackValid = slackFormRef?.isValid() ?? true;const ntfyValid = ntfyFormRef?.isValid() ?? true;const pushoverValid = pushoverFormRef?.isValid() ?? true;+ const gotifyValid = gotifyFormRef?.isValid() ?? true;const genericValid = genericFormRef?.isValid() ?? true;if (- !(emailValid && discordValid && telegramValid && signalValid && slackValid && ntfyValid && pushoverValid && genericValid)+ !(+ emailValid &&+ discordValid &&+ telegramValid &&+ signalValid &&+ slackValid &&+ ntfyValid &&+ pushoverValid &&+ gotifyValid &&+ genericValid+ )) {toast.error('Please check the form for errors');return;@@ -307,6 +331,19 @@}}+ // Save Gotify settings if changed+ if (gotifyHasChanges) {+ try {+ const settings = gotifyFormValuesToSettings(gotifyValues);+ await notificationService.updateSettings('gotify', settings);+ savedSettings.gotify = settings;+ gotifyBaseline = { ...gotifyValues };+ } catch (error: any) {+ const errorMsg = error?.response?.data?.error || error.message || 'Unknown error';+ errors.push(m.notifications_saved_failed({ provider: 'Gotify', error: errorMsg }));+ }+ }+// Save Generic settings if changedif (genericHasChanges) {try {@@ -353,6 +390,7 @@slackValues = { ...slackBaseline };ntfyValues = { ...ntfyBaseline };pushoverValues = { ...pushoverBaseline };+ gotifyValues = { ...gotifyBaseline };genericValues = { ...genericBaseline };appriseValues = { ...appriseBaseline };}@@ -512,6 +550,16 @@/></Tabs.Content>+ <Tabs.Content value="gotify" class="mt-4 space-y-4">+ <GotifyProviderForm+ bind:this={gotifyFormRef}+ bind:values={gotifyValues}+ disabled={isReadOnly}+ {isTesting}+ onTest={() => testNotification('gotify')}+ />+ </Tabs.Content>+<Tabs.Content value="generic" class="mt-4 space-y-4"><GenericProviderFormbind:this={genericFormRef}diff --git a/frontend/src/routes/(app)/settings/notifications/providers/DiscordProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/DiscordProviderForm.svelteindex b84d96e7e..5cfa9fbb7 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/DiscordProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/DiscordProviderForm.svelte@@ -71,10 +71,8 @@type="text"autocomplete="off"helpText={m.notifications_discord_webhook_id_help()}+ error={fieldErrors.webhookId}/>- {#if fieldErrors.webhookId}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.webhookId}</p>- {/if}<TextInputWithLabelbind:value={values.token}@@ -84,10 +82,8 @@type="password"autocomplete="off"helpText={m.notifications_discord_token_help()}+ error={fieldErrors.token}/>- {#if fieldErrors.token}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.token}</p>- {/if}<TextInputWithLabelbind:value={values.username}diff --git a/frontend/src/routes/(app)/settings/notifications/providers/EmailProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/EmailProviderForm.svelteindex 6a6365cb2..e8223e2b4 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/EmailProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/EmailProviderForm.svelte@@ -108,10 +108,8 @@type="text"autocomplete="off"helpText={m.notifications_email_smtp_host_help()}+ error={fieldErrors.smtpHost}/>- {#if fieldErrors.smtpHost}- <p class="text-destructive col-span-2 -mt-2 text-sm">{fieldErrors.smtpHost}</p>- {/if}<div class="space-y-2"><Label for="smtp-port">{m.notifications_email_smtp_port_label()}</Label>@@ -158,10 +156,8 @@type="email"autocomplete="off"helpText={m.notifications_email_from_address_help()}+ error={fieldErrors.fromAddress}/>- {#if fieldErrors.fromAddress}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.fromAddress}</p>- {/if}<div class="space-y-2"><Label for="to-addresses">{m.notifications_email_to_addresses_label()}</Label>diff --git a/frontend/src/routes/(app)/settings/notifications/providers/GenericProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/GenericProviderForm.svelteindex fb1763476..9707fdde8 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/GenericProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/GenericProviderForm.svelte@@ -74,10 +74,8 @@type="text"autocomplete="off"helpText={m.notifications_generic_webhook_url_help()}+ error={fieldErrors.webhookUrl}/>- {#if fieldErrors.webhookUrl}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.webhookUrl}</p>- {/if}<TextInputWithLabelbind:value={values.method}diff --git a/frontend/src/routes/(app)/settings/notifications/providers/GotifyProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/GotifyProviderForm.sveltenew file mode 100644index 000000000..970613696--- /dev/null+++ b/frontend/src/routes/(app)/settings/notifications/providers/GotifyProviderForm.svelte@@ -0,0 +1,203 @@+<script lang="ts">+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';+ import TextInputWithLabel from '$lib/components/form/text-input-with-label.svelte';+ import SwitchWithLabel from '$lib/components/form/labeled-switch.svelte';+ import { Label } from '$lib/components/ui/label';+ import * as Select from '$lib/components/ui/select/index.js';+ import { m } from '$lib/paraglide/messages';+ import { SendEmailIcon } from '$lib/icons';+ import { z } from 'zod/v4';+ import type { GotifyFormValues } from '$lib/types/notification-providers';+ import ProviderFormWrapper from './ProviderFormWrapper.svelte';+ import EventSubscriptions from './EventSubscriptions.svelte';++ interface Props {+ values: GotifyFormValues;+ disabled?: boolean;+ isTesting?: boolean;+ onTest?: () => void;+ }++ let { values = $bindable(), disabled = false, isTesting = false, onTest }: Props = $props();++ const priorityOptions = [+ { value: '-2', label: '-2 (Min)' },+ { value: '-1', label: '-1 (Low)' },+ { value: '0', label: '0 (None)' },+ { value: '1', label: '1 (Low)' },+ { value: '2', label: '2' },+ { value: '3', label: '3' },+ { value: '4', label: '4 (Normal)' },+ { value: '5', label: '5' },+ { value: '6', label: '6' },+ { value: '7', label: '7 (High)' },+ { value: '8', label: '8' },+ { value: '9', label: '9' },+ { value: '10', label: '10 (Max)' }+ ];++ const priorityValue = $derived(String(values.priority ?? 0));++ const schema = z+ .object({+ enabled: z.boolean(),+ host: z.string(),+ port: z.coerce.number().int().min(0).max(65535),+ token: z.string(),+ path: z.string(),+ priority: z.coerce.number().int(),+ title: z.string(),+ disableTls: z.boolean(),+ eventImageUpdate: z.boolean(),+ eventContainerUpdate: z.boolean()+ })+ .superRefine((d, ctx) => {+ if (!d.enabled) return;+ if (!d.host.trim()) {+ ctx.addIssue({ code: 'custom', message: m.common_required(), path: ['host'] });+ }+ if (!d.token.trim()) {+ ctx.addIssue({ code: 'custom', message: m.common_required(), path: ['token'] });+ }+ });++ const validation = $derived.by(() => schema.safeParse(values));++ const selectedPriorityLabel = $derived(+ priorityOptions.find((option) => option.value === priorityValue)?.label ?? priorityValue+ );++ const fieldErrors = $derived.by(() => {+ const errs: Partial<Record<keyof GotifyFormValues, string>> = {};+ if (validation.success) return errs;+ for (const issue of validation.error.issues) {+ const key = issue.path?.[0] as keyof GotifyFormValues | undefined;+ if (!key || errs[key]) continue;+ errs[key] = issue.message;+ }+ return errs;+ });++ export function isValid(): boolean {+ return validation.success;+ }+</script>++<ProviderFormWrapper+ id="gotify"+ title="Gotify"+ description={m.notifications_gotify_description()}+ enabledLabel={m.notifications_gotify_enabled_label()}+ bind:enabled={values.enabled}+ {disabled}+>+ <div class="grid grid-cols-1 gap-4 md:grid-cols-4">+ <div class="md:col-span-3">+ <TextInputWithLabel+ bind:value={values.host}+ {disabled}+ label={m.notifications_gotify_host_label()}+ placeholder={m.notifications_gotify_host_placeholder()}+ type="text"+ autocomplete="off"+ helpText={m.notifications_gotify_host_help()}+ error={fieldErrors.host}+ />+ </div>+ <div class="md:col-span-1">+ <TextInputWithLabel+ bind:value={values.port}+ {disabled}+ label={m.notifications_gotify_port_label()}+ placeholder={m.notifications_gotify_port_placeholder()}+ type="number"+ autocomplete="off"+ helpText={m.notifications_gotify_port_help()}+ error={fieldErrors.port}+ />+ </div>+ </div>++ <TextInputWithLabel+ bind:value={values.token}+ {disabled}+ label={m.notifications_gotify_token_label()}+ placeholder={m.notifications_gotify_token_placeholder()}+ type="password"+ autocomplete="off"+ helpText={m.notifications_gotify_token_help()}+ error={fieldErrors.token}+ />++ <TextInputWithLabel+ bind:value={values.path}+ {disabled}+ label={m.notifications_gotify_path_label()}+ placeholder={m.notifications_gotify_path_placeholder()}+ type="text"+ autocomplete="off"+ helpText={m.notifications_gotify_path_help()}+ error={fieldErrors.path}+ />++ <div class="space-y-2">+ <Label for="gotify-priority">{m.notifications_gotify_priority_label()}</Label>+ <Select.Root+ type="single"+ value={priorityValue}+ {disabled}+ onValueChange={(value) => {+ values.priority = Number(value);+ }}+ >+ <Select.Trigger id="gotify-priority" class="h-10 w-full">+ <span>{selectedPriorityLabel}</span>+ </Select.Trigger>+ <Select.Content>+ {#each priorityOptions as option (option.value)}+ <Select.Item value={option.value}>{option.label}</Select.Item>+ {/each}+ </Select.Content>+ </Select.Root>+ <p class="text-muted-foreground text-sm">{m.notifications_gotify_priority_help()}</p>+ </div>++ <TextInputWithLabel+ bind:value={values.title}+ {disabled}+ label={m.notifications_gotify_title_label()}+ placeholder={m.notifications_gotify_title_placeholder()}+ type="text"+ autocomplete="off"+ helpText={m.notifications_gotify_title_help()}+ />++ <SwitchWithLabel+ id="gotify-disable-tls"+ bind:checked={values.disableTls}+ {disabled}+ label={m.notifications_gotify_disable_tls_label()}+ description={m.notifications_gotify_disable_tls_help()}+ />++ <EventSubscriptions+ providerId="gotify"+ bind:eventImageUpdate={values.eventImageUpdate}+ bind:eventContainerUpdate={values.eventContainerUpdate}+ {disabled}+ />++ {#if onTest}+ <div class="pt-2">+ <ArcaneButton+ action="base"+ tone="outline"+ onclick={onTest}+ disabled={disabled || isTesting}+ loading={isTesting}+ icon={SendEmailIcon}+ customLabel={m.notifications_test_notification()}+ />+ </div>+ {/if}+</ProviderFormWrapper>diff --git a/frontend/src/routes/(app)/settings/notifications/providers/NtfyProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/NtfyProviderForm.svelteindex a665fe259..8f537b480 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/NtfyProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/NtfyProviderForm.svelte@@ -101,10 +101,8 @@type="text"autocomplete="off"helpText={m.notifications_ntfy_topic_help()}+ error={fieldErrors.topic}/>- {#if fieldErrors.topic}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.topic}</p>- {/if}<TextInputWithLabelbind:value={values.username}diff --git a/frontend/src/routes/(app)/settings/notifications/providers/PushoverProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/PushoverProviderForm.svelteindex 35f208abf..af919ba3d 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/PushoverProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/PushoverProviderForm.svelte@@ -89,10 +89,8 @@type="password"autocomplete="off"helpText={m.notifications_pushover_token_help()}+ error={fieldErrors.token}/>- {#if fieldErrors.token}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.token}</p>- {/if}<TextInputWithLabelbind:value={values.user}@@ -102,10 +100,8 @@type="text"autocomplete="off"helpText={m.notifications_pushover_user_help()}+ error={fieldErrors.user}/>- {#if fieldErrors.user}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.user}</p>- {/if}<div class="space-y-2"><Label for="pushover-devices">{m.notifications_pushover_devices_label()}</Label>diff --git a/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelteindex 6996ca631..bd0a30f71 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/SignalProviderForm.svelte@@ -113,10 +113,8 @@type="text"autocomplete="off"helpText={m.notifications_signal_host_help()}+ error={fieldErrors.host}/>- {#if fieldErrors.host}- <p class="text-destructive col-span-2 -mt-2 text-sm">{fieldErrors.host}</p>- {/if}<TextInputWithLabelbind:value={values.port}@@ -126,10 +124,8 @@type="number"autocomplete="off"helpText={m.notifications_signal_port_help()}+ error={fieldErrors.port}/>- {#if fieldErrors.port}- <p class="text-destructive col-span-2 -mt-2 text-sm">{fieldErrors.port}</p>- {/if}</div><div class="space-y-4">@@ -192,10 +188,8 @@type="text"autocomplete="off"helpText={m.notifications_signal_source_help()}+ error={fieldErrors.source}/>- {#if fieldErrors.source}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.source}</p>- {/if}<div class="space-y-2"><Label for="signal-recipients">{m.notifications_signal_recipients_label()}</Label>diff --git a/frontend/src/routes/(app)/settings/notifications/providers/SlackProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/SlackProviderForm.svelteindex 619d951fe..89675e8eb 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/SlackProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/SlackProviderForm.svelte@@ -73,10 +73,8 @@type="password"autocomplete="off"helpText={m.notifications_slack_token_help()}+ error={fieldErrors.token}/>- {#if fieldErrors.token}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.token}</p>- {/if}<div class="grid grid-cols-2 gap-4"><TextInputWithLabeldiff --git a/frontend/src/routes/(app)/settings/notifications/providers/TelegramProviderForm.svelte b/frontend/src/routes/(app)/settings/notifications/providers/TelegramProviderForm.svelteindex 8d181ea6b..1be4ba1bb 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/TelegramProviderForm.svelte+++ b/frontend/src/routes/(app)/settings/notifications/providers/TelegramProviderForm.svelte@@ -75,10 +75,8 @@type="password"autocomplete="off"helpText="The bot token from @BotFather"+ error={fieldErrors.botToken}/>- {#if fieldErrors.botToken}- <p class="text-destructive -mt-2 text-sm">{fieldErrors.botToken}</p>- {/if}<div class="space-y-2"><Label for="telegram-chat-ids">Chat IDs</Label>diff --git a/frontend/src/routes/(app)/settings/notifications/providers/index.ts b/frontend/src/routes/(app)/settings/notifications/providers/index.tsindex 4f158a6de..bc61c67fe 100644--- a/frontend/src/routes/(app)/settings/notifications/providers/index.ts+++ b/frontend/src/routes/(app)/settings/notifications/providers/index.ts@@ -8,4 +8,5 @@ export { default as ProviderFormWrapper } from './ProviderFormWrapper.svelte';export { default as EventSubscriptions } from './EventSubscriptions.svelte';export { default as NtfyProviderForm } from './NtfyProviderForm.svelte';export { default as PushoverProviderForm } from './PushoverProviderForm.svelte';+export { default as GotifyProviderForm } from './GotifyProviderForm.svelte';export { default as GenericProviderForm } from './GenericProviderForm.svelte';