2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 16:10:59 +08:00

feat: OpenResty支持返回具体错误

This commit is contained in:
耗子
2024-06-25 03:35:35 +08:00
parent 63838bffa1
commit b4e5498b48
6 changed files with 48 additions and 21 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/mholt/acmez/v2/acme"
"golang.org/x/net/publicsuffix"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/systemctl"
)
@@ -46,6 +47,7 @@ func (s httpSolver) Present(_ context.Context, challenge acme.Challenge) error {
return fmt.Errorf("无法写入OpenResty配置文件: %w", err)
}
if err = systemctl.Reload("openresty"); err != nil {
_, err = shell.Execf("openresty -t")
return fmt.Errorf("无法重载OpenResty: %w", err)
}