diff options
-rw-r--r-- | config/config.json | 8 | ||||
-rw-r--r-- | utils/config.go | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/config/config.json b/config/config.json index 56ced04b5..9756a356a 100644 --- a/config/config.json +++ b/config/config.json @@ -52,7 +52,7 @@ "MaxIdleConns": 10, "MaxOpenConns": 10, "Trace": false, - "AtRestEncryptKey": "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QVg" + "AtRestEncryptKey": "" }, "LogSettings": { "EnableConsole": true, @@ -75,7 +75,7 @@ "DriverName": "local", "Directory": "./data/", "EnablePublicLink": false, - "PublicLinkSalt": "A705AklYF8MFDOfcwh3I488G8vtLlVip", + "PublicLinkSalt": "", "ThumbnailWidth": 120, "ThumbnailHeight": 100, "PreviewWidth": 1024, @@ -106,8 +106,8 @@ "SMTPServer": "", "SMTPPort": "", "ConnectionSecurity": "", - "InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS", - "PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL", + "InviteSalt": "", + "PasswordResetSalt": "", "SendPushNotifications": false, "PushNotificationServer": "", "PushNotificationContents": "generic", diff --git a/utils/config.go b/utils/config.go index a42b608b2..f4186d352 100644 --- a/utils/config.go +++ b/utils/config.go @@ -165,12 +165,21 @@ func LoadConfig(fileName string) { CfgFileName = fileName } + needSave := len(config.SqlSettings.AtRestEncryptKey) == 0 || len(*config.FileSettings.PublicLinkSalt) == 0 || + len(config.EmailSettings.InviteSalt) == 0 || len(config.EmailSettings.PasswordResetSalt) == 0 + config.SetDefaults() if err := config.IsValid(); err != nil { panic(T(err.Id)) } + if needSave { + if err := SaveConfig(fileName, &config); err != nil { + l4g.Warn(T(err.Id)) + } + } + if err := ValidateLdapFilter(&config); err != nil { panic(T(err.Id)) } |