diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-08-31 01:54:16 +0800 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-08-30 13:54:16 -0400 |
commit | 651dd33b29b7b8b296cc5a12479684fa836867b1 (patch) | |
tree | 60d4f385f50ab7f6b8aa75bdb6de2d98508c8784 /utils/config.go | |
parent | 4c1f4674425ffeb430aa07f3fccbb09837f36a34 (diff) | |
download | chat-651dd33b29b7b8b296cc5a12479684fa836867b1.tar.gz chat-651dd33b29b7b8b296cc5a12479684fa836867b1.tar.bz2 chat-651dd33b29b7b8b296cc5a12479684fa836867b1.zip |
set to default value with config is missing (#7320)
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/config.go b/utils/config.go index 14f827983..0ef1a9330 100644 --- a/utils/config.go +++ b/utils/config.go @@ -20,9 +20,10 @@ import ( "github.com/fsnotify/fsnotify" "github.com/spf13/viper" + "net/http" + "github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/model" - "net/http" ) const ( @@ -376,7 +377,7 @@ func LoadConfig(fileName string) { configureLog(&config.LogSettings) - if config.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL { + if *config.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL { dir := config.FileSettings.Directory if len(dir) > 0 && dir[len(dir)-1:] != "/" { config.FileSettings.Directory += "/" @@ -491,7 +492,7 @@ func getClientConfig(c *model.Config) map[string]string { props["DefaultClientLocale"] = *c.LocalizationSettings.DefaultClientLocale props["AvailableLocales"] = *c.LocalizationSettings.AvailableLocales - props["SQLDriverName"] = c.SqlSettings.DriverName + props["SQLDriverName"] = *c.SqlSettings.DriverName props["EnableCustomEmoji"] = strconv.FormatBool(*c.ServiceSettings.EnableCustomEmoji) props["EnableEmojiPicker"] = strconv.FormatBool(*c.ServiceSettings.EnableEmojiPicker) @@ -657,8 +658,8 @@ func Desanitize(cfg *model.Config) { cfg.GitLabSettings.Secret = Cfg.GitLabSettings.Secret } - if cfg.SqlSettings.DataSource == model.FAKE_SETTING { - cfg.SqlSettings.DataSource = Cfg.SqlSettings.DataSource + if *cfg.SqlSettings.DataSource == model.FAKE_SETTING { + *cfg.SqlSettings.DataSource = *Cfg.SqlSettings.DataSource } if cfg.SqlSettings.AtRestEncryptKey == model.FAKE_SETTING { cfg.SqlSettings.AtRestEncryptKey = Cfg.SqlSettings.AtRestEncryptKey |