Compare commits

...
2 Commits
Author SHA1 Message Date
nomdn dbaf6a0da9 fix(ota): 下载落盘后显式补执行位,修复 preflight 阶段 permission denied
otaDownloadOne 仅用 os.Create 写临时文件(默认 0644 无 +x),而 preflightBinary
在 replaceBinary 的 chmod 之前就要 exec 该 tmp 文件,Linux 下 EACCES 致所有节点 OTA
必现 permission denied。下载落盘(sha 校验通过后)对非 Windows 平台补 chmod 0755。
2026-09-19 23:29:55 +08:00
nomdn 9a4c7d57a8 fix(report): nodeIsProbeType 白名单补齐 location,与中心侧对齐
节点侧 nodeIsProbeType 白名单原漏 location,导致节点转发/自发 location 查询只累加统计
(中心 request_stats 收全部 apiType,故大盘有 Location 统计)而不上报明细(被 !isProbeType 挡),
造成『大盘有、明细没有』。补齐后与中心 store.go 白名单一致,location 现进入 probe_results 明细。
2026-09-19 23:01:41 +08:00
2 changed files with 12 additions and 1 deletions

No files matched your search

+9
View File
@@ -337,6 +337,15 @@ func otaDownloadOne(url, dst, wantSHA string) error {
return fmt.Errorf("sha256 mismatch: got %s", got)
}
}
// 下载文件默认不带执行位(os.Create 跟随 umask,通常 0644),而 preflightBinary
// 在 replaceBinary 的 chmod 之前就要试运行它;Linux 下不显式加 +x 会 EACCES(Permission denied)。
// 故此处下载落盘后即补执行位,确保 preflight 与最终 replace 都能 exec。
if runtime.GOOS != "windows" {
if err := os.Chmod(dst, 0o755); err != nil {
_ = os.Remove(dst)
return fmt.Errorf("chmod downloaded binary: %w", err)
}
}
return nil
}
+3 -1
View File
@@ -63,7 +63,9 @@ type nodeProbeRec struct {
// dnssec 属功能性校验(结果是否签名/可信),不逐条进明细,只进统计聚合。
func nodeIsProbeType(apiType string) bool {
switch apiType {
case "tcping", "speed", "detail", "ssl", "dns":
// 与中心 store.go 的 isProbeType 白名单对齐:location 归属地查询也逐条进明细,
// 否则节点只上报 location 统计、不上报明细,导致中心大盘有 Location 统计而明细为空。
case "tcping", "speed", "detail", "ssl", "dns", "location":
return true
}
return false