Skip to content

Commit ce5a45d

Browse files
cmd: Fix paths when using an env file (#4296)
* core: Fix paths when using an env file * refactor: move path logic to loadFromEnv
1 parent e0a6a1e commit ce5a45d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ func loadEnvFromFile(envFile string) error {
361361
}
362362
}
363363

364+
// Update the storage paths to ensure they have the proper
365+
// value after loading a specified env file.
366+
caddy.ConfigAutosavePath = filepath.Join(caddy.AppConfigDir(), "autosave.json")
367+
caddy.DefaultStorage = &certmagic.FileStorage{Path: caddy.AppDataDir()}
368+
364369
return nil
365370
}
366371

0 commit comments

Comments
 (0)