Commit Graph

4 Commits

Author SHA1 Message Date
wangjia a879494fe1 feat(monitor): 1 分钟采集 + 连续 N 次异常才告警(去抖)
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
避免瞬时尖峰/部署窗口误报(此前 sing-box 部署期 activating 触发了一次误报)。
- 采集间隔 5min → 1min(MONITOR_INTERVAL_MIN=1)
- 新增 MONITOR_BREACH_RUNS=5:连续 5 次采样都异常才告警一次(状态存
  /var/lib/pangolin-monitor/breach_count);恢复后发一条恢复通知并清零
- 去掉 MONITOR_SEND_OK_PULSE(被去抖逻辑取代)
- 已在 racknerd 验证:连 4 次异常不报、恢复清零

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 08:05:09 +08:00
wangjia 1d76c00f66 chore(bootstrap): 监控阈值降至 80% + 关闭正常心跳(仅异常告警)
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
CPU/MEM/DISK 阈值 90/90/85 → 统一 80;MONITOR_SEND_OK_PULSE true → false
(默认只在异常时推送,正常不打扰)。同步 init.sh 默认值与 bootstrap.env.example。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 07:17:22 +08:00
wangjia d8b8752ec4 fix(bootstrap): monitor env 含空格的值加引号(MONITOR_UNITS 等)
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
/etc/pangolin-monitor.env 既被 systemd EnvironmentFile 读、也被 monitor 脚本
source(shell)。未加引号时 `MONITOR_UNITS=sing-box pangolin-agent` 被 shell
解析成"带环境变量跑 pangolin-agent 命令" → command not found 且单元监控失效。
给 NODE_NAME/MONITOR_UNITS/MONITOR_NET_PROBE 加引号修复。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 07:13:26 +08:00
wangjia ff9a40277d feat(deploy/bootstrap): 节点幂等初始化脚本(加固+pangolin用户+监控+防火墙)
全新 Debian 12 一键初始化,后续新机复用。四块:
- 系统:apt 升级+基础包(含 python3-systemd)、时区、swap 补足、sysctl(BBR/fq/句柄/队列)
- Pangolin:建 pangolin 非特权系统用户(/var/lib/pangolin, nologin)
- 网络安全:ufw 默认拒入站、放行 SSH+443(tcp/udp);fail2ban sshd jail
  (精简 Debian 无 rsyslog/auth.log → backend=systemd 读 journald)
- SSH 加固:root 仅密钥、可选禁密码(仅当已有 authorized_keys 时生效,防锁死)
- 监控:pangolin-monitor(systemd timer,CPU/内存/磁盘/进程/出网 → Telegram,
  异常+心跳);deadman-watch(EC2 侧主动探活,补"宕机/不上报"告警)

已在 racknerd(107.172.55.251)实跑验证全部步骤通过。密钥/真实配置 gitignore。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 01:30:55 +08:00