Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
fix: add missing decyrption fucntions for notification providers (#2992)
Kyle Mendell5f260e242303
diff --git a/backend/internal/services/notification_service.go b/backend/internal/services/notification_service.goindex ae5bf2bf4..b167e2998 100644--- a/backend/internal/services/notification_service.go+++ b/backend/internal/services/notification_service.go@@ -2611,6 +2611,12 @@ func (s *NotificationService) sendSignalPruneNotification(ctx context.Context, eif err := s.unmarshalConfigInternal(config, &signalConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&signalConfig.Password); err != nil {+ return err+ }+ if err := notifications.DecryptStringCredential(&signalConfig.Token); err != nil {+ return err+ }message := notifications.BuildPruneReportNotificationMessage(notifications.MessageFormatPlain, environmentName, result)@@ -2622,6 +2628,9 @@ func (s *NotificationService) sendSlackPruneNotification(ctx context.Context, enif err := s.unmarshalConfigInternal(config, &slackConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&slackConfig.Token); err != nil {+ return err+ }message := notifications.BuildPruneReportNotificationMessage(notifications.MessageFormatSlack, environmentName, result)@@ -2633,6 +2642,9 @@ func (s *NotificationService) sendNtfyPruneNotification(ctx context.Context, envif err := s.unmarshalConfigInternal(config, &ntfyConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&ntfyConfig.Password); err != nil {+ return err+ }message := notifications.BuildPruneReportNotificationMessage(notifications.MessageFormatPlain, environmentName, result)@@ -2644,6 +2656,9 @@ func (s *NotificationService) sendPushoverPruneNotification(ctx context.Context,if err := s.unmarshalConfigInternal(config, &pushoverConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&pushoverConfig.Token); err != nil {+ return err+ }message := notifications.BuildPruneReportNotificationMessage(notifications.MessageFormatPlain, environmentName, result)@@ -2677,6 +2692,9 @@ func (s *NotificationService) sendMatrixPruneNotification(ctx context.Context, eif err := s.unmarshalConfigInternal(config, &matrixConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&matrixConfig.Password); err != nil {+ return err+ }message := notifications.BuildPruneReportNotificationMessage(notifications.MessageFormatPlain, environmentName, result)@@ -2809,6 +2827,12 @@ func (s *NotificationService) sendSignalAutoHealNotification(ctx context.Contextif err := s.unmarshalConfigInternal(config, &signalConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&signalConfig.Password); err != nil {+ return err+ }+ if err := notifications.DecryptStringCredential(&signalConfig.Token); err != nil {+ return err+ }message := notifications.BuildAutoHealNotificationMessage(notifications.MessageFormatPlain, environmentName, containerName)return notifications.SendSignal(ctx, signalConfig, message)}@@ -2818,6 +2842,9 @@ func (s *NotificationService) sendSlackAutoHealNotification(ctx context.Context,if err := s.unmarshalConfigInternal(config, &slackConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&slackConfig.Token); err != nil {+ return err+ }message := notifications.BuildAutoHealNotificationMessage(notifications.MessageFormatSlack, environmentName, containerName)return notifications.SendSlack(ctx, slackConfig, message)}@@ -2827,6 +2854,9 @@ func (s *NotificationService) sendNtfyAutoHealNotification(ctx context.Context,if err := s.unmarshalConfigInternal(config, &ntfyConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&ntfyConfig.Password); err != nil {+ return err+ }message := notifications.BuildAutoHealNotificationMessage(notifications.MessageFormatPlain, environmentName, containerName)return notifications.SendNtfy(ctx, ntfyConfig, message)}@@ -2836,6 +2866,9 @@ func (s *NotificationService) sendPushoverAutoHealNotification(ctx context.Conteif err := s.unmarshalConfigInternal(config, &pushoverConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&pushoverConfig.Token); err != nil {+ return err+ }if pushoverConfig.Title == "" {pushoverConfig.Title = notifications.BuildEmailSubject(environmentName, "Auto Heal")}@@ -2863,6 +2896,9 @@ func (s *NotificationService) sendMatrixAutoHealNotification(ctx context.Contextif err := s.unmarshalConfigInternal(config, &matrixConfig); err != nil {return err}+ if err := notifications.DecryptStringCredential(&matrixConfig.Password); err != nil {+ return err+ }message := notifications.BuildAutoHealNotificationMessage(notifications.MessageFormatPlain, environmentName, containerName)return notifications.SendMatrix(ctx, matrixConfig, message)}