boardx.com.cn 发不出任何邮件(后台测试邮件 http_500)+ 运营状态屏探活目标未配置、只能看 120 次
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 现象
- `boardx.com.cn/platform-admin/ops-status` 「测试邮件」报 `没发出去(http_500)`;用户提反馈收不到确认/状态变更邮件;注册验证、忘记密码邮件同样发不出。
- 同一屏「服务可用性」一直显示"还没有配置探活目标(DEV_APP_UPTIME_URL)",且窗口只有最近 120 次探活,看不了一天。
- devapp 能发邮件——它的 `/opt/workspacex/deploy.env` 手填了 Cloudflare 邮件变量。
## 根因
1. `packages/cloud-deploy` 渲染的运行时环境(boardx.com.cn 走这条)**从未写入任何邮件变量**:`CLOUDFLARE_ACCOUNT_ID` / `CLOUDFLARE_EMAIL_API_TOKEN` / `MAIL_FROM` / `APP_PUBLIC_URL` 都没有。
2. 生产模式下 `transactionalMailConfig` 懒加载、首次发信时抛普通 `Error`,`SystemMailController` 只映射 `TransactionalMailError`,于是穿透成 500,而不是契约里的 `MAIL_NOT_CONFIGURED`。
3. 探活目标只认 `DEV_APP_UPTIME_URL`,cloud-deploy 部署没人手填。
## 处置
见关联 PR:cloud-deploy 新增 `provision.mailProfile` 并始终注入 `APP_PUBLIC_URL`;API 把配置错误归类为 `configuration_invalid` → 503 `MAIL_NOT_CONFIGURED`;探活目标回退到 `APP_PUBLIC_URL`,窗口改为 24 小时 / 15 分钟一格。
**合入后仍需人工一步**:把 devapp `deploy.env` 里同一组 Cloudflare 值(账号 ID、邮件 API token、`MAIL_FROM`、发信域)填进 boardx.com.cn 的正式部署配置 `mailProfile`,重新渲染部署。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in packages/cloud-deploy and inspect the runtime environment rendering, then read transactionalMailConfig and SystemMailController for the production error path. Check DEV_APP_UPTIME_URL and APP_PUBLIC_URL handling, and compare devapp's /opt/workspacex/deploy.env with the boardx.com.cn deployment. Done means mail configuration is supplied, failures return MAIL_NOT_CONFIGURED rather than HTTP 500, and the availability window and target work as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, devops, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100