chore: add 105 runtime and openhands ops tooling

This commit is contained in:
john
2026-06-29 07:01:26 +08:00
parent 65e8a3a5a8
commit d7cbf3cc96
22 changed files with 1263 additions and 50 deletions
+58
View File
@@ -56,6 +56,64 @@
**不要**使用已停用的 `rsync_to_server.sh` 或直接 rsync 到 `105` 作为常规发布手段(见 `PRODUCTION_RELEASE_RULES.md`)。
## 105 Portal runtime 发布
`105` 上当前 H5 由 `systemd` 服务 `goose-h5` 运行,真实目录是:
```text
/root/tkmind_go/ui/h5
```
发布 `105` 的 Portal / 微信服务号相关能力时,必须走 **runtime artifact**,不要直接发源码树:
```bash
cd /Users/john/Project/Memind
# 仅预演,不切换 live
bash scripts/release-portal-runtime-105.sh --dry-run
# 正式发布到 105
bash scripts/release-portal-runtime-105.sh --yes
```
### 这条发布链的关键规则
1. 本地先把 `server.mjs``mindspace-sandbox-mcp.mjs` 打成 runtime bundle,再连同 `dist/``public/``schema.sql`、启动脚本一起打包。
2. **不要**把本机 Mac 的 `node_modules` 直接打进包发到 `105`
`105` 是 Linux,像 `@node-rs/argon2` 这类原生依赖会因为平台不匹配而启动失败。
3. `105` 的 runtime 包默认**不带** `node_modules`;切换前会在 `105` 本机执行:
```bash
npm install --omit=dev --no-package-lock
```
确保安装的是 Linux 可用依赖。
4. 发布时默认保留这些持久项,不覆盖:
- `.env`
- `MindSpace/`
- `data/`
- `users/`
- `logs/`
- `public/plaza-covers/`
5. 发布完成后必须验:
```bash
ssh root@120.26.184.105 '
systemctl is-active goose-h5
curl -sf http://127.0.0.1:8080/api/status
'
```
正确结果应为:
- `goose-h5` = `active`
- `/api/status` 返回 `ok`
### 禁止事项(105 runtime
- 禁止把 `node_modules/` 从本机打包后直接发到 `105`
- 禁止在 `105` 直接改 `server.mjs` / `wechat-mp.mjs` / `scripts/wechat-mp-menu.mjs`
- 禁止跳过健康检查就宣称“已发布”
## 服务号底部菜单(`wechat-mp-menu.mjs`
菜单名称与链接定义在本地: