From ce5a45db458166ff71cb776d70fd63e28196aafa Mon Sep 17 00:00:00 2001 From: Pascal Zarrad Date: Fri, 20 Aug 2021 23:51:31 +0200 Subject: cmd: Fix paths when using an env file (#4296) * core: Fix paths when using an env file * refactor: move path logic to loadFromEnv --- cmd/main.go | 5 +++++ 1 file changed, 5 insertions(+) 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 } -- cgit v1.2.3