summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/model/config.go b/model/config.go
index 8a11b7bb7..216b1de86 100644
--- a/model/config.go
+++ b/model/config.go
@@ -29,6 +29,7 @@ type ServiceSettings struct {
GoogleDeveloperKey string
EnableOAuthServiceProvider bool
EnableIncomingWebhooks bool
+ EnableOutgoingWebhooks bool
EnablePostUsernameOverride bool
EnablePostIconOverride bool
EnableTesting bool
@@ -121,6 +122,7 @@ type TeamSettings struct {
EnableTeamCreation bool
EnableUserCreation bool
RestrictCreationToDomains string
+ RestrictTeamNames *bool
}
type Config struct {
@@ -168,6 +170,11 @@ func (o *Config) SetDefaults() {
o.ServiceSettings.EnableSecurityFixAlert = new(bool)
*o.ServiceSettings.EnableSecurityFixAlert = true
}
+
+ if o.TeamSettings.RestrictTeamNames == nil {
+ o.TeamSettings.RestrictTeamNames = new(bool)
+ *o.TeamSettings.RestrictTeamNames = true
+ }
}
func (o *Config) IsValid() *AppError {
@@ -184,8 +191,8 @@ func (o *Config) IsValid() *AppError {
return NewAppError("Config.IsValid", "Invalid maximum users per team for team settings. Must be a positive number.", "")
}
- if len(o.SqlSettings.AtRestEncryptKey) != 32 {
- return NewAppError("Config.IsValid", "Invalid at rest encrypt key for SQL settings. Must be 32 chars.", "")
+ if len(o.SqlSettings.AtRestEncryptKey) < 32 {
+ return NewAppError("Config.IsValid", "Invalid at rest encrypt key for SQL settings. Must be 32 chars or more.", "")
}
if !(o.SqlSettings.DriverName == DATABASE_DRIVER_MYSQL || o.SqlSettings.DriverName == DATABASE_DRIVER_POSTGRES) {
@@ -232,20 +239,20 @@ func (o *Config) IsValid() *AppError {
return NewAppError("Config.IsValid", "Invalid thumbnail width for file settings. Must be a positive number.", "")
}
- if len(o.FileSettings.PublicLinkSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid public link salt for file settings. Must be 32 chars.", "")
+ if len(o.FileSettings.PublicLinkSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid public link salt for file settings. Must be 32 chars or more.", "")
}
if !(o.EmailSettings.ConnectionSecurity == CONN_SECURITY_NONE || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_STARTTLS) {
return NewAppError("Config.IsValid", "Invalid connection security for email settings. Must be '', 'TLS', or 'STARTTLS'", "")
}
- if len(o.EmailSettings.InviteSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid invite salt for email settings. Must be 32 chars.", "")
+ if len(o.EmailSettings.InviteSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid invite salt for email settings. Must be 32 chars or more.", "")
}
- if len(o.EmailSettings.PasswordResetSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid password reset salt for email settings. Must be 32 chars.", "")
+ if len(o.EmailSettings.PasswordResetSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid password reset salt for email settings. Must be 32 chars or more.", "")
}
if o.RateLimitSettings.MemoryStoreSize <= 0 {