cmd: Fix paths when using an env file (#4296)

* core: Fix paths when using an env file

* refactor: move path logic to loadFromEnv
This commit is contained in:
Pascal Zarrad 2021-08-20 23:51:31 +02:00 committed by GitHub
parent e0a6a1efff
commit ce5a45db45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}