diff options
Diffstat (limited to 'cmd/mattermost/commands/server.go')
-rw-r--r-- | cmd/mattermost/commands/server.go | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/cmd/mattermost/commands/server.go b/cmd/mattermost/commands/server.go index 299005b6a..20ebfade6 100644 --- a/cmd/mattermost/commands/server.go +++ b/cmd/mattermost/commands/server.go @@ -6,7 +6,6 @@ package commands import ( "fmt" "net" - "net/http" "net/url" "os" "os/signal" @@ -74,6 +73,11 @@ func runServer(configFileLocation string, disableConfigWatch bool, usedPlatform if usedPlatform { mlog.Error("The platform binary has been deprecated, please switch to using the mattermost binary.") } + + if _, err := url.ParseRequestURI(*a.Config().ServiceSettings.SiteURL); err != nil { + mlog.Error("SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: http://about.mattermost.com/default-site-url") + } + mlog.Info(fmt.Sprintf("Current version is %v (%v/%v/%v/%v)", model.CurrentVersion, model.BuildNumber, model.BuildDate, model.BuildHash, model.BuildHashEnterprise)) mlog.Info(fmt.Sprintf("Enterprise Enabled: %v", model.BuildEnterpriseReady)) mlog.Info(fmt.Sprintf("Current working directory is %v", pwd)) @@ -131,19 +135,7 @@ func runServer(configFileLocation string, disableConfigWatch bool, usedPlatform // Enable developer settings if this is a "dev" build if model.BuildNumber == "dev" { - a.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.EnableDeveloper = true - if *cfg.ServiceSettings.SiteURL == "" { - *cfg.ServiceSettings.SiteURL = "http://localhost:8065" - } - }) - } - - // SiteURL should be set at this point. Either by a user or by the dev mode above - // This is here instead of in config.IsValid because there are many tests that make the assumption - // that the default config is valid. Which it is not. - if _, err := url.ParseRequestURI(*a.Config().ServiceSettings.SiteURL); err != nil { - return model.NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, "", http.StatusBadRequest) + a.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableDeveloper = true }) } resetStatuses(a) |