summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index f2ff788d8..f9a1d4861 100644
--- a/model/config.go
+++ b/model/config.go
@@ -98,6 +98,11 @@ type ClusterSettings struct {
InterNodeUrls []string
}
+type MetricsSettings struct {
+ Enable *bool
+ ListenAddress *string
+}
+
type SSOSettings struct {
Enable bool
Secret string
@@ -221,6 +226,7 @@ type TeamSettings struct {
RestrictPrivateChannelManagement *string
UserStatusAwayTimeout *int64
MaxChannelsPerTeam *int64
+ MaxNotificationsPerChannel *int64
}
type LdapSettings struct {
@@ -330,6 +336,7 @@ type Config struct {
SamlSettings SamlSettings
NativeAppSettings NativeAppSettings
ClusterSettings ClusterSettings
+ MetricsSettings MetricsSettings
WebrtcSettings WebrtcSettings
}
@@ -501,6 +508,11 @@ func (o *Config) SetDefaults() {
*o.TeamSettings.MaxChannelsPerTeam = 2000
}
+ if o.TeamSettings.MaxNotificationsPerChannel == nil {
+ o.TeamSettings.MaxNotificationsPerChannel = new(int64)
+ *o.TeamSettings.MaxNotificationsPerChannel = 1000
+ }
+
if o.EmailSettings.EnableSignInWithEmail == nil {
o.EmailSettings.EnableSignInWithEmail = new(bool)
@@ -772,6 +784,16 @@ func (o *Config) SetDefaults() {
o.ClusterSettings.InterNodeUrls = []string{}
}
+ if o.MetricsSettings.ListenAddress == nil {
+ o.MetricsSettings.ListenAddress = new(string)
+ *o.MetricsSettings.ListenAddress = ":8067"
+ }
+
+ if o.MetricsSettings.Enable == nil {
+ o.MetricsSettings.Enable = new(bool)
+ *o.MetricsSettings.Enable = false
+ }
+
if o.ComplianceSettings.Enable == nil {
o.ComplianceSettings.Enable = new(bool)
*o.ComplianceSettings.Enable = false
@@ -987,6 +1009,10 @@ func (o *Config) IsValid() *AppError {
return NewLocAppError("Config.IsValid", "model.config.is_valid.max_channels.app_error", nil, "")
}
+ if *o.TeamSettings.MaxNotificationsPerChannel <= 0 {
+ return NewLocAppError("Config.IsValid", "model.config.is_valid.max_notify_per_channel.app_error", nil, "")
+ }
+
if !(*o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_ANY || *o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_TEAM) {
return NewLocAppError("Config.IsValid", "model.config.is_valid.restrict_direct_message.app_error", nil, "")
}