Files
shiroko-monitor/public/monitors.json
T
tamakyi f345626840 fix: 管理入口改为「填链接」而非绑定特定隧道方案,并修掉配置接口的密钥泄露
用户反馈:「你不需要帮我处理 tunnel 这部分,也许我不是通过 tunnel 开放内网呢?
你只需要给我一个填写开放的管理端链接的地方。」

之前把「Cloudflare Tunnel」当成既定方案写进了配置与文档,这是替用户做了假设。
现在改为:项目只提供一个填地址的地方,怎么暴露完全由使用者决定。

- 删除 edge/cloudflare/tunnel.yml 与全部 tunnel 相关文档
- 新增 settings.adminUrl:管理界面里填一个地址,公开面板页脚出现「管理」按钮
  指向它;留空则完全不显示(默认,避免在公网面板暴露管理面位置)
- 只接受 http/https,javascript: 等协议被服务端拒绝(会被渲染成 <a href>)
- 设置落在 local.monitors.json(私有层),只有自己的面板会出现该按钮
- 面板启动时额外拉 /api/monitors 合并 settings:原先只读静态 monitors.json
  (公开层),导致私有层的设置面板看不到;纯静态部署无该接口时沿用公开配置

顺带修掉一个既存漏洞(与本轮改动无关,是引入私有层叠加机制时埋下的):
/api/monitors 无鉴权却回吐合并后的完整配置,包含私有层的 UptimeRobot API Key ——
只要配了 key,任何访客 curl /api/monitors 就能拿到。现在两侧(Node 与 Worker)
都对对外响应剥离 uptimeRobot.apiKey,保留 enabled 等非敏感字段供面板读取;
探针内部同步仍用完整配置,剥离只作用于 HTTP 出口。

测试:verify-worker 36→40 项(新增 [E] 配置接口密钥泄露 4 条)、
verify-security 20→25 项(新增 [D2] 密钥泄露 5 条)。全项目 8 套 314 项通过。
2026-10-14 15:23:22 +08:00

105 lines
2.4 KiB
JSON
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.
{
"settings": {
"title": "Shiroko Monitor",
"description": "轻量级服务监控面板",
"view": "table",
"theme": "shiroko",
"artwork": "assets/shiroko-figure.webp",
"decoOpacity": 0.78,
"dataFilter": "uptimerobot",
"refreshInterval": 300,
"dataSource": "auto",
"adminUrl": "",
"uptimeRobot": {
"enabled": false,
"apiKey": "",
"pollIntervalSec": 300,
"group": "UptimeRobot"
}
},
"monitors": [
{
"id": "example-com",
"name": "Example 站点",
"group": "公共服务",
"type": "http",
"url": "https://www.example.com",
"method": "GET",
"expectStatus": [200],
"interval": 60,
"timeout": 10
},
{
"id": "baidu",
"name": "百度",
"group": "公共服务",
"type": "http",
"url": "https://www.baidu.com",
"expectStatus": [200],
"interval": 60,
"timeout": 10
},
{
"id": "cloudflare-site",
"name": "Cloudflare 官网",
"group": "公共服务",
"type": "http",
"url": "https://www.cloudflare.com",
"expectStatus": [200],
"interval": 60,
"timeout": 10
},
{
"id": "github-api",
"name": "GitHub API(限流目标示例)",
"group": "公共服务",
"type": "http",
"url": "https://api.github.com",
"expectStatus": [200],
"interval": 300,
"timeout": 10,
"probeOnRefresh": false
},
{
"id": "httpbin-500",
"name": "HTTPBin 500(演示 expectStatus)",
"group": "公共服务",
"type": "http",
"url": "https://httpbin.org/status/500",
"expectStatus": [500],
"interval": 120,
"timeout": 10
},
{
"id": "badssl-expired",
"name": "BadSSL 过期证书(演示离线)",
"group": "公共服务",
"type": "http",
"url": "https://expired.badssl.com/",
"expectStatus": [200],
"interval": 120,
"timeout": 10
},
{
"id": "cloudflare-dns-tcp",
"name": "Cloudflare 443 端口",
"group": "基础设施",
"type": "tcp",
"host": "1.1.1.1",
"port": 443,
"interval": 60,
"timeout": 10
},
{
"id": "google-dns-tcp",
"name": "Google DNS 53 端口",
"group": "基础设施",
"type": "tcp",
"host": "8.8.8.8",
"port": 53,
"interval": 60,
"timeout": 10
}
]
}