docs: docs/ 目录同步甲骨文部署事实(上一提交漏加)

上一个提交 git add 漏了 docs/,架构/开发/需求/auth-hub 集成文档里的 NAS
IP、8124 端口还是旧的,补上。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ericwyuan
2026-09-12 23:53:26 +08:00
parent 9d6ebbe422
commit 4331a07462
4 changed files with 25 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
# 项目架构说明
> 现状2026-09-02后端为 **Python/Flask 单体**,生产部署在 **NAS :8124**
> 现状2026-09-12后端为 **Python/Flask 单体**,生产部署在**甲骨文云主机**
> `garmin.zichuan.xyz`,此前是 NAS :8124已整体迁移
> 早期 Node.js/Express + `server/` 目录的后端已被整体重写为
> `backend/`Python本文件描述的是当前实现。
@@ -17,7 +18,7 @@
│ HTTP/JSON + JWTBearerCopilot 用 SSE
┌──────────────────────────────────────────────────────────┐
Flask 单体gunicorn 2w/4tNAS :8124
│ Flask 单体gunicorn 2w/4t甲骨文云主机 :5500
│ ┌────────────────────────────────────────────────────┐ │
│ │ 蓝图层 routes/ /api/auth /api/garmin /api/health │ │
│ │ /api/analysis /api/settings │ │
@@ -142,16 +143,20 @@ Copilot: POST /analysis/copilot 走 SSE(stream_chat失败非流式回退)
- **Development 本地**`npm run dev` = Flask 5000`BACKEND_PORT` 固定,避开
`PORT` 被 CRA 抢占)+ CRA dev server 3000proxy → 5000。SQLite。
- **Production NAS**`192.168.50.64` `/volume1/web/garmin-health-lab`root
跑 gunicorn `0.0.0.0:8124`2w/4t--timeout 300 —— AI 生成可长达分钟级),
开机自启 DSM 任务调度器 → `deploy/S99garmin.sh`MariaDB 10.11
root@`/run/mysqld/mysqld10.sock`,库 `garmin_health_lab`。
- **公网**NAS frpc → 甲骨文 `129.146.26.249:8124`frp 隧道,重连需数秒)。
- **一键部署**`deploy/push.sh`tar-over-ssh 同步 backend+deploy、清空重推
`client/build`、sudo 重启、**pid 变化 + health 200 双校验**);前端先
`npm run build`。`deploy/start.sh` / `stop.sh` 供手工与开机脚本调用
- **auth-hub**:回调注册 LAN `192.168.50.64:8124` 与公网 `129.146.26.249:8124`
两个地址(client `996aLPw4T5gl-rYZ`CORS 白名单含两地址 + localhost。
- **Production**(甲骨文云主机,`129.146.26.249``/opt/garmin-health-lab`
`ubuntu` 用户跑 gunicorn `127.0.0.1:5500`2w/4t--timeout 300 —— AI 生成
可长达分钟级systemd 单元 `garmin-health-lab.service``enabled`
`Restart=always`MariaDB 10.3.39 本机 TCP、独立账号 `garmin`,库
`garmin_health_lab`。和这台机器上的 ai-gateway/auth-hub/fam-edge 同一套
部署约定。此前2026-09-01~12部署在 NAS已整体迁移并下线。
- **公网**Caddy 反代 `https://garmin.zichuan.xyz` → `127.0.0.1:5500`
TLS 自动签发
- **一键部署**`deploy/push_oracle.sh`ssh key 认证同步 backend、清空重推
`client/build`、pip install、systemctl restart、**PID 变化 + health 200
双校验**);前端先 `npm run build`。NAS 时代的 `deploy/push.sh` /
`start.sh` / `stop.sh` / `S99garmin.sh` 已废弃,保留仅供参考。
- **auth-hub**:回调只注册 `https://garmin.zichuan.xyz/auth/callback`
一条client `996aLPw4T5gl-rYZ`CORS 白名单含该地址 + localhost。
## 关键设计约束