1 From e3a60a8058d2c75c9bc47f550351d0008aefb314 Mon Sep 17 00:00:00 2001
2 From: anthraxx <levente@leventepolyak.net>
3 Date: Fri, 12 Feb 2021 19:23:50 +0100
4 Subject: [PATCH] storage: use data dir for autosave.json as /etc is write
7 This is more a state file instead of a custom file as caddy also
8 persists this. We do not want to have any files in /etc being mapped
9 writable, not even the /etc/caddy directory, hence move the persisted
10 autosave.json state to the actual application data directory.
13 1 file changed, 1 insertion(+), 1 deletion(-)
15 diff --git a/storage.go b/storage.go
16 index 62f9b1c6..5babea79 100644
19 @@ -154,7 +154,7 @@ func AppDataDir() string {
22 // ConfigAutosavePath is the default path to which the last config will be persisted.
23 -var ConfigAutosavePath = filepath.Join(AppConfigDir(), "autosave.json")
24 +var ConfigAutosavePath = filepath.Join(AppDataDir(), "autosave.json")
26 // DefaultStorage is Caddy's default storage module.
27 var DefaultStorage = &certmagic.FileStorage{Path: AppDataDir()}