mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 17:17:13 +08:00
* Initial plan * feat: 实现登录验证码和安全入口错误页伪装功能 - 后端:添加登录验证码功能(密码错误3次后触发) - 后端:支持3种安全入口错误页伪装(418/nginx/close) - 后端:添加验证码API和更新设置项 - 前端:登录页支持验证码输入和刷新 - 前端:设置页添加登录验证码和错误页伪装选项 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> * fix: 修复代码审查问题 - hijack失败时回退到418错误页而非返回200 - 验证码输入去除空格 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> * feat: 优化细节 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> Co-authored-by: 耗子 <haozi@loli.email>
44 lines
1.8 KiB
Go
44 lines
1.8 KiB
Go
package request
|
|
|
|
import "net/http"
|
|
|
|
type SettingPanel struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Channel string `json:"channel" validate:"required|in:stable,beta"`
|
|
Locale string `json:"locale" validate:"required"`
|
|
Entrance string `json:"entrance" validate:"required"`
|
|
EntranceError string `json:"entrance_error" validate:"in:418,nginx,close"` // 安全入口错误页伪装类型
|
|
LoginCaptcha bool `json:"login_captcha"` // 登录验证码
|
|
OfflineMode bool `json:"offline_mode"`
|
|
AutoUpdate bool `json:"auto_update"`
|
|
TwoFA bool `json:"two_fa"`
|
|
Lifetime uint `json:"lifetime" validate:"required|min:10|max:43200"` // 登录超时,单位:分
|
|
IPHeader string `json:"ip_header"`
|
|
BindDomain []string `json:"bind_domain"`
|
|
BindIP []string `json:"bind_ip"`
|
|
BindUA []string `json:"bind_ua"`
|
|
WebsitePath string `json:"website_path" validate:"required"`
|
|
BackupPath string `json:"backup_path" validate:"required"`
|
|
HiddenMenu []string `json:"hidden_menu"` // 隐藏的菜单项
|
|
CustomLogo string `json:"custom_logo" validate:"isFullURL"` // 自定义 Logo URL
|
|
Port uint `json:"port" validate:"required|min:1|max:65535"`
|
|
HTTPS bool `json:"https"`
|
|
ACME bool `json:"acme"`
|
|
PublicIP []string `json:"public_ip"`
|
|
Cert string `json:"cert" validate:"required"`
|
|
Key string `json:"key" validate:"required"`
|
|
}
|
|
|
|
func (r *SettingPanel) Rules(_ *http.Request) map[string]string {
|
|
return map[string]string{
|
|
"BindDomain.*": "required",
|
|
"BindIP.*": "required|ipcidr",
|
|
"BindUA.*": "required",
|
|
}
|
|
}
|
|
|
|
type SettingCert struct {
|
|
Cert string `json:"cert" validate:"required"`
|
|
Key string `json:"key" validate:"required"`
|
|
}
|