feat(proxy): add proxy IP management and account routing

Add admin CRUD and connectivity checks for SOCKS5/SOCKS5H proxy nodes.

Allow accounts to bind to a proxy, route DeepSeek requests through the selected node, and expose proxy management in the admin UI.
This commit is contained in:
Jason.li
2026-04-07 02:05:25 +08:00
parent 1c95942e5d
commit 8ae2ea10c8
30 changed files with 1675 additions and 51 deletions

View File

@@ -9,6 +9,10 @@
"label": "Account Management",
"desc": "Manage the DeepSeek account pool"
},
"proxies": {
"label": "Proxy IPs",
"desc": "Manage outbound proxy nodes for accounts"
},
"test": {
"label": "API Test",
"desc": "Test API connectivity and responses"
@@ -140,12 +144,55 @@
"deleteAllSessions": "Delete all sessions",
"deleteAllSessionsConfirm": "Are you sure you want to delete all sessions for this account? This action cannot be undone.",
"deleteAllSessionsSuccess": "Successfully deleted all sessions",
"accountProxyLabel": "Account proxy",
"proxyNone": "Direct connection",
"proxyBadge": "Proxy: {name}",
"proxyUpdateSuccess": "Account proxy updated.",
"envModeRiskTitle": "Environment-variable config mode detected (persistence risk)",
"envModeRiskDesc": "Detected DS2API_CONFIG_JSON. If DS2API_ENV_WRITEBACK is not enabled, Admin UI edits are in-memory only and may be lost after restart.",
"envModeWritebackPendingTitle": "Env mode + auto-persistence enabled (pending file handoff)",
"envModeWritebackActiveTitle": "Env mode + auto-persistence active",
"envModeWritebackDesc": "The app will auto-create/write the config file and transition to file-backed mode. Current persistence path: {path}"
},
"proxyManager": {
"title": "Proxy IPs",
"desc": "Manage SOCKS egress nodes for accounts and test outbound connectivity to DeepSeek.",
"addProxy": "Add proxy",
"editProxy": "Edit proxy",
"deleteProxy": "Delete proxy",
"modalAddTitle": "Add proxy node",
"modalEditTitle": "Edit proxy node",
"modalDesc": "Supports socks5 and socks5h. Accounts will use the bound node as their outbound route.",
"nameLabel": "Proxy name",
"namePlaceholder": "Example: Hong Kong Exit A",
"typeLabel": "Proxy type",
"hostLabel": "Proxy host",
"hostPlaceholder": "127.0.0.1 or proxy hostname",
"portLabel": "Port",
"usernameLabel": "Username (optional)",
"usernamePlaceholder": "Proxy auth username",
"passwordLabel": "Password (optional)",
"passwordPlaceholder": "Proxy auth password",
"passwordKeepHint": "Leave blank to keep the currently stored password.",
"typeHelp": "socks5 resolves the target hostname locally before dialing through the proxy; socks5h forwards the hostname to the proxy for remote DNS resolution.",
"requiredFields": "Host and port are required.",
"saving": "Saving...",
"testing": "Testing",
"testAction": "Check proxy",
"untested": "Untested",
"saveAdd": "Add proxy",
"saveEdit": "Save changes",
"addSuccess": "Proxy added successfully.",
"updateSuccess": "Proxy updated successfully.",
"deleteConfirm": "Delete proxy {name}? Accounts bound to it will fall back to direct connection.",
"noProxies": "No proxy nodes yet.",
"authEnabled": "Auth enabled",
"testSuccessShort": "Reachable {time}ms",
"testFailedShort": "Test failed",
"totalProxies": "Total proxies",
"socks5hCount": "socks5h nodes",
"authProxyCount": "Authenticated nodes"
},
"apiTester": {
"defaultMessage": "Hello, please introduce yourself in one sentence.",
"models": {
@@ -325,4 +372,4 @@
"four": "Trigger a redeploy to apply the updated environment variables."
}
}
}
}

View File

@@ -9,6 +9,10 @@
"label": "账号管理",
"desc": "管理 DeepSeek 账号池"
},
"proxies": {
"label": "代理 IP",
"desc": "管理账号可用的代理出口"
},
"test": {
"label": "API 测试",
"desc": "测试 API 连接与响应"
@@ -140,12 +144,55 @@
"deleteAllSessions": "删除所有会话",
"deleteAllSessionsConfirm": "确定要删除该账号的所有会话吗?此操作不可恢复。",
"deleteAllSessionsSuccess": "删除成功",
"accountProxyLabel": "账号代理",
"proxyNone": "不走代理",
"proxyBadge": "代理: {name}",
"proxyUpdateSuccess": "账号代理已更新",
"envModeRiskTitle": "当前为环境变量配置模式(有持久化风险)",
"envModeRiskDesc": "检测到 DS2API_CONFIG_JSON。若未开启 DS2API_ENV_WRITEBACK管理台改动仅在内存生效重启可能丢失。",
"envModeWritebackPendingTitle": "环境变量模式 + 自动持久化已开启(等待落盘)",
"envModeWritebackActiveTitle": "环境变量模式 + 自动持久化已生效",
"envModeWritebackDesc": "程序会自动创建/写入配置文件并在后续切换为文件模式。当前持久化路径:{path}"
},
"proxyManager": {
"title": "代理 IP",
"desc": "维护账号可选的 SOCKS 代理节点,并测试到 DeepSeek 的出站连通性。",
"addProxy": "添加代理",
"editProxy": "编辑代理",
"deleteProxy": "删除代理",
"modalAddTitle": "添加代理节点",
"modalEditTitle": "编辑代理节点",
"modalDesc": "支持 socks5 与 socks5h账号侧会按绑定结果选择出口。",
"nameLabel": "代理名称",
"namePlaceholder": "例如:香港出口 A",
"typeLabel": "代理类型",
"hostLabel": "代理主机",
"hostPlaceholder": "127.0.0.1 或代理域名",
"portLabel": "端口",
"usernameLabel": "用户名(可选)",
"usernamePlaceholder": "代理认证用户名",
"passwordLabel": "密码(可选)",
"passwordPlaceholder": "代理认证密码",
"passwordKeepHint": "留空表示保留当前已保存的密码。",
"typeHelp": "socks5 会先在本地解析目标域名再交给代理拨号socks5h 会把域名直接交给代理远端解析。",
"requiredFields": "至少需要填写主机和端口。",
"saving": "保存中...",
"testing": "测试中",
"testAction": "检查代理",
"untested": "未测试",
"saveAdd": "添加代理",
"saveEdit": "保存修改",
"addSuccess": "代理添加成功",
"updateSuccess": "代理更新成功",
"deleteConfirm": "确定要删除代理 {name} 吗?绑定到该代理的账号会自动切回直连。",
"noProxies": "还没有任何代理节点。",
"authEnabled": "已启用认证",
"testSuccessShort": "已连通 {time}ms",
"testFailedShort": "测试失败",
"totalProxies": "代理总数",
"socks5hCount": "socks5h 节点",
"authProxyCount": "带认证节点"
},
"apiTester": {
"defaultMessage": "你好,请用一句话介绍你自己。",
"models": {
@@ -325,4 +372,4 @@
"four": "触发重新部署以应用新的环境变量。"
}
}
}
}