mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 09:40:12 +00:00
GHSA-x6fg-52vr-hj4w: NAT is a commonHandler any authenticated member can create, and newHTTPandGRPCMux matches r.Host against NAT before dispatching the dashboard/gRPC handlers, so a member could register the dashboard's own host as a NAT Domain and hijack global routing. Add IsReservedDashboardHost (InstallHost/ListenHost plus an operator-declared ReservedHosts list for reverse-proxy deployments), reject reserved hosts on create/update, and drop pre-planted records when building the startup cache. GHSA-39g2-8x68-pmx8: bind-time CheckPermission let a member pre-bind a DDNS profile ID that the victim would only create later. GetDDNSProvidersFromProfiles now re-validates ownership by server owner UID and skips foreign-owned profiles (UserID==0 is treated as a migration artifact, not an admin grant). Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
49 lines
2.4 KiB
Go
49 lines
2.4 KiB
Go
package model
|
|
|
|
type SettingForm struct {
|
|
DNSServers string `json:"dns_servers,omitempty" validate:"optional"`
|
|
IgnoredIPNotification string `json:"ignored_ip_notification,omitempty" validate:"optional"`
|
|
IPChangeNotificationGroupID uint64 `json:"ip_change_notification_group_id,omitempty"` // IP变更提醒的通知组
|
|
Cover uint8 `json:"cover,omitempty"`
|
|
SiteName string `json:"site_name,omitempty" minLength:"1"`
|
|
Language string `json:"language,omitempty" minLength:"2"`
|
|
InstallHost string `json:"install_host,omitempty" validate:"optional"`
|
|
ReservedHosts string `json:"reserved_hosts,omitempty" validate:"optional"`
|
|
CustomCode string `json:"custom_code,omitempty" validate:"optional"`
|
|
CustomCodeDashboard string `json:"custom_code_dashboard,omitempty" validate:"optional"`
|
|
WebRealIPHeader string `json:"web_real_ip_header,omitempty" validate:"optional"` // 前端真实IP
|
|
AgentRealIPHeader string `json:"agent_real_ip_header,omitempty" validate:"optional"` // Agent真实IP
|
|
UserTemplate string `json:"user_template,omitempty" validate:"optional"`
|
|
|
|
AgentTLS bool `json:"tls,omitempty" validate:"optional"`
|
|
EnableIPChangeNotification bool `json:"enable_ip_change_notification,omitempty" validate:"optional"`
|
|
EnablePlainIPInNotification bool `json:"enable_plain_ip_in_notification,omitempty" validate:"optional"`
|
|
EnableMCP *bool `json:"enable_mcp,omitempty" validate:"optional"`
|
|
}
|
|
|
|
type Setting struct {
|
|
ConfigForGuests
|
|
ConfigDashboard
|
|
|
|
IgnoredIPNotificationServerIDs map[uint64]bool `json:"ignored_ip_notification_server_ids,omitempty"`
|
|
Oauth2Providers []string `json:"oauth2_providers,omitempty"`
|
|
}
|
|
|
|
type FrontendTemplate struct {
|
|
Path string `json:"path,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
Repository string `json:"repository,omitempty"`
|
|
Author string `json:"author,omitempty"`
|
|
Version string `json:"version,omitempty"`
|
|
IsAdmin bool `json:"is_admin,omitempty"`
|
|
IsOfficial bool `json:"is_official,omitempty"`
|
|
}
|
|
|
|
type SettingResponse struct {
|
|
Config Setting `json:"config"`
|
|
|
|
Version string `json:"version,omitempty"`
|
|
FrontendTemplates []FrontendTemplate `json:"frontend_templates,omitempty"`
|
|
TSDBEnabled bool `json:"tsdb_enabled"`
|
|
}
|