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
+22
View File
@@ -698,12 +698,19 @@ type NotificationsConfig struct {
SMTP NotificationsEmailConfig `json:"email" typescript:",notnull"`
// Webhook settings.
Webhook NotificationsWebhookConfig `json:"webhook" typescript:",notnull"`
// Inbox settings.
Inbox NotificationsInboxConfig `json:"inbox" typescript:",notnull"`
}
// Are either of the notification methods enabled?
func (n *NotificationsConfig) Enabled() bool {
return n.SMTP.Smarthost != "" || n.Webhook.Endpoint != serpent.URL{}
}
type NotificationsInboxConfig struct {
Enabled serpent.Bool `json:"enabled" typescript:",notnull"`
}
type NotificationsEmailConfig struct {
// The sender's address.
From serpent.String `json:"from" typescript:",notnull"`
@@ -989,6 +996,11 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
Parent: &deploymentGroupNotifications,
YAML: "webhook",
}
deploymentGroupInbox = serpent.Group{
Name: "Inbox",
Parent: &deploymentGroupNotifications,
YAML: "inbox",
}
)
httpAddress := serpent.Option{
@@ -2856,6 +2868,16 @@ Write out the current server config as YAML to stdout.`,
Group: &deploymentGroupNotificationsWebhook,
YAML: "endpoint",
},
{
Name: "Notifications: Inbox: Enabled",
Description: "Enable Coder Inbox.",
Flag: "notifications-inbox-enabled",
Env: "CODER_NOTIFICATIONS_INBOX_ENABLED",
Value: &c.Notifications.Inbox.Enabled,
Default: "true",
Group: &deploymentGroupInbox,
YAML: "enabled",
},
{
Name: "Notifications: Max Send Attempts",
Description: "The upper limit of attempts to send a notification.",