SlaunchX DevOps / 运维 OPS / 平台架构

← 返回门户

SlaunchX 本地平台架构

采集实测 2026-08-18。覆盖主机角色、VPN 拓扑、Cloudflare 隧道入口、存储、CI、备份。 公网只经 Cloudflare 隧道 (无开放入站端口), 隧道落到网关机 n-00008。

主机角色

主机 hostname VPN IP (tun0) 角色
n-00007 slaunchx-n-00007 10.8.0.3 内部服务 + test/alpha 环境宿主 (gitea/CI/registry/可观测/OpenBao/notify)
n-00008 slaunchx-n-00008 10.8.0.4 边缘网关: cloudflared 隧道 (cf-tunnel) + nginx :80 反代 + Uptime-Kuma/Smokeping
n-00006 slaunchx-n-00006 10.8.0.7 本地生产面 (product: lampay/elaypay 两栈)
n-00006(alt) (未编档) 10.8.0.6 另一 product 对等机, 被网关 nginx 反代 (20020/21020/22020); 本轮未采集
  • 网关 n-00008 是小规格 VM (2 vCPU / 3.5G 内存 / 49G 系统盘, 49% 用) — 容量偏紧, 属单点边缘。
  • VPN 段虚拟网关 10.8.0.1; 三台业务机默认路由经 10.8.0.1 (openvpn redirect-gateway 拆半)。

VPN 拓扑 (三套 OpenVPN, 每机三隧道)

网段 隧道 服务端 (public:port) n-00006 n-00007 n-00008
slaunchx-vpn 10.8.0.0/24 tun0 见下 (按机不同) .7 .3 .4
mgmt 10.8.20.0/24 tun1 191.222.214.72:4443 (hub-a UVP328) .112 .113 .114
mgmt-usa 10.8.21.0/24 tun2 64.186.238.106:4443 (hub-b DNJ269) .112 .113 .114

主内网 (10.8.0.0/24) 各机拨入的公网入口不同 (多前端并入同一网段):

  • n-00007 → 47.242.79.110:36192 (香港 / Aliyun 出口)
  • n-00006 → 64.186.238.106:15957 (美国 hub-b)

proto 全部 tcp-client。VPN 集中管理面 vpncentre 跑在 n-00007 (vpncentre-central 8787-8788), 各机 vpncentre-agent + openvpn-client-watchdog 保活。

Cloudflare 隧道入口 (tunnel slaunchx-nginx, id 8da8d702-…, 落 n-00008)

隧道健康, 46 条 ingress。绝大多数 hostname → http://127.0.0.1:80 (网关本机 nginx, 再按 server_name 反代到 VPN 内后端); 少数直接跨 VPN 指向后端:

类别 hostname 隧道 service
业务对外 (test/alpha) test/alpha/api-*/consumer-*/partner-*/tenant-*/system-*.slaunchx.cc http://127.0.0.1:80 → nginx → 10.8.0.3:18020/19020
业务对外 (product) *.lampay.app / *.elaypay.app / *.itradexhub.com / slash.biteoify.us http://127.0.0.1:80 → nginx → 10.8.0.6/10.8.0.7:2x020
代码/CI gitea.slaunchx.cc→nginx→10.8.0.3:23000; gitea-ssh.slaunchx.ccssh://10.8.0.3:2222; docker-registry10.8.0.3:5000; drone.slaunchx.cc10.8.0.3:21080
可观测 grafana10.8.0.3:23030; kuma→nginx; uptime-kuma127.0.0.1:3001 (n-00008 本机); smokeping-test127.0.0.1:3002 (n-00008 本机)
控制台 (127.0.0.1 类) bao / minio-drone / minio-test / minio-alpha / rabbitmq-test / rabbitmq-alpha.slaunchx.cc http://10.8.0.3:8088 (n-00007 控制台 nginx, 见 CONSOLES.md)
人机验证 cap.slaunchx.cc http://10.8.0.3:8088127.0.0.1:23300 (Cap Standalone; widget 公网, 无 Access)
其他 vpn.slaunchx.cc, webhook-receiver-test, doc.slaunchx.cc http://127.0.0.1:80
catch-all * http_status:404

文档站本身 (devops.slaunchx.cc) 不走隧道, 是 Cloudflare Pages 部署 (见 wrangler.toml + CI)。

网关 nginx 反代要点 (n-00008)

  • app-prometheus 按路径前缀 (/prometheus/{api,web}/v1/{consumer,partner,system,tenant}/) 分流, test→10.8.0.3:18020、alpha→:19020、product→10.8.0.6/10.8.0.720020/21020/22020
  • service-slash/partner/channel/slash/webhook/ 单独反代到 10.8.0.3:18080(test)/:19080(alpha)。
  • 网关另跑 frontend-deploy-service (32080)、remote-promtail-nginx(+backup, 采 nginx 访问日志→Loki)。

存储

n-00007 (双 480G SSD): - sdb (KIOXIA) = 系统盘 slaunchx-intra-vg: root 23G(62%) / home 404G(47%, 179G 用) / var 9G。docker data-root /home/docker-data。 - sda (Kingston) = 数据盘 slaunchx-data-vg: gitea LV 100G 挂 /opt/gitea (98G, 4.2G 用), 约 347G 备用 (增长型数据后续迁独立 LV)。

n-00006 (见该机 README): nvme 系统盘 + sda1 440G /data (docker) + sdb1 916G /backup (闲置)。

n-00008: 单 vda, 49G 系统盘 (49% 用)。

CI 发布链路

  • Gitea Actions runner slaunchx-runner-01 (n-00007, /opt/gitea-runner, label slaunchx-pages) 与 drone 并存, 存量 drone 流水线逐步迁移后退役。
  • 文档站 push main → Gitea Actions → wrangler 部署 Cloudflare Pages (devops.slaunchx.cc)。 仓库 secrets: 低权 CLOUDFLARE_API_TOKEN (slaunchx-workers-deploy, 仅 Pages Edit) + CLOUDFLARE_ACCOUNT_ID
  • 坑: CI token 若开 Client IP Filtering, 白名单须含 runner 公网出口 47.242.79.110 (n-00007 经 vpn-aliyun), 否则 wrangler 报 9109 (见 TUNING.md)。

备份体系

位置 机制
本地备份 n-00007 slaunchx-backup.timer 每日 03:40: gitea dump + 2 个 test MySQL → /home/reynard/backups (retention 14 天)
gitea 保留 n-00007 gitea-backup-retention.timer 每日 03:55 (3 天保留)
异地加密推送 n-00007→大脑机 n7-backup-offsite.timer 每日 04:10: openssl AES-256 加密后 rsync → 大脑机 /opt/slaunchx-fleet-backups/n7
product 备份 n-00006 暂无 (缺口, 见 n-00006 README)

详见 OPERATIONS.md / SECURITY.md。