Files
panel/pkg/types/website.go
T
耗子andClaude Fable 5.1 6158381b53 feat(openlitespeed): 服务器级真实 IP、站点 LSCache 开关与验证免重载
- OLS 设置页新增真实 IP 标签,写入 conf/panel/realip.conf:有可信代理列表时
  只信任列表来源,留空则信任所有来源
- 站点高级设置新增 LSCache 开关,写入 vhost 级 module cache 片段,缓存目录按站点隔离
- HTTP-01 投放与清理返回配置是否变化,求解器据此跳过空重载;OLS 探测运行中
  服务是否已按当前指纹应答,命中即不重载

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 19:10:00 +08:00

75 lines
2.7 KiB
Go

package types
import "github.com/acepanel/panel/v3/pkg/webserver/types"
// WebsiteListen 网站监听配置
type WebsiteListen struct {
Address string `form:"address" json:"address" validate:"required"` // 监听地址 e.g. 80 0.0.0.0:80 [::]:80
HTTPS bool `form:"https" json:"https"` // 是否启用HTTPS
QUIC bool `form:"quic" json:"quic"` // 是否启用QUIC
}
// WebsiteSetting 网站设置
type WebsiteSetting struct {
ID uint `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Listens []types.Listen `form:"listens" json:"listens" validate:"required"`
Domains []string `json:"domains"`
Path string `json:"path"` // 网站目录
Root string `json:"root"` // 运行目录
Index []string `json:"index"`
// SSL 相关
SSL bool `json:"ssl"`
SSLCert string `json:"ssl_cert"`
SSLKey string `json:"ssl_key"`
HSTS bool `json:"hsts"`
OCSP bool `json:"ocsp"`
HTTPRedirect bool `json:"http_redirect"`
SSLProtocols []string `json:"ssl_protocols"`
SSLNotBefore string `json:"ssl_not_before"`
SSLNotAfter string `json:"ssl_not_after"`
SSLDNSNames []string `json:"ssl_dns_names"`
SSLIssuer string `json:"ssl_issuer"`
SSLOCSPServer []string `json:"ssl_ocsp_server"`
AccessLog string `json:"access_log"`
ErrorLog string `json:"error_log"`
// PHP 相关
PHP uint `json:"php"`
Rewrite string `json:"rewrite"`
OpenBasedir bool `json:"open_basedir"`
// 反向代理
Upstreams []types.Upstream `json:"upstreams"`
Proxies []types.Proxy `json:"proxies"`
// 重定向
Redirects []types.Redirect `json:"redirects"`
// 高级设置
StatEnabled bool `json:"stat_enabled"` // 是否启用访问统计
LSCache bool `json:"lscache"` // LiteSpeed 页面缓存
RateLimit *types.RateLimit `json:"rate_limit"` // 限流限速配置
RealIP *types.RealIP `json:"real_ip"` // 真实 IP 配置
BasicAuth []WebsiteBasicAuth `json:"basic_auth"` // 基本认证规则
// 自定义配置
CustomConfigs []WebsiteCustomConfig `json:"custom_configs"`
}
// WebsiteBasicAuth 网站基本认证规则
type WebsiteBasicAuth struct {
Path string `json:"path"` // 生效路径,空或 "/" 表示整站
Users map[string]string `json:"users"` // 用户名 -> 密码
}
// WebsiteCustomConfig 网站自定义配置
type WebsiteCustomConfig struct {
Name string `json:"name"` // 配置名称
Scope string `json:"scope"` // 作用域: site(此网站), shared(全局)
Content string `json:"content"` // 配置内容
}