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
+10 -1
View File
@@ -13,10 +13,11 @@ func TestSharedProxyConfigRoundTripExcludesRuntimeProxy(t *testing.T) {
path := filepath.Join(t.TempDir(), "shared-proxy.json")
cfg := types.Config{
ProxyEnabled: true,
ProxyRequired: true,
ProxyURL: "http://user:pass@127.0.0.1:9000",
ProxyAPI: "https://service.ipzan.com/core-extract?mode=auth",
AccountsPerProxy: 5,
ProxySparePercent: 25,
ProxySparePercent: 50,
AutoFetchProxyOnSchedule: true,
ProxyAutoWhitelist: true,
ProxyWhitelistReplace: true,
@@ -24,6 +25,7 @@ func TestSharedProxyConfigRoundTripExcludesRuntimeProxy(t *testing.T) {
ProxyWhitelistSignKey: "0123456789abcdef",
RemoteEnabled: true,
RemoteURL: "https://control.example.com",
RemoteEnrollmentToken: "enroll-token",
RemoteToken: "remote-token",
RemoteMachineName: "PC-01",
}
@@ -52,7 +54,14 @@ func TestSharedProxyConfigRoundTripExcludesRuntimeProxy(t *testing.T) {
if !local.ProxyEnabled || local.ProxyAPI != cfg.ProxyAPI || local.AccountsPerProxy != 5 {
t.Fatalf("unexpected merged config: %+v", local)
}
if local.ProxySparePercent != 50 {
t.Fatalf("ProxySparePercent=%d, want 50", local.ProxySparePercent)
}
if !local.ProxyRequired {
t.Fatal("ProxyRequired should round-trip through shared config")
}
if !local.RemoteEnabled || local.RemoteURL != cfg.RemoteURL ||
local.RemoteEnrollmentToken != cfg.RemoteEnrollmentToken ||
local.RemoteToken != cfg.RemoteToken || local.RemoteMachineName != cfg.RemoteMachineName {
t.Fatalf("remote settings were not merged: %+v", local)
}