fix: 零配置克隆可直接看到数据 + 新增本地运行文档
实测「全新克隆 → node prober/node/index.js」时发现两个问题: 1. **面板是空的**(新手陷阱) public/monitors.json 默认 dataFilter=uptimerobot,但 uptimeRobot.enabled=false (API Key 放在不入库的 local.monitors.json 里)。新克隆的用户没有私有配置, 于是日志显示「探测范围: uptimerobot —— 仅 UptimeRobot(0 个)」,面板永远空白。 改默认为 dataFilter=both:零配置时探测 8 个示例目标,配了 UR 再自行切换口径。 2. DEPLOY-PAGES.md 里写了 `cp local.monitors.json.example` —— 该文件根本不存在。 改成直接启动 + 用 <details> 折叠说明可选的私有配置写法。 另外: - package.json 版本号从 0.1.0 同步到 0.12.3(此前一直漏更) - 新增 docs/DEPLOY-LOCAL.md:最短路径(3 条命令)、三种运行模式、常用参数、 配置示例(http/tcp/banner)、配置分层说明、UptimeRobot 接入、 管理端 2FA 绑定四步、通知配置、开机自启(systemd + NSSM)、八条常见问题 - README 加「本地运行」入口,指向两份部署文档 实测验证:干净克隆 + 默认配置 → 8 个目标、5 在线 3 离线,心率图与事件区块均有数据。
This commit is contained in:
+22
-2
@@ -34,11 +34,31 @@
|
||||
git clone <你的仓库>
|
||||
cd shiroko-monitor
|
||||
|
||||
# 私有配置(不入库):真实地址、API Key 等放这里
|
||||
cp local.monitors.json.example local.monitors.json # 或按下面提示自建
|
||||
# 私有配置(可选):真实地址、API Key 等敏感信息放这里,不入库
|
||||
node prober/node/index.js
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>想用私有配置文件?</summary>
|
||||
|
||||
`local.monitors.json` 是可选的,不存在也能跑(会直接用 `public/monitors.json`)。
|
||||
需要拆分敏感信息时自建即可,结构如下:
|
||||
|
||||
```jsonc
|
||||
// local.monitors.json(已在 .gitignore 中)
|
||||
{
|
||||
"_comment": "按 id 覆盖 public/monitors.json 的同名条目,或覆盖 settings",
|
||||
"settings": {
|
||||
"uptimeRobot": { "enabled": true, "apiKey": "ur...", "pollIntervalSec": 300 },
|
||||
"probeScope": "all"
|
||||
},
|
||||
"monitors": [
|
||||
{ "id": "example-com", "url": "https://real-internal-host.example" }
|
||||
]
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
启动后确认:
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user