mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 10:17:17 +08:00
feat: 网站支持设置日志路径
This commit is contained in:
@@ -682,7 +682,19 @@ func (r *websiteRepo) Update(ctx context.Context, req *request.WebsiteUpdate) er
|
||||
}
|
||||
}
|
||||
|
||||
// 高级设置(限流限速、真实 IP、基本认证)
|
||||
// 高级设置(日志路径、限流限速、真实 IP、基本认证)
|
||||
// 日志路径
|
||||
if req.AccessLog != "" {
|
||||
if err = vhost.SetAccessLog(req.AccessLog); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if req.ErrorLog != "" {
|
||||
if err = vhost.SetErrorLog(req.ErrorLog); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// 限流限速
|
||||
if req.RateLimit != nil {
|
||||
if err = vhost.SetRateLimit(req.RateLimit); err != nil {
|
||||
return err
|
||||
|
||||
@@ -71,6 +71,8 @@ type WebsiteUpdate struct {
|
||||
Redirects []types.Redirect `json:"redirects"`
|
||||
|
||||
// 高级设置
|
||||
AccessLog string `json:"access_log"` // 访问日志路径
|
||||
ErrorLog string `json:"error_log"` // 错误日志路径
|
||||
RateLimit *types.RateLimit `json:"rate_limit"` // 限流限速配置
|
||||
RealIP *types.RealIP `json:"real_ip"` // 真实 IP 配置
|
||||
BasicAuth map[string]string `json:"basic_auth"` // 基本认证配置
|
||||
|
||||
Reference in New Issue
Block a user