From 84c185ae434f1c938857dc16402983a33d3b85a6 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Sun, 12 Aug 2018 20:19:58 +0300 Subject: [PATCH] Default value for added configuration option to keep backwards compatibility with old config (#103) --- util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util.go b/util.go index 56908c73..695c6c4b 100644 --- a/util.go +++ b/util.go @@ -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 }