aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/main.go
diff options
context:
space:
mode:
authorPascal Zarrad <[email protected]>2021-08-20 23:51:31 +0200
committerGitHub <[email protected]>2021-08-20 15:51:31 -0600
commitce5a45db458166ff71cb776d70fd63e28196aafa (patch)
tree207f947b29041d977ef628b09b0904834fab1aa6 /cmd/main.go
parente0a6a1efffd424b5ff0a2437a9b0a7066ac62803 (diff)
downloadcaddy-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
Diffstat (limited to 'cmd/main.go')
-rw-r--r--cmd/main.go5
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
}