145 lines
5.3 KiB
Markdown
145 lines
5.3 KiB
Markdown
# Nexus — `nx` 上帝菜单巡检归档(2026-06-06)
|
||
|
||
| 项 | 内容 |
|
||
|----|------|
|
||
| 日期 | 2026-06-06 |
|
||
| 范围 | `deploy/nx`、`nexus-1panel.sh`、`update.sh`、安装向导、1Panel Docker 生产 |
|
||
| 生产 | `azureuser@20.24.218.235` · `/opt/nexus` · `https://api.synaglobal.vip` |
|
||
| 关联 SSOT | [nexus-1panel-operations-knowledge.md](nexus-1panel-operations-knowledge.md) · [deploy/README-1panel.md](../../deploy/README-1panel.md) |
|
||
|
||
---
|
||
|
||
## 1. 背景
|
||
|
||
2026-06-06 对 **1Panel + Docker 生产** 路径做连续巡检:修复 502、安装锁、网络、备份、cron、部署脚本分流、镜像与文档漂移。本文档为 **round1–10 归档索引**;细节见各轮 `docs/changelog/2026-06-06-nx-god-menu-audit-round*.md`。
|
||
|
||
---
|
||
|
||
## 2. 巡检轮次一览
|
||
|
||
| 轮次 | 提交(代表) | 主题 | 关键交付 |
|
||
|------|-------------|------|----------|
|
||
| 预修 | `107b089` `dd66d99` | 502 / 安装锁 / 1panel-network | 锁持久化、`verify_nexus_1panel_network`、nx 菜单修补 |
|
||
| 归档 | `58bdf82` | install.html 锁定归档 | `install.html` → `.bak`,外网 404 |
|
||
| R2 | `687e059` | 全新安装 vs 卷冲突 | `FRESH_INSTALL` 清卷、验收 404 预期、回滚网络 |
|
||
| R3 | `61b8d7d` | health_monitor Docker | `docker restart`、端口/Telegram 从容器读 |
|
||
| R4 | `4e1347b`–`ba69bc3` | MySQL 备份 + cron | `mysql_dump_to_file.sh`、`install_ops_cron.sh`、`nx cron` |
|
||
| R5 | `89865ec` | 部署运行时分流 | `detect_deploy_runtime.sh`、`upgrade.sh` Docker 委托 |
|
||
| R6 | `c9e0879` | 守护配置对齐 | `host_deploy_root`、验收 cron/备份检查 |
|
||
| R7 | `e5d4822` | 向导 UI | Layer 3 cron 步骤、guardian 分色 |
|
||
| R8 | `72e46ce` | 镜像验收 | `check_container_image_features`、升级后 `nx verify` |
|
||
| R9 | `fb9dbcb` | 运维文档 | README + 知识文档同步 round4–8 |
|
||
| R10 | — | 本文档 | 归档索引 + 日常速查 |
|
||
|
||
---
|
||
|
||
## 3. 当前 `nx` 能力矩阵
|
||
|
||
| 入口 | 用途 |
|
||
|------|------|
|
||
| `nx` / 菜单 | 安装、更新、重启、日志、备份、cron、验收 |
|
||
| `nx update` | `git pull` + MySQL 备份 + 重建镜像 + 健康检查 +(TTY)cron 提示 + 验收 |
|
||
| `nx verify` | `verify-1panel-install-wizard.sh` |
|
||
| `nx cron` | `install_ops_cron.sh`(health_monitor + db_backup) |
|
||
| `nx health` | 状态 + `/health` |
|
||
| `bash deploy/upgrade.sh` | 自动识别 Docker → `nexus-1panel.sh upgrade` |
|
||
|
||
### 菜单项(已安装)
|
||
|
||
| 键 | 功能 |
|
||
|----|------|
|
||
| `[3]` | 状态 / health / install.html 归档 |
|
||
| `[4]` | 一键更新 ★ |
|
||
| `[5]`–`[8]` | 重启 / 日志 / Compose / 重建 |
|
||
| `[9]` | 立即 MySQL 备份 |
|
||
| `[e]` | 安装 cron |
|
||
| `[v]` | 验收脚本 |
|
||
|
||
---
|
||
|
||
## 4. 三层守护(Docker 生产)
|
||
|
||
```
|
||
Layer 1 Compose restart + healthcheck (容器内)
|
||
Layer 2 Python self_monitor(30s) (容器内)
|
||
Layer 3 health_monitor.sh(cron,宿主机) → docker restart + Telegram
|
||
db_backup.sh(cron 03:00) → /var/backups/nexus/
|
||
```
|
||
|
||
**Layer 3 必须在宿主机安装**:`sudo nx cron`(容器内无法写 crontab)。
|
||
|
||
---
|
||
|
||
## 5. 日常运维速查
|
||
|
||
```bash
|
||
cd /opt/nexus
|
||
|
||
# 更新(推荐)
|
||
sudo nx update
|
||
|
||
# 验收(已安装应全 PASS,install.html → 404)
|
||
sudo nx verify
|
||
|
||
# 手动备份
|
||
sudo bash deploy/db_backup.sh
|
||
|
||
# 查看 cron
|
||
sudo crontab -l | grep nexus
|
||
|
||
# 外网健康
|
||
curl -sk https://api.synaglobal.vip/health
|
||
```
|
||
|
||
### 升级选项
|
||
|
||
| 标志 | 含义 |
|
||
|------|------|
|
||
| `--no-backup` | 跳过 MySQL 备份 |
|
||
| `--no-cache` | 无缓存重建(Dockerfile/entrypoint 变更后) |
|
||
| `--require-backup` | 备份失败则中止 |
|
||
| `--check` | 仅查 Git |
|
||
|
||
---
|
||
|
||
## 6. 生产验收标准(已安装)
|
||
|
||
`sudo nx verify` 关键项:
|
||
|
||
- `/health` → `ok`
|
||
- `/app/install.html` → **HTTP 404**(已归档)
|
||
- Nexus 在 `1panel-network`
|
||
- Crontab 含 `nexus-health-monitor` / `nexus-mysql-backup`
|
||
- 容器 `install.py` 含 `_host_deploy_root`
|
||
- `NEXUS_HOST_ROOT=/opt/nexus`
|
||
- HTTPS `/health` → `ok`
|
||
|
||
---
|
||
|
||
## 7. 已知限制与后续
|
||
|
||
| 项 | 说明 |
|
||
|----|------|
|
||
| Supervisor 裸机 | `upgrade.sh` 保留 Supervisor 路径;1Panel 生产以 Docker 为准 |
|
||
| 安装向导 UI | 改动在镜像内,需 `nx update` 重建后生效 |
|
||
| 前端 14 页 | 本次巡检未改 SPA;见 `reports/audit-frontend-14p-*` |
|
||
| 凭据轮询 | 并行功能见 `credential-polling-pending-servers` changelog |
|
||
|
||
---
|
||
|
||
## 8. Changelog 索引(本轮系列)
|
||
|
||
- [round2](../changelog/2026-06-06-nx-god-menu-audit-round2.md)
|
||
- [round3 health_monitor](../changelog/2026-06-06-nx-god-menu-audit-round3-health-monitor.md)
|
||
- [round4 mysql/cron](../changelog/2026-06-06-nx-god-menu-audit-round4-mysql-backup-cron.md)
|
||
- [round5 runtime](../changelog/2026-06-06-nx-god-menu-audit-round5-deploy-runtime-detect.md)
|
||
- [round6 guardian](../changelog/2026-06-06-nx-god-menu-audit-round6-guardian-verify-cron.md)
|
||
- [round7 wizard UI](../changelog/2026-06-06-nx-god-menu-audit-round7-install-wizard-cron-prompt.md)
|
||
- [round8 image verify](../changelog/2026-06-06-nx-god-menu-audit-round8-image-verify-upgrade.md)
|
||
- [round9 docs](../changelog/2026-06-06-nx-god-menu-audit-round9-ops-docs.md)
|
||
- [round10 summary](../changelog/2026-06-06-nx-god-menu-audit-round10-summary.md)
|
||
|
||
---
|
||
|
||
*巡检由 Agent 执行并留证;用户终验见 [2026-06-01-final-acceptance-checklist.md](2026-06-01-final-acceptance-checklist.md)。*
|