From 522c98d4d02977db00fd3d88f77d418a44f42321 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 9 Jan 2025 22:00:18 +0800 Subject: [PATCH 1/2] fix --- cmd/web_acme.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/web_acme.go b/cmd/web_acme.go index 2fe14c1f54c04..03336b414982d 100644 --- a/cmd/web_acme.go +++ b/cmd/web_acme.go @@ -54,8 +54,8 @@ func runACME(listenAddr string, m http.Handler) error { altTLSALPNPort = p } - magic := &certmagic.Default - magic.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory} + certmagic.Default.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory} + magic := certmagic.NewDefault() // Try to use private CA root if provided, otherwise defaults to system's trust var certPool *x509.CertPool if setting.AcmeCARoot != "" { From 83d2aece5b1510c130706b95dfdc289f8c9bd70a Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 9 Jan 2025 22:05:48 +0800 Subject: [PATCH 2/2] add comment --- cmd/web_acme.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/web_acme.go b/cmd/web_acme.go index 03336b414982d..5daf0f55f243f 100644 --- a/cmd/web_acme.go +++ b/cmd/web_acme.go @@ -54,6 +54,8 @@ func runACME(listenAddr string, m http.Handler) error { altTLSALPNPort = p } + // FIXME: this path is not right, it uses "AppWorkPath" incorrectly, and writes the data into "AppWorkPath/https" + // Ideally it should migrate to AppDataPath write to "AppDataPath/https" certmagic.Default.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory} magic := certmagic.NewDefault() // Try to use private CA root if provided, otherwise defaults to system's trust