Default value for added configuration option to keep backwards compatibility with old config (#103)

This commit is contained in:
Joona Hoikkala 2018-08-12 20:19:58 +03:00 committed by GitHub
parent 0fc5a8e848
commit 90ae6ee268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,12 @@ func prepareConfig(conf DNSConfig) (DNSConfig, error) {
if conf.Database.Connection == "" {
return conf, errors.New("missing database configuration option \"connection\"")
}
// Default values for options added to config to keep backwards compatibility with old config
if conf.API.ACMECacheDir == "" {
conf.API.ACMECacheDir = "api-certs"
}
return conf, nil
}