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:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user