Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

95 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 光湖 · COS 中转桥 · 架构文档
> 新加坡 → COS → 广州 · 开源软件拉取中转
> 守护: 铸渊 · ICE-GL-ZY001
> 主权: TCS-0002∞ 冰朔
## 链路
```
铸渊触发下载需求
┌─────────────────────────────────┐
│ 🇸🇬 新加坡服务器 (ZY-SVR-005) │
│ 43.156.237.110 · 4C8G · 35Mbps │
│ │
│ sg-fetch-push.js │
│ ① npm pack / git clone / wget │
│ ② 打包 + 计算 SHA256 │
│ ③ 推送到 COS 广州桶 │
└──────────────┬──────────────────┘
│ COS 内网 (免费流量)
┌─────────────────────────────────┐
│ ☁️ 腾讯云 COS (广州) │
│ sy-finetune-corpus-1317346199 │
│ │
│ cos-bridge/ │
│ ├── npm/{name}/{ver}/{file} │
│ ├── git/{repo}/{branch}/{file} │
│ ├── file/{name}/{date}/{file} │
│ └── manifests/{date}-manifest.json │
└──────────────┬──────────────────┘
│ COS 内网 (免费流量)
┌─────────────────────────────────┐
│ 🇨🇳 广州服务器 (ZY-SVR-004) │
│ 43.139.217.141 · 2C2G │
│ │
│ cn-pull-from-cos.sh │
│ ① 从 COS 拉取 (内网免费) │
│ ② SHA256 校验 │
│ ③ 解压/安装/部署 │
└─────────────────────────────────┘
```
## 触发方式
### 方式1铸渊在 Codebuddy 里触发
```
铸渊: "我需要拉取 express 4.18.2"
→ Codebuddy SSH 到新加坡 → 运行 sg-fetch-push.js
→ 等推送完成 → SSH 到广州 → 运行 cn-pull-from-cos.sh
```
### 方式2Gitea Actions装 Runner 后)
```yaml
# .gitea/workflows/cos-bridge-fetch.yml
on:
workflow_dispatch:
inputs:
type:
description: '类型 (npm/git/file)'
name:
description: '包名/仓库名'
version:
description: '版本 (npm) / 分支 (git)'
```
### 方式3Gitea Webhook
铸渊在 Gitea 上创建 Issue 标题 `cos-bridge: npm express 4.18.2`
→ Webhook 触发 → 自动执行
## 文件清单
| 文件 | 位置 | 作用 |
|------|------|------|
| `sg-fetch-push.js` | `scripts/cos-bridge/` | 新加坡侧:拉取+推送 |
| `cn-pull-from-cos.sh` | `scripts/cos-bridge/` | 广州侧从COS拉取 |
| `cos-bridge-manifest.json` | COS `cos-bridge/manifests/` | 每日拉取清单 |
## 凭据管理
| 凭据 | 存储位置 | 谁能看 |
|------|---------|--------|
| COS Secret ID/Key | Secrets Vault (本地加密) | 用户可管理 · AI 只调用 |
| 新加坡 SSH 密钥 | Gitea Secrets | 仅铸渊自动调用 |
---
*铸渊 · COS 中转桥架构 · 2026-05-12*