mirror of
https://github.com/acepanel/panel.git
synced 2026-02-06 13:37:13 +08:00
refactor: 重命名openresty为nginx
This commit is contained in:
@@ -49,7 +49,7 @@ func (c *Client) UseManualDns(total int, check ...bool) {
|
||||
}
|
||||
|
||||
// UseHTTP 使用 HTTP 验证
|
||||
// conf openresty 配置文件路径
|
||||
// conf nginx 配置文件路径
|
||||
// path 验证文件存放路径
|
||||
func (c *Client) UseHTTP(conf, path string) {
|
||||
c.zClient.ChallengeSolvers = map[string]acmez.Solver{
|
||||
|
||||
@@ -47,8 +47,8 @@ func (s httpSolver) Present(_ context.Context, challenge acme.Challenge) error {
|
||||
if err = os.WriteFile(s.conf, []byte(conf), 0644); err != nil {
|
||||
return fmt.Errorf("无法写入OpenResty配置文件: %w", err)
|
||||
}
|
||||
if err = systemctl.Reload("openresty"); err != nil {
|
||||
_, err = shell.Execf("openresty -t")
|
||||
if err = systemctl.Reload("nginx"); err != nil {
|
||||
_, err = shell.Execf("nginx -t")
|
||||
return fmt.Errorf("无法重载OpenResty: %w", err)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ func (s httpSolver) CleanUp(_ context.Context, challenge acme.Challenge) error {
|
||||
|
||||
_ = os.Remove(filepath.Join(s.path, challenge.HTTP01ResourcePath()))
|
||||
_ = os.WriteFile(s.conf, []byte{}, 0644)
|
||||
_ = systemctl.Reload("openresty")
|
||||
_ = systemctl.Reload("nginx")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ func (s *APITestSuite) TestGetApps() {
|
||||
}
|
||||
|
||||
func (s *APITestSuite) TestGetAppBySlug() {
|
||||
_, err := s.api.AppBySlug("openresty")
|
||||
_, err := s.api.AppBySlug("nginx")
|
||||
s.NoError(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user