Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 14, 2024
1 parent e5ba137 commit 7ef8fc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/data/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
# 耗子面板 - 网站备份脚本
panel-cli backup website -n %s -p %s
panel-cli backup clear -t website -f %s -s %d -p %s
panel-cli backup website -n '%s' -p '%s'
panel-cli backup clear -t website -f '%s' -s '%d' -p '%s'
`, req.Target, req.BackupPath, req.Target, req.Save, req.BackupPath)
}
if req.BackupType == "mysql" || req.BackupType == "postgres" {
Expand All @@ -76,8 +76,8 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
# 耗子面板 - 数据库备份脚本
panel-cli backup database -t %s -n %s -p %s
panel-cli backup clear -t %s -f %s -s %d -p %s
panel-cli backup database -t '%s' -n '%s' -p '%s'
panel-cli backup clear -t '%s' -f '%s' -s '%d' -p '%s'
`, req.BackupType, req.Target, req.BackupPath, req.BackupType, req.Target, req.Save, req.BackupPath)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/acme/solvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ func (s httpSolver) Present(_ context.Context, challenge acme.Challenge) error {
}
`, challenge.Token, challenge.KeyAuthorization)
if err = os.WriteFile(s.conf, []byte(conf), 0644); err != nil {
return fmt.Errorf("无法写入OpenResty配置文件: %w", err)
return fmt.Errorf("无法写入Nginx配置文件: %w", err)
}
if err = systemctl.Reload("nginx"); err != nil {
_, err = shell.Execf("nginx -t")
return fmt.Errorf("无法重载OpenResty: %w", err)
return fmt.Errorf("无法重载Nginx: %w", err)
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions pkg/nginx/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func (s *NginxTestSuite) TestAccessLog() {
s.Equal("/www/wwwlogs/default.log", log)
s.NoError(parser.SetAccessLog("/www/wwwlogs/access.log"))
log, err = parser.GetAccessLog()
s.NoError(err)
s.Equal("/www/wwwlogs/access.log", log)
}

Expand All @@ -217,5 +218,6 @@ func (s *NginxTestSuite) TestErrorLog() {
s.Equal("/www/wwwlogs/default.log", log)
s.NoError(parser.SetErrorLog("/www/wwwlogs/error.log"))
log, err = parser.GetErrorLog()
s.NoError(err)
s.Equal("/www/wwwlogs/error.log", log)
}

0 comments on commit 7ef8fc6

Please sign in to comment.