nomadro/deploy/observability/README.md
eric 9f8fec1723 Ship portal PC/H5 acceptance, VIP ScrollReader, admin analytics and ops anchors.
Adds /api/health, ntfy notify on config save, /admin/analytics charts, and deploy smoke for miniprogram config/API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 23:52:00 -05:00

62 lines
1.7 KiB
Markdown
Raw Blame History

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.

# Nomadro observability (Umami + Uptime-Kuma + ntfy)
## DNS(Cloudflare)
- `umami.nomadro.cn` → `82.157.112.245`
- `uptimekuma.nomadro.cn` → 同上
- `ntfy.nomadro.cn` → 同上
- `s3.nomadro.cn` / `minio` → SeaweedFS / MinIO
## URLs
| 服务 | URL |
|------|-----|
| 行为分析 | https://umami.nomadro.cn |
| 可用性 | https://uptimekuma.nomadro.cn |
| 即时通知 | https://ntfy.nomadro.cn |
| 门户探针 | https://nomadro.cn/api/health |
| 远程配置 | https://nomadro.cn/api/config |
| 后台统计 | https://nomadro.cn/admin/analytics |
## 后台
- `/admin/analytics`:延迟柱状图、模块开关环图、一键 ntfy
- `/admin/ops`:运维入口与 Kuma 探针清单
- 改远程配置成功后会即时推 ntfy(需服务器 `NTFY_*`)
## 服务器凭证
```bash
cat /etc/nomadro/umami.env
cat /etc/nomadro/ntfy.env
cat /etc/nomadro/umami-sites.env
```
门户 `.env` / systemd 环境:
```bash
NTFY_BASE_URL=https://ntfy.nomadro.cn
NTFY_TOPIC=nomadro
NTFY_TOKEN=...
NEXT_PUBLIC_UMAMI_WEBSITE_ID=...
NEXT_PUBLIC_UMAMI_SCRIPT_URL=https://umami.nomadro.cn/script.js
NOMADRO_PUBLIC_ORIGIN=https://nomadro.cn
```
## 手动通知
```bash
notify-ntfy "Title" "message" high "rotating_light" nomadro
# 或
curl -H "Title: test" -d "hello" https://ntfy.nomadro.cn/nomadro
```
健康检查:`deploy/observability/healthcheck.sh`(建议 cron 每 5 分钟),失败/恢复边沿推 ntfy。
## 门户部署(日常)
1. 本地 `pnpm build`
2. `python deploy/observability/_upload_next_deploy.py`(拉 `pre1` + 上传 `.next` + 重启 `nomadro.service`)
3. 冒烟:`/api/health` `/api/config` `/book/read` `/vip/ebook/read` `/admin`
4. 更新根 README / 本文件