diff options
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/model/config.go b/model/config.go index b6aa88919..9030f91ae 100644 --- a/model/config.go +++ b/model/config.go @@ -174,6 +174,23 @@ func ConfigFromJson(data io.Reader) *Config { } func (o *Config) SetDefaults() { + + if len(o.SqlSettings.AtRestEncryptKey) == 0 { + o.SqlSettings.AtRestEncryptKey = NewRandomString(32) + } + + if len(o.FileSettings.PublicLinkSalt) == 0 { + o.FileSettings.PublicLinkSalt = NewRandomString(32) + } + + if len(o.EmailSettings.InviteSalt) == 0 { + o.EmailSettings.InviteSalt = NewRandomString(32) + } + + if len(o.EmailSettings.PasswordResetSalt) == 0 { + o.EmailSettings.PasswordResetSalt = NewRandomString(32) + } + if o.ServiceSettings.EnableSecurityFixAlert == nil { o.ServiceSettings.EnableSecurityFixAlert = new(bool) *o.ServiceSettings.EnableSecurityFixAlert = true @@ -191,12 +208,12 @@ func (o *Config) SetDefaults() { if o.EmailSettings.SendPushNotifications == nil { o.EmailSettings.SendPushNotifications = new(bool) - *o.EmailSettings.SendPushNotifications = true + *o.EmailSettings.SendPushNotifications = false } if o.EmailSettings.PushNotificationServer == nil { o.EmailSettings.PushNotificationServer = new(string) - *o.EmailSettings.PushNotificationServer = "https://push.mattermost.com" + *o.EmailSettings.PushNotificationServer = "" } if o.SupportSettings.TermsOfServiceLink == nil { @@ -318,3 +335,11 @@ func (o *Config) IsValid() *AppError { return nil } + +func (me *Config) GetSanitizeOptions() map[string]bool { + options := map[string]bool{} + options["fullname"] = me.PrivacySettings.ShowFullName + options["email"] = me.PrivacySettings.ShowEmailAddress + + return options +} |