summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPascal Zarrad <p.zarrad@outlook.de>2021-08-20 23:51:31 +0200
committerGitHub <noreply@github.com>2021-08-20 15:51:31 -0600
commitce5a45db458166ff71cb776d70fd63e28196aafa (patch)
tree207f947b29041d977ef628b09b0904834fab1aa6 /cmd
parente0a6a1efffd424b5ff0a2437a9b0a7066ac62803 (diff)
cmd: Fix paths when using an env file (#4296)
* core: Fix paths when using an env file * refactor: move path logic to loadFromEnv
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go
index 14408fa..deac87f 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -361,6 +361,11 @@ func loadEnvFromFile(envFile string) error {
}
}
+ // Update the storage paths to ensure they have the proper
+ // value after loading a specified env file.
+ caddy.ConfigAutosavePath = filepath.Join(caddy.AppConfigDir(), "autosave.json")
+ caddy.DefaultStorage = &certmagic.FileStorage{Path: caddy.AppDataDir()}
+
return nil
}