chore: enable coder inbox by default (#17077)

Add a flag to enable Coder Inbox by default, as well as supporting disabling the feature.
This commit is contained in:
Danielle Maywood
2025-03-25 12:51:26 +00:00
committed by GitHub
parent 5f3a53f01b
commit cd19e79d9b
15 changed files with 260 additions and 42 deletions
+18 -2
View File
@@ -2,6 +2,7 @@ package notifications_test
import (
"context"
"net/url"
"sync/atomic"
"testing"
"text/template"
@@ -21,6 +22,18 @@ import (
)
func defaultNotificationsConfig(method database.NotificationMethod) codersdk.NotificationsConfig {
var (
smtp codersdk.NotificationsEmailConfig
webhook codersdk.NotificationsWebhookConfig
)
switch method {
case database.NotificationMethodSmtp:
smtp.Smarthost = serpent.String("localhost:1337")
case database.NotificationMethodWebhook:
webhook.Endpoint = serpent.URL(url.URL{Host: "localhost"})
}
return codersdk.NotificationsConfig{
Method: serpent.String(method),
MaxSendAttempts: 5,
@@ -31,8 +44,11 @@ func defaultNotificationsConfig(method database.NotificationMethod) codersdk.Not
RetryInterval: serpent.Duration(time.Millisecond * 50),
LeaseCount: 10,
StoreSyncBufferSize: 50,
SMTP: codersdk.NotificationsEmailConfig{},
Webhook: codersdk.NotificationsWebhookConfig{},
SMTP: smtp,
Webhook: webhook,
Inbox: codersdk.NotificationsInboxConfig{
Enabled: serpent.Bool(true),
},
}
}