diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.go | 18 | ||||
-rw-r--r-- | utils/lru.go | 8 | ||||
-rw-r--r-- | utils/lru_test.go | 8 |
3 files changed, 26 insertions, 8 deletions
diff --git a/utils/config.go b/utils/config.go index 418041706..eb2ae3050 100644 --- a/utils/config.go +++ b/utils/config.go @@ -6,6 +6,7 @@ package utils import ( l4g "code.google.com/p/log4go" "encoding/json" + "net/mail" "os" "path/filepath" ) @@ -97,7 +98,7 @@ type PrivacySettings struct { type TeamSettings struct { MaxUsersPerTeam int AllowPublicLink bool - AllowValet bool + AllowValetDefault bool TermsLink string PrivacyLink string AboutLink string @@ -220,17 +221,26 @@ func LoadConfig(fileName string) { // Grabs the domain from enviroment variable if not in configuration if config.ServiceSettings.Domain == "" { config.ServiceSettings.Domain = os.Getenv("MATTERMOST_DOMAIN") + // If the enviroment variable is not set, use a default + if config.ServiceSettings.Domain == "" { + config.ServiceSettings.Domain = "localhost" + } } - // Validates our mail settings - if err := CheckMailSettings(); err != nil { - l4g.Error("Email settings are not valid err=%v", err) + // Check for a valid email for feedback, if not then do feedback@domain + if _, err := mail.ParseAddress(config.EmailSettings.FeedbackEmail); err != nil { + config.EmailSettings.FeedbackEmail = "feedback@" + config.ServiceSettings.Domain } configureLog(config.LogSettings) Cfg = &config SanitizeOptions = getSanitizeOptions() + + // Validates our mail settings + if err := CheckMailSettings(); err != nil { + l4g.Error("Email settings are not valid err=%v", err) + } } func getSanitizeOptions() map[string]bool { diff --git a/utils/lru.go b/utils/lru.go index 9e47c3de3..61a515e14 100644 --- a/utils/lru.go +++ b/utils/lru.go @@ -1,5 +1,9 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -// See License.txt for license information. +// This files was copied/modified from https://github.com/hashicorp/golang-lru +// which was (see below) + +// This package provides a simple LRU cache. It is based on the +// LRU implementation in groupcache: +// https://github.com/golang/groupcache/tree/master/lru package utils diff --git a/utils/lru_test.go b/utils/lru_test.go index e26af032f..3255f5c1a 100644 --- a/utils/lru_test.go +++ b/utils/lru_test.go @@ -1,5 +1,9 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -// See License.txt for license information. +// This files was copied/modified from https://github.com/hashicorp/golang-lru +// which was (see below) + +// This package provides a simple LRU cache. It is based on the +// LRU implementation in groupcache: +// https://github.com/golang/groupcache/tree/master/lru package utils |