mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Changing the way we mattermost handles URLs. team.domain.com becomes domain.com/team.
Renaming team.Name to team.DisplayName and team.Domain to team.Name. So: team.Name -> url safe name. team.DisplayName -> nice name for users
This commit is contained in:
@@ -19,13 +19,11 @@ const (
|
||||
|
||||
type ServiceSettings struct {
|
||||
SiteName string
|
||||
Domain string
|
||||
Mode string
|
||||
AllowTesting bool
|
||||
UseSSL bool
|
||||
Port string
|
||||
Version string
|
||||
Shards map[string]string
|
||||
InviteSalt string
|
||||
PublicLinkSalt string
|
||||
ResetSalt string
|
||||
@@ -52,14 +50,10 @@ type LogSettings struct {
|
||||
}
|
||||
|
||||
type AWSSettings struct {
|
||||
S3AccessKeyId string
|
||||
S3SecretAccessKey string
|
||||
S3Bucket string
|
||||
S3Region string
|
||||
Route53AccessKeyId string
|
||||
Route53SecretAccessKey string
|
||||
Route53ZoneId string
|
||||
Route53Region string
|
||||
S3AccessKeyId string
|
||||
S3SecretAccessKey string
|
||||
S3Bucket string
|
||||
S3Region string
|
||||
}
|
||||
|
||||
type ImageSettings struct {
|
||||
@@ -213,18 +207,10 @@ func LoadConfig(fileName string) {
|
||||
panic("Error decoding configuration " + err.Error())
|
||||
}
|
||||
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
config.EmailSettings.FeedbackEmail = "feedback@localhost"
|
||||
l4g.Error("Misconfigured feedback email setting: %s", config.EmailSettings.FeedbackEmail)
|
||||
}
|
||||
|
||||
configureLog(config.LogSettings)
|
||||
|
||||
@@ -4,24 +4,9 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestConfig(t *testing.T) {
|
||||
LoadConfig("config.json")
|
||||
}
|
||||
|
||||
func TestEnvOverride(t *testing.T) {
|
||||
os.Setenv("MATTERMOST_DOMAIN", "testdomain.com")
|
||||
|
||||
LoadConfig("config_docker.json")
|
||||
if Cfg.ServiceSettings.Domain != "testdomain.com" {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
LoadConfig("config.json")
|
||||
if Cfg.ServiceSettings.Domain == "testdomain.com" {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user