Skip to content

Modern Docker Management, Designed for Everyone

fix: discord notifications unable to be saved due to zod validations

Kyle Mendellfae1c94caa8f
diff --git a/backend/internal/services/notification_service.go b/backend/internal/services/notification_service.go
index d57def860..4358be78c 100644
--- a/backend/internal/services/notification_service.go
+++ b/backend/internal/services/notification_service.go
@@ -579,7 +579,7 @@ func (s *NotificationService) sendEmailContainerUpdateNotification(ctx context.C
func (s *NotificationService) renderContainerUpdateEmailTemplate(containerName, imageRef, oldDigest, newDigest string) (string, string, error) {
data := map[string]interface{}{
- "LogoURL": "https://raw.githubusercontent.com/ofkm/arcane/main/backend/resources/images/logo-full.svg",
+ "LogoURL": "https://raw.githubusercontent.com/getarcaneapp/arcane/main/backend/resources/images/logo-full.svg",
"AppURL": s.config.AppUrl,
"ContainerName": containerName,
"ImageRef": imageRef,
@@ -624,7 +624,7 @@ func (s *NotificationService) renderContainerUpdateEmailTemplate(containerName,
func (s *NotificationService) TestNotification(ctx context.Context, provider models.NotificationProvider, testType string) error {
setting, err := s.GetSettingsByProvider(ctx, provider)
if err != nil {
- return fmt.Errorf("failed to get settings for provider %s: %w", provider, err)
+ return fmt.Errorf("please save your %s settings before testing", provider)
}
testUpdate := &dto.ImageUpdateResponse{
@@ -704,7 +704,7 @@ func (s *NotificationService) sendTestEmail(ctx context.Context, config models.J
func (s *NotificationService) renderTestEmailTemplate() (string, string, error) {
data := map[string]interface{}{
- "LogoURL": "https://raw.githubusercontent.com/ofkm/arcane/main/backend/resources/images/logo-full.svg",
+ "LogoURL": "https://raw.githubusercontent.com/getarcaneapp/arcane/main/backend/resources/images/logo-full.svg",
"AppURL": s.config.AppUrl,
}
diff --git a/frontend/src/routes/settings/notifications/+page.svelte b/frontend/src/routes/settings/notifications/+page.svelte
index 71e86293e..ec134fb72 100644
--- a/frontend/src/routes/settings/notifications/+page.svelte
+++ b/frontend/src/routes/settings/notifications/+page.svelte
@@ -71,7 +71,7 @@
const formSchema = z
.object({
discordEnabled: z.boolean(),
- discordWebhookUrl: z.string(),
+ discordWebhookUrl: z.url().or(z.literal('')),
discordUsername: z.string(),
discordAvatarUrl: z.string(),
discordEventImageUpdate: z.boolean(),
@@ -81,7 +81,7 @@
emailSmtpPort: z.number().int().min(1).max(65535),
emailSmtpUsername: z.string(),
emailSmtpPassword: z.string(),
- emailFromAddress: z.email(),
+ emailFromAddress: z.email().or(z.literal('')),
emailToAddresses: z.string(),
emailTlsMode: z.enum(['none', 'starttls', 'ssl']),
emailEventImageUpdate: z.boolean(),
@@ -95,9 +95,7 @@
message: 'Webhook URL is required when Discord is enabled',
path: ['discordWebhookUrl']
});
- }
-
- // Validate Email fields when Email is enabled
+ } // Validate Email fields when Email is enabled
if (data.emailEnabled) {
if (!data.emailSmtpHost.trim()) {
ctx.addIssue({