fix: add taro h5 release guardrails

This commit is contained in:
Codex
2026-07-01 00:49:18 +08:00
parent 53c96067ec
commit d2273e9b12
8 changed files with 359 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
# Taro H5 三入口部署说明
更新时间2026-06-30
更新时间2026-07-01
当前 `apps/taro` 采用一个 Taro 4 React 工程、三套 H5 产物的方式交付:
@@ -26,6 +26,8 @@ apps/taro/dist/h5-tenant-admin
apps/taro/dist/h5-platform-admin
```
注意Taro H5 入口依赖 `apps/taro/src/index.html` 模板生成 `index.html`。如果构建产物目录里只有 `js/css/assets` 而没有 `index.html`,不要发布;重新构建并运行发布守卫脚本。
推荐部署:
| 域名 | 静态目录 | 说明 |
@@ -186,6 +188,14 @@ H5 正式回归时建议把前端登录态切到 Supabase Auth并观察业务
npm run check:taro
```
构建后再运行 H5 发布守卫脚本:
```bash
node scripts/taro-h5-release-guardrails-test.js --require-dist
```
该脚本会检查三套 H5 产物是否存在 `index.html`,源码和产物是否混入 `x-user-id`、`x-platform-admin-key`、PocketBase 引用、数据库连接串、服务端密钥形态,并检查运行时配置示例只包含公开字段。若还没有把真实 `runtime-config.json` 放入静态目录,会显示 warning正式发布前必须在每个 H5 目录根部补齐该文件。
7. 收集生产上线证据并运行 launch gate
```bash
@@ -195,7 +205,7 @@ H5 正式回归时建议把前端登录态切到 Supabase Auth并观察业务
证据文件只保存命令摘要、artifact 路径、审批人和时间,不保存真实 access token、支付密钥、对象存储密钥或用户隐私明细。真实 artifact 建议放在 `docs/refactor/launch-artifacts/`,该目录不入 Git。
8. 打开三个域名,确认启动页能解析租户,登录后接口请求使用 `Authorization` 和正确的 `x-tenant-id`。
8. 打开三个域名,确认 `index.html` 正常加载,启动页能解析租户,登录后接口请求使用 `Authorization` 和正确的 `x-tenant-id`。
## 安全审计边界