From 28449dd95ae2c550d49c021217518feeb582a5d9 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 9 Jul 2018 13:32:42 -0400 Subject: Update custom url schemes error message to reflect what we actually support (#9061) --- model/config.go | 2 +- model/config_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'model') diff --git a/model/config.go b/model/config.go index 7105af893..be940d893 100644 --- a/model/config.go +++ b/model/config.go @@ -2418,7 +2418,7 @@ func (mes *MessageExportSettings) isValid(fs FileSettings) *AppError { func (ds *DisplaySettings) isValid() *AppError { if len(*ds.CustomUrlSchemes) != 0 { - validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9+.-]*\s*$`) + validProtocolPattern := regexp.MustCompile(`(?i)^\s*[a-z][a-z0-9-]*\s*$`) for _, scheme := range *ds.CustomUrlSchemes { if !validProtocolPattern.MatchString(scheme) { diff --git a/model/config_test.go b/model/config_test.go index 5406d680d..848f4327e 100644 --- a/model/config_test.go +++ b/model/config_test.go @@ -466,7 +466,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) { { name: "containing period", value: []string{"iris.beep"}, - valid: true, + valid: false, // should technically be true, but client doesn't support it }, { name: "containing hyphen", @@ -476,7 +476,7 @@ func TestDisplaySettingsIsValidCustomUrlSchemes(t *testing.T) { { name: "containing plus", value: []string{"coap+tcp", "coap+ws"}, - valid: true, + valid: false, // should technically be true, but client doesn't support it }, { name: "starting with number", -- cgit v1.2.3-1-g7c22 From 74e5d8ae66186a82e8afdd845a108d6a662751d7 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 10 Jul 2018 01:54:25 -0700 Subject: MM-11120 Adding setting to disable email invitations and rate limiting. (#9063) * Adding setting to disable email invitations. * Adding a setting and rate limiting for email invite sending. * Modifying email rate limit to 20/user/hour * Adding EnableEmailInvitations to client side config and command. --- model/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'model') diff --git a/model/config.go b/model/config.go index be940d893..1388f896f 100644 --- a/model/config.go +++ b/model/config.go @@ -237,9 +237,19 @@ type ServiceSettings struct { EnableAPITeamDeletion *bool ExperimentalEnableHardenedMode *bool ExperimentalLimitClientConfig *bool + EnableEmailInvitations *bool } func (s *ServiceSettings) SetDefaults() { + if s.EnableEmailInvitations == nil { + // If the site URL is also not present then assume this is a clean install + if s.SiteURL == nil { + s.EnableEmailInvitations = NewBool(false) + } else { + s.EnableEmailInvitations = NewBool(true) + } + } + if s.SiteURL == nil { s.SiteURL = NewString(SERVICE_SETTINGS_DEFAULT_SITE_URL) } -- cgit v1.2.3-1-g7c22