Clone
5
Task-71-Supervisor-GoAuto-services
QiuSW edited this page 2026-09-21 16:13:32 +08:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

71 使用 Supervisor 托管 GoAuto Admin API 与 Admin UI

  • 类型:本机开发环境
  • 状态:待验收
  • 日期:2026-08-24
  • Gitea 工单:#71
  • 实现提交:ca0c81b

需求与范围

在已安装的 D:\supervisor 中新增两个 GoAuto 实例:goauto-admin-api 和 goauto-admin-ui。不修改数据库、端口、业务接口、Android 服务地址或现有 Chorus 实例,不在 Supervisor 配置中保存密码。

实现

  • 新增版本化配置 scripts/supervisor/goauto.conf,部署副本为 D:\supervisor\programs\goauto.conf。
  • 两个实例启用自动启动、异常重启、启动重试、进程组停止和独立滚动日志。
  • API 复用 scripts/start-server.ps1,从根目录 config.yaml 读取 MySQL 和 8010 端口。
  • UI 复用 scripts/start-web.ps1,从同一配置读取 9527 和 API 地址。
  • 由于 Supervisor Windows 子进程不能可靠地让 npm 的 pnpm.cmd / Vite 包装器解析 Node PATH,启动脚本会定位 node.exe,用它直接执行 pnpm CLI(仅依赖安装时)和项目 Vite CLI。
  • 长期启动、控制和日志说明已写入 Local Development and Verification Wiki;Delivery Issues 已加入 T58。

运行结果

  • goauto-admin-api:RUNNING。
  • goauto-admin-ui:RUNNING,执行一次 Supervisor restart 后仍恢复 RUNNING。
  • http://127.0.0.1:8010/api/v1/health:HTTP 200。
  • http://127.0.0.1:9527/:HTTP 200。
  • 三个既有 Chorus 实例保持 RUNNING。
  • 仓库配置与部署配置 SHA-256 一致。
  • 两个 GoAuto 日志未检出本机数据库密码。

验证

  • PowerShell Parser:scripts/start-web.ps1 无语法错误。
  • scripts/start-web.ps1 -ValidateConfigOnly:通过。
  • .\scripts\verify.ps1 -Component web:通过;lint 0 error、30 个既有 warning,生产构建成功。
  • python dev_scripts/harness.py check --strict:通过。
  • python dev_scripts/harness.py sync --check:通过。
  • Supervisor ctl status、端口监听、API/UI HTTP 和日志检查:通过。

文档与参考

  • Local Development and Verification Wiki revision:fbd334cc639f9053388af09319f34faf1dc4a5ab。
  • Delivery Issues Wiki revision:0eed28dd5dc629ce66071833d5fefbdf24d567d3。
  • Go Supervisor 官方说明:https://github.com/ochinchina/supervisord

遗留

  • 等待用户验收;用户明确验收前不关闭 #71。