feat: add configurable payments and Gitea staging delivery
Staging Backend Quality Gate (push the reviewed main SHA to staging to auto-deploy) / validate (push) Failing after 5m10s
Staging Backend Quality Gate (push the reviewed main SHA to staging to auto-deploy) / publish-and-deploy (push) Has been skipped

Add database-backed administrators, configurable Alipay packages, idempotent payment settlement and platform reporting. Standardize Gitea workflows on the xiaoxin runner so reviewed staging commits are tested, packaged, and deployed by immutable image digest.
This commit is contained in:
linmeng
2026-07-27 20:19:05 +08:00
parent 9dc115509e
commit 1b8d6fcce6
37 changed files with 1257 additions and 28 deletions
+16
View File
@@ -1503,3 +1503,19 @@
- 防复发:开放叙事不等于被动倾听;事件轮默认负责自然推进,但不得恢复固定问卷模板。
- 相关记录:BUG-075、BUG-080
- 修复版本:本次修复提交
## BUG-082 | Gitea 工作流混用 runner、外部 Actions 与重复 staging 触发
- 状态:resolved
- 首次发现:2026-07-27
- 最近更新:2026-07-27
- 影响面:Gitea CI、测试镜像发布、测试服务器部署、手动回滚与数据库迁移
- 用户现象:部分 Gitea workflow 仍使用 `ubuntu-latest`、GitHub Actions checkout/setup 和旧 Gitea Registry`ci.yml` 与 staging 质量门禁同时监听 staging push,可能重复测试,而手动部署/迁移又把服务器上一版本硬编码成 `not-deployed`
- 触发条件:向 staging 推送已合入 main 的 SHA,或手动执行测试环境重部署、回滚和迁移。
- 根因:工作流从 GitHub 与旧 Gitea Registry 迁移时只改造了自动 staging 主链,没有建立覆盖 `.gitea/workflows/*.yml` 的统一 runner、checkout、触发器、镜像仓库和前序部署状态审计。
- 修复:全部 job 统一使用 `xiaoxin`,以原生 bash、git fetch 和 detached checkout 取代外部 Actions,并显式检查 runner 的 Python、Node、npm、Docker。仅 `backend-quality-gate.yml` 保留 staging push 自动入口,校验通过后向现有 ACR 共享仓库发布 `api-SHA`/`web-SHA` 并按 digest 部署;其余发布、生产、迁移及回滚入口保持手动。手动 staging 部署和迁移改为校验 full SHA 属于 main、使用 ACR digest、读取服务器当前 SHA,并默认只允许前向变更。
- 验证:PyYAML `safe_load` 覆盖全部 Gitea YAML;相关 staging shell 脚本以 LF 输入通过 `bash -n`;新增的 3 项 Gitea workflow 审计与 3 项 image manifest 回归通过;禁用项扫描确认不存在 `ubuntu-latest`、GitHub Actions URL 或旧 Registry secret 名。完整双文件命令在当前 Windows/WSL 环境仍被既有 GitHub workflow 文本断言和 Windows 路径传给 WSL bash 的兼容问题阻塞,未伪报全量通过。
- 防复发:工作流审计测试枚举全部 `.gitea/workflows/*.yml`,逐 job 锁定 `runs-on: xiaoxin`、原生 checkout、唯一 staging push 所有者、manual-only 高风险入口、ACR digest 主链和禁止的旧平台/Registry 标识。
- 相关记录:无
- 复发自:无
- 修复版本:待提交(本地可测)