mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user