feat: 优化代理准备并完善远端部署

- 增加严格代理、两分钟预取、白名单去重与分组状态展示\n- 增加远端注册令牌和安全地址校验\n- 增加 Docker Compose、Caddy 示例与控制中心部署文档
This commit is contained in:
yml
2026-11-21 20:59:35 +08:00
parent d176c421a8
commit 9c83be798d
43 changed files with 2755 additions and 119 deletions
+3 -1
View File
@@ -106,7 +106,7 @@ func (a *App) SaveSettings(cfg types.Config) types.ErrorResult {
if cfg.AccountsPerProxy > constants.MaxAccountsPerProxy {
cfg.AccountsPerProxy = constants.MaxAccountsPerProxy
}
if cfg.ProxySparePercent <= 0 {
if cfg.ProxySparePercent < constants.MinProxySparePercent {
cfg.ProxySparePercent = constants.DefaultProxySparePercent
}
if cfg.ProxySparePercent > constants.MaxProxySparePercent {
@@ -119,6 +119,7 @@ func (a *App) SaveSettings(cfg types.Config) types.ErrorResult {
cfg.LogLevel = "info"
}
cfg.RemoteURL = strings.TrimSpace(cfg.RemoteURL)
cfg.RemoteEnrollmentToken = strings.TrimSpace(cfg.RemoteEnrollmentToken)
cfg.RemoteToken = strings.TrimSpace(cfg.RemoteToken)
cfg.RemoteMachineName = strings.TrimSpace(cfg.RemoteMachineName)
if proxyURL := a.effectiveProxyURL(cfg); proxyURL != "" {
@@ -175,6 +176,7 @@ func (a *App) SaveSettings(cfg types.Config) types.ErrorResult {
a.scheduler.UpdateProxySettings(cfg)
remoteChanged := cfg.RemoteEnabled != oldCfg.RemoteEnabled ||
cfg.RemoteURL != oldCfg.RemoteURL ||
cfg.RemoteEnrollmentToken != oldCfg.RemoteEnrollmentToken ||
cfg.RemoteToken != oldCfg.RemoteToken ||
cfg.RemoteMachineName != oldCfg.RemoteMachineName
if remoteChanged {