Commit Graph
14 Commits
Author SHA1 Message Date
tsosunchia efc9464193 fix(util): 使用八进制输出 token 目录权限 2026-05-26 02:29:38 +08:00
tsosunchia f403d93ee6 fix(util): 支持 Windows 覆盖写入 API v4 token 2026-05-25 18:24:32 +08:00
tsosunchia b58fa4b0f6 fix(api-v4): 保留预热失败与代理场景的回退路径 2026-05-25 18:02:36 +08:00
tsosunchia 7670936c72 fix(util): 将 v4 token debug 输出改到 stderr
- session token 写成功后 latest fallback 写失败不再导致 setup 失败
- NEXTTRACE_DEBUG 诊断写入 stderr,避免污染 stdout/JSON 输出
2026-05-22 11:16:55 +08:00
tsosunchia cb2b3e6cbd fix(api): 补齐 v4 client timeout 和恢复错误处理
- nil HTTP client 默认使用带超时的 Geo client
- NEXTTRACE_DEBUG 输出 token 文件读取错误和候选路径
- 合并 TTY read/restore 错误并保留 interrupted sentinel
2026-05-22 11:16:55 +08:00
tsosunchia a929cd67bf fix(util): 读取 v4 token 前校验目录和文件
- 读取 session/latest token 前拒绝 symlink、目录和宽松权限
- 父目录缺失仍按未保存 session token 处理
2026-05-22 11:16:55 +08:00
tsosunchia ed45af1ee7 fix(util): 拒绝无法校验 owner 的 token 目录
- Unix-like 平台在缺少 Stat_t 时拒绝 token 目录
- 调整 pipe cleanup 测试避免资源泄漏
2026-05-22 11:16:54 +08:00
tsosunchia 588cb3bc29 fix(util): 放宽非 Unix token 文件权限断言
- Unix-like 平台继续校验 0700/0600 和 owner
- Windows/other 平台仅校验可表达的目录、symlink 和 rename 约束
2026-05-22 11:16:54 +08:00
tsosunchia c966d93d3c fix(api): 限制 v4 lookup 总耗时并加固 token 文件写入
- 让 v4 retry 总耗时受调用方 timeout 限制
- 对成功和错误响应 body 增加读取上限
- 写 token 文件时校验目录并使用同目录临时文件原子替换
2026-05-22 11:16:54 +08:00
tsosunchia 618bd13579 fix(util): 读取 latest fallback v4 token 文件
- 额外写入 latest token 文件作为不同进程树 fallback
- 读取 session token 失败或缺失时尝试 latest token
2026-05-22 11:16:54 +08:00
tsosunchia 564d97b2c2 feat(util): 用临时文件保存 session v4 token
- 将 -x 从父进程 env 写入脚本调整为 session token 文件
- 启动时从 session token 文件加载 NEXTTRACE_API_V4_TOKEN
2026-05-22 11:16:54 +08:00
tsosunchia 97bcf79f8d feat(ipgeo): 添加 NextTrace API v4 HTTP GeoIP provider
- 仅在 NEXTTRACE_API_V4_TOKEN 存在时接管 LeoMoeAPI
- 保留未配置 v4 token 时的 v3 WebSocket 默认路径
2026-05-22 11:16:54 +08:00
tsosunchia 27a84fa5b5 feat: add environment variable documentation and implement CORS middleware for browser access 2026-03-08 08:17:13 +08:00
tsosunchia aa3df62875 Add tests for DN42 and PTR record functionalities
- Added focused unit tests for listener parsing helpers so buildListenInfo and isDigitsOnly are now validated without invoking the full CLI stack (cmd/listen_info_test.go:10-32).
  - Replaced placeholder DN42 tests with deterministic coverage for geofeed parsing and PTR matching, using temp CSV fixtures to check both positive and negative paths (dn42/geofeed_test.go:13-57, dn42/ptr_test.go:13-56).
  - Rebuilt the ipgeo tests to assert provider lookup mappings, DN42 integration (including PTR fallback and “unknown” defaults), and the disableGeoIP shim (ipgeo/ipgeo_test.go:12-53, ipgeo/dn42_test.go:14-78).
  - Introduced environment helper tests that exercise trimming, boolean, default, and integer reads without touching external DNS (util/env_test.go:9-46).
  - Removed legacy network-dependent tests that only printed output, ensuring the suite is deterministic.
2025-10-29 13:27:37 +08:00