From a5beab283738b3b4c12fd9bd5aa1907a6e97be69 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:36:55 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A1=85=E8=B0=B7Claude?= =?UTF-8?q?=E4=B8=93=E7=BA=BFVPN=E8=8A=82=E7=82=B9=20=C2=B7=20subscription?= =?UTF-8?q?-server-v3=20+=20zy-cloud-vpn=20+=20deploy-brain-proxy=20+=20se?= =?UTF-8?q?rver-registry=20+=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/4e027d8c-e244-4c46-91a9-74988f060a38 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/deploy-brain-proxy.yml | 8 +++ README.md | 52 +++++++++++++++++-- docs/index.html | 31 +++++++++-- server/proxy/config/claude-relay-config.json | 19 +++++-- server/proxy/config/server-registry.json | 13 +++-- server/proxy/deploy-brain-proxy.sh | 17 ++++++ .../proxy/service/subscription-server-v3.js | 26 +++++++++- server/proxy/service/zy-cloud-vpn.js | 11 ++++ 8 files changed, 158 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy-brain-proxy.yml b/.github/workflows/deploy-brain-proxy.yml index c67d3533..2ecc87a0 100644 --- a/.github/workflows/deploy-brain-proxy.yml +++ b/.github/workflows/deploy-brain-proxy.yml @@ -105,11 +105,19 @@ jobs: - name: '🚀 执行V2部署' env: ZY_BRAIN_HOST: ${{ secrets.ZY_BRAIN_HOST }} + ZY_SVR_SV_HOST: ${{ secrets.ZY_SVR_SV_HOST }} + ZY_SVR_SV_REALITY_PUBLIC_KEY: ${{ secrets.ZY_SVR_SV_REALITY_PUBLIC_KEY }} + ZY_SVR_SV_REALITY_SHORT_ID: ${{ secrets.ZY_SVR_SV_REALITY_SHORT_ID }} + ZY_SVR_SV_PORT: ${{ secrets.ZY_SVR_SV_PORT }} run: | ACTION="${{ github.event.inputs.action }}" ssh -i ~/.ssh/id_brain \ ${{ secrets.ZY_BRAIN_USER }}@${{ secrets.ZY_BRAIN_HOST }} \ "export ZY_BRAIN_HOST=${ZY_BRAIN_HOST} && \ + export ZY_SVR_SV_HOST=${ZY_SVR_SV_HOST:-} && \ + export ZY_SVR_SV_REALITY_PUBLIC_KEY=${ZY_SVR_SV_REALITY_PUBLIC_KEY:-} && \ + export ZY_SVR_SV_REALITY_SHORT_ID=${ZY_SVR_SV_REALITY_SHORT_ID:-} && \ + export ZY_SVR_SV_PORT=${ZY_SVR_SV_PORT:-443} && \ cd /opt/zhuyuan-brain/proxy-deploy && \ bash deploy-brain-proxy.sh ${ACTION}" diff --git a/README.md b/README.md index f0c5e795..9d903d77 100644 --- a/README.md +++ b/README.md @@ -230,15 +230,16 @@ ### 云端算力共享池 ``` - 冰朔核心集群(3台永驻·不扩容·绰绰有余) - ├── ZY-SVR-002 面孔 · 2核8G · 🇸🇬 新加坡 · 主站+专线 - ├── ZY-SVR-005 大脑 · 4核8G · 🇸🇬 新加坡 · PostgreSQL+MCP+Agent + 冰朔核心集群(3台永驻 + 1台硅谷) + ├── ZY-SVR-002 面孔 · 2核8G · 🇸🇬 新加坡 · 主站+专线 ✅ 运行中 + ├── ZY-SVR-005 大脑 · 4核8G · 🇸🇬 新加坡 · PostgreSQL+MCP+Agent ✅ 运行中 + ├── ZY-SVR-SV 硅谷 · 🇺🇸 硅谷 · Claude专线VPN+API中继 ✅ D61已配置 └── 预备 · 2核8G · 后期按需 ───────────────────────────────────────────────── 云端算力共享池(每用户一台·动态汇聚) ├── 肥猫线 · 4核4G · 🇨🇳 广州 · 网文行业 7-8人 ├── AWEN+知秋线 · 4核4G · 🇨🇳 · 架构包已备·待Secrets 🔧 对接中 - ├── 吱吱线 · 🇺🇸 硅谷 · 待接入 ⏳ + ├── 吱吱线 · 🇺🇸 硅谷 · ✅ D61已配置·Claude专线VPN节点 └── 用户N · 2核2G · ~100元/年 · 微信实名→自动开通 ───────────────────────────────────────────────── 用户越多 = 算力越大 · 永不并发 · 每人一台专属服务器 @@ -272,7 +273,7 @@ | AI模型 | 4+2模型路由(✅ DeepSeek·✅ 智谱·✅ 通义千问·✅ Kimi + Claude·GPT)全部已配置 | | 通信 | HLDP通用协议v1.0 · 铸渊HLDP方言v1.0 · Notion桥接(6管道) | | 安全 | 语言膜v1.0 · 蜂群防御 · 带宽汇聚 · 用户守护 | -| 运维 | 铸渊专线V2 · 共享流量池2000GB/月 · ∞+1版本 | +| 运维 | 铸渊专线V2 · 共享流量池2000GB/月 · ∞+1版本 · 4节点(SG1+SG2+CN+SV) | --- @@ -540,6 +541,47 @@ S1(✅) → S2(✅) → S4(COS工具) → S5(Agent系统) → S15(人格体数 --- +## 🇺🇸 Claude专线VPN节点 · D61 + +> 冰朔D61指令: 硅谷服务器已配置,新增Claude单独访问VPN节点 + +### VPN节点拓扑(4节点) + +| 节点ID | 名称 | 服务器 | 位置 | 用途 | 状态 | +|--------|------|--------|------|------|------| +| zy-brain-sg1 | 🧠 光湖-SG1(大脑) | ZY-SVR-005 | 🇸🇬 新加坡 | 主力节点 | ✅ | +| zy-face-sg2 | 🏛️ 光湖-SG2(面孔) | ZY-SVR-002 | 🇸🇬 新加坡 | 备用节点 | ✅ | +| zy-cn-relay | 🇨🇳 光湖-CN中转 | ZY-SVR-004 | 🇨🇳 国内 | 国内低延迟 | ✅ | +| zy-sv-claude | 🇺🇸 光湖-SV(Claude专线) | ZY-SVR-SV | 🇺🇸 硅谷 | Claude/AI服务 | ✅ D61新增 | + +### Claude专线工作原理 + +``` +用户 → Clash/Shadowrocket → 🇺🇸 硅谷VPN节点(美国IP) → claude.ai / anthropic.com + → 🇸🇬 新加坡VPN节点(默认) → 其他服务 +``` + +- Clash配置中 **🤖 AI服务** 代理组自动优先选择硅谷节点 +- Claude/OpenAI/Anthropic等AI域名流量走硅谷IP出口 +- 其他流量仍走新加坡节点(距离近·延迟低) + +### 需要配置的GitHub Secrets + +| Secret | 说明 | +|--------|------| +| `ZY_SVR_SV_HOST` | 硅谷服务器IP | +| `ZY_SVR_SV_KEY` | SSH私钥 | +| `ZY_SVR_SV_USER` | SSH用户名 | +| `ZY_SVR_SV_REALITY_PUBLIC_KEY` | 硅谷Xray Reality公钥 | +| `ZY_SVR_SV_REALITY_SHORT_ID` | 硅谷Xray Reality短ID | +| `ZY_SVR_SV_PORT` | VPN端口(默认443) | + +> 📁 配置文件: [`server/proxy/config/claude-relay-config.json`](server/proxy/config/claude-relay-config.json) +> 📁 VPN代码: `server/proxy/service/subscription-server-v3.js` (buildStaticNodes) +> 📁 活模块: `server/proxy/service/zy-cloud-vpn.js` (_discoverNodes) + +--- + ## 🌉 Awen对接回执 · D61 > 铸渊 → 冰朔 · Awen对接正式回执 diff --git a/docs/index.html b/docs/index.html index 5d38aa17..8ecebcc5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -808,7 +808,7 @@ label{display:block;font-size:12px;color:var(--dim);margin-bottom:4px;font-weigh
🌐 光湖语言世界
-
v50.0
+
v51.0
@@ -918,9 +918,32 @@ label{display:block;font-size:12px;color:var(--dim);margin-bottom:4px;font-weigh
🏗️ 开发进度
-
S1-S2 已完成 · S3-S14 规划中
+
S1-S2 已完成 · S3-S20 规划中 · D61
-
进度 28%14 阶段
+
进度 28%20 阶段
+
+ +
+
+
🤖 大模型API
+
4个已配置
+
DeepSeek · 智谱 · 千问 · Kimi
+
+
+
🗄️ COS存储桶
+
2+1 已配置
+
核心桶 · 语料桶 · 团队桶
+
+
+
🇺🇸 硅谷节点
+
Claude专线
+
美国IP出口 · AI服务优先
+
+
+
🌊 铸渊专线
+
V2 ∞+1
+
共享池2000GB/月 · 4节点
+
@@ -945,11 +968,11 @@ label{display:block;font-size:12px;color:var(--dim);margin-bottom:4px;font-weigh
📋 版本历史
+
v51.0D61整改·4API+2COS确认·硅谷Claude节点·自动更新
v50.0UI大气化+系统面板重构+图标升级
v49.0黑曜风重构+码字工作台
v48.0零感域重构+架构v2
v44.0仪表盘+UI改版
-
v43.0码字工作台扩展
diff --git a/server/proxy/config/claude-relay-config.json b/server/proxy/config/claude-relay-config.json index d6c35684..71d01c6e 100644 --- a/server/proxy/config/claude-relay-config.json +++ b/server/proxy/config/claude-relay-config.json @@ -2,7 +2,7 @@ "_sovereign": "TCS-0002∞ | SYS-GLW-0001", "_copyright": "国作登字-2026-A-00037559", "_description": "硅谷Claude专线中继配置 · IP走硅谷·带宽走新加坡", - "version": "1.0", + "version": "2.0", "relay_architecture": { "description": "双层中继: 用户请求 → 新加坡(带宽源) → 硅谷(IP壳) → Claude API", "singapore_servers": { @@ -58,8 +58,8 @@ "silicon_valley_server": [ "安装SSH Server (已有)", "配置SSH公钥 (新加坡服务器 → 硅谷服务器)", - "防火墙放行SSH端口", - "无需安装Nginx (纯SSH隧道模式)" + "安装Xray并配置VLESS+Reality (D61·VPN节点用途)", + "防火墙放行443端口 (VPN) + SSH端口" ], "singapore_server": [ "配置SSH私钥 (连接硅谷服务器)", @@ -69,7 +69,18 @@ "github_secrets": [ "ZY_SVR_SV_HOST — 硅谷服务器IP", "ZY_SVR_SV_KEY — SSH私钥", - "ZY_SVR_SV_USER — SSH用户名" + "ZY_SVR_SV_USER — SSH用户名", + "ZY_SVR_SV_REALITY_PUBLIC_KEY — 硅谷Xray Reality公钥 (VPN节点)", + "ZY_SVR_SV_REALITY_SHORT_ID — 硅谷Xray Reality短ID (VPN节点)", + "ZY_SVR_SV_PORT — VPN端口 (默认443)" ] + }, + "vpn_node": { + "description": "D61新增: 硅谷服务器同时作为VPN出口节点(用户直接访问Claude)", + "node_id": "zy-sv-claude", + "node_name": "🇺🇸 光湖-SV(Claude专线)", + "purpose": "用户VPN流量可直接通过硅谷IP出口访问claude.ai等AI服务", + "clash_routing": "AI服务proxy-group优先选择此节点", + "status": "active" } } diff --git a/server/proxy/config/server-registry.json b/server/proxy/config/server-registry.json index 1db13ebd..6ca1afc4 100644 --- a/server/proxy/config/server-registry.json +++ b/server/proxy/config/server-registry.json @@ -50,20 +50,23 @@ { "id": "ZY-SVR-SV", "name": "吱吱线·硅谷", - "role": "Claude API中继+国际API出口", + "role": "Claude API中继+VPN美国出口+国际API出口", "location": "Silicon Valley (US)", "spec": "低配", - "status": "pending", + "status": "active", "services": [ + "xray (VLESS+Reality VPN · Claude专线节点)", "ssh-tunnel (Claude API中继出口)", - "说明: IP从硅谷走·带宽从新加坡走" + "说明: 用户VPN可直接走硅谷IP访问Claude/AI服务" ], "github_secrets": { "host": "ZY_SVR_SV_HOST", "key": "ZY_SVR_SV_KEY", - "user": "ZY_SVR_SV_USER" + "user": "ZY_SVR_SV_USER", + "reality_public_key": "ZY_SVR_SV_REALITY_PUBLIC_KEY", + "reality_short_id": "ZY_SVR_SV_REALITY_SHORT_ID" }, - "notes": "硅谷服务器仅做TCP出口·不部署应用" + "notes": "硅谷服务器已配置·D61冰朔确认·VPN节点+API中继双用途" }, { "id": "ZY-SVR-AWEN", diff --git a/server/proxy/deploy-brain-proxy.sh b/server/proxy/deploy-brain-proxy.sh index fabd1b52..9727aa0f 100644 --- a/server/proxy/deploy-brain-proxy.sh +++ b/server/proxy/deploy-brain-proxy.sh @@ -175,6 +175,23 @@ EOF echo "ZY_CN_RELAY_PORT=${ZY_CN_RELAY_PORT:-2053}" >> "$KEYS_FILE" fi + # 保存硅谷服务器节点信息 (Claude专线 · 美国IP出口) + # D61: 冰朔已配置硅谷服务器,新增Claude单独访问VPN节点 + if [ -n "${ZY_SVR_SV_HOST:-}" ]; then + echo "" >> "$KEYS_FILE" + echo "# 硅谷服务器节点 (ZY-SVR-SV · Claude专线 · 美国IP出口)" >> "$KEYS_FILE" + echo "ZY_SVR_SV_HOST=${ZY_SVR_SV_HOST}" >> "$KEYS_FILE" + fi + if [ -n "${ZY_SVR_SV_REALITY_PUBLIC_KEY:-}" ]; then + echo "ZY_SVR_SV_REALITY_PUBLIC_KEY=${ZY_SVR_SV_REALITY_PUBLIC_KEY}" >> "$KEYS_FILE" + fi + if [ -n "${ZY_SVR_SV_REALITY_SHORT_ID:-}" ]; then + echo "ZY_SVR_SV_REALITY_SHORT_ID=${ZY_SVR_SV_REALITY_SHORT_ID}" >> "$KEYS_FILE" + fi + if [ -n "${ZY_SVR_SV_PORT:-}" ]; then + echo "ZY_SVR_SV_PORT=${ZY_SVR_SV_PORT}" >> "$KEYS_FILE" + fi + chmod 600 "$KEYS_FILE" echo "" diff --git a/server/proxy/service/subscription-server-v3.js b/server/proxy/service/subscription-server-v3.js index 8887158a..b130c26d 100644 --- a/server/proxy/service/subscription-server-v3.js +++ b/server/proxy/service/subscription-server-v3.js @@ -192,6 +192,26 @@ function buildStaticNodes() { }); } + // 节点4: 硅谷服务器 (ZY-SVR-SV · Claude专线 · 美国IP出口) + // 冰朔D61: 硅谷服务器已配置,新增Claude单独访问VPN节点 + // 用户访问claude.ai等AI服务时优先走此节点(美国IP) + const svHost = getEnvOrKey('ZY_SVR_SV_HOST'); + const svPbk = getEnvOrKey('ZY_SVR_SV_REALITY_PUBLIC_KEY'); + const svSid = getEnvOrKey('ZY_SVR_SV_REALITY_SHORT_ID'); + const svPort = parseInt(getEnvOrKey('ZY_SVR_SV_PORT') || '443', 10); + if (svHost && svPbk && svSid) { + nodes.push({ + id: 'zy-sv-claude', + name: '🇺🇸 光湖-SV(Claude专线)', + host: svHost, + port: svPort, + pbk: svPbk, + sid: svSid, + region: 'us-sv', + priority: 4 + }); + } + return nodes; } @@ -279,8 +299,12 @@ ${nodeNames} : `${nodeNames}\n - DIRECT`; // AI/开发工具代理组的节点列表 + // Claude专线优先: 如果有硅谷节点,AI服务组把它放最前面 + const svNode = nodes.find(n => n.region === 'us-sv'); const toolProxies = nodes.length > 1 - ? ` - "♻️ 自动选择"\n${nodeNames}` + ? (svNode + ? ` - "${svNode.name}"\n - "♻️ 自动选择"\n${nodeNames}` + : ` - "♻️ 自动选择"\n${nodeNames}`) : nodeNames; return `# 光湖语言世界 · ${user.label} 的独立专线 — 冰朔开发维护 diff --git a/server/proxy/service/zy-cloud-vpn.js b/server/proxy/service/zy-cloud-vpn.js index 6166a651..8b0a604a 100644 --- a/server/proxy/service/zy-cloud-vpn.js +++ b/server/proxy/service/zy-cloud-vpn.js @@ -298,6 +298,17 @@ class ZyCloudVpn extends LivingModule { seenIds.add('zy-cn-relay'); } + // 节点4: 硅谷服务器 (ZY-SVR-SV · Claude专线 · 美国IP出口) + // 冰朔D61: 硅谷服务器已配置,新增Claude单独访问VPN节点 + const svHost = this._readEnvOrKey('ZY_SVR_SV_HOST'); + const svPbk = this._readEnvOrKey('ZY_SVR_SV_REALITY_PUBLIC_KEY'); + const svSid = this._readEnvOrKey('ZY_SVR_SV_REALITY_SHORT_ID'); + const svPort = parseInt(this._readEnvOrKey('ZY_SVR_SV_PORT') || '443', 10); + if (svHost && svPbk) { + nodes.push(this._makeNode('zy-sv-claude', '🇺🇸 铸渊专线V2-SV(Claude)', svHost, svPort, svPbk, svSid || '', 'us-sv', 'ZY-SVR-SV', 'remote', '硅谷')); + seenIds.add('zy-sv-claude'); + } + // ── 源2: 动态注册表(通过HLDP/API注册的节点)── // 这些是"像路由器一样插入"的节点 for (const regNode of Object.values(this._registry.nodes)) {