diff options
author | Pascal Zarrad <[email protected]> | 2021-08-20 23:51:31 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-20 15:51:31 -0600 |
commit | ce5a45db458166ff71cb776d70fd63e28196aafa (patch) | |
tree | 207f947b29041d977ef628b09b0904834fab1aa6 | |
parent | e0a6a1efffd424b5ff0a2437a9b0a7066ac62803 (diff) | |
download | caddy-ce5a45db458166ff71cb776d70fd63e28196aafa.tar.gz caddy-ce5a45db458166ff71cb776d70fd63e28196aafa.zip |
cmd: Fix paths when using an env file (#4296)
* core: Fix paths when using an env file
* refactor: move path logic to loadFromEnv
-rw-r--r-- | cmd/main.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go index 14408fa6b..deac87fec 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 } |