Skip to content

Modern Docker Management, Designed for Everyone

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.go
index 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, e
if 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, en
if 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, env
if 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, e
if 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.Context
if 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.Conte
if 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.Context
if 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)
}