Commit Graph
1133 Commits
Author SHA1 Message Date
tsosunchia cd3d3ff19d Merge pull request #129 from nxtrace/dependabot/go_modules/golang.org/x/sys-0.38.0 2025-11-11 00:41:31 +08:00
dependabot[bot] 5a9b3b92e7 chore(deps): bump golang.org/x/sys from 0.37.0 to 0.38.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.37.0 to 0.38.0.
- [Commits](https://github.com/golang/sys/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 15:44:53 +00:00
tsosunchia 15997023f6 Merge pull request #334 from nxtrace/main
SYNC: v1.5.0-beta.1
2025-10-29 22:38:56 +08:00
tsosunchia 2240f7959d fix: handle LeoMoe override correctly
- re-evaluate LeoMoe websocket flag after NEXTTRACE_DATAPROVIDER override in server trace handler
  - mirror the same check in CLI init so the websocket is only opened when the final provider is still
    LEOMOEAPI

Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 22:38:28 +08:00
tsosunchia 6c12de9842 Ensure Leo data provider always initialises websocket 2025-10-29 22:16:12 +08:00
tsosunchia acc19055ec Merge pull request #333 from nxtrace/main
SYNC
2025-10-29 21:21:39 +08:00
tsosunchia 612880c02b 单实例复用 WebSocket 发送协程,Done 通道用 stateMu 管理并按连接刷新。 2025-10-29 21:21:17 +08:00
tsosunchia eb2ba884d1 Enhance DNS lookup in util.go: add timeout for context and improve IP parsing logic
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 20:55:31 +08:00
tsosunchia ab940de64e 修复 WsConn.Conn 并发访问,统一用 stateMu 加锁,避免竞态和死锁。
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 20:47:13 +08:00
tsosunchia 2f73e3d7d8 缓解 Leomoeapi 断线导致的卡死问题
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 20:11:41 +08:00
tsosunchia df8c0c32c4 降低断线时期的 CPU 占用,增加 200 毫秒的等待时间
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 19:53:13 +08:00
tsosunchia 75db288c0b 移除 trace/trace.go 中的全局 lastErr,改为线程安全的错误处理。加强 util/util.go 的 DomainLookUp 返回逻辑,确保在无可用 IP 时优雅地报错而不是 panic。
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 19:50:38 +08:00
tsosunchia cb302df096 Merge pull request #331 from nxtrace/main
SYNC
2025-10-29 16:32:58 +08:00
tsosunchia 440aa4409a Refine wshandle socket handling: add per-connection state mutex, serialize writes/
close with timeouts, unify host:port formatting for IPv6, and clean cache handling
  to avoid duplicate reconnections.
2025-10-29 16:03:27 +08:00
tsosunchia 95d18fcec2 Remove obsolete case for IP2REGION in trace_handler.go
移除已弃用的 Ip2region 数据源处理
2025-10-29 14:50:18 +08:00
tsosunchia 25a20a89be ipgeo/dn42.go 国家/地区名称存在前后空格污染 2025-10-29 14:48:42 +08:00
tsosunchia 6ee87dc60b Update LtdCodeToCountryOrAreaName to use region names and codes 2025-10-29 14:37:54 +08:00
tsosunchia 3528c2de6c 移除无效的单元测试 2025-10-29 14:33:58 +08:00
tsosunchia b76c6034a1 Refactor WebSocket connection state management with mutex for thread safety 2025-10-29 14:24:17 +08:00
tsosunchia 52206f7e8d Add Globalping section to Chinese README with usage examples 2025-10-29 13:33:16 +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
tsosunchia 5493690a8d Update README to change section title from 'Known Issues' to 'Common questions' and remove outdated TCP mode note 2025-10-29 13:14:21 +08:00
tsosunchia 3a09d28ea3 Handle error on response body close to prevent panic 2025-10-29 13:03:35 +08:00
tsosunchia dea2f7bf45 Add .gocache to .gitignore to exclude Go build cache 2025-10-29 13:01:00 +08:00
tsosunchia 50a164c5ea Add nil check for response body to prevent panic 2025-10-29 12:58:16 +08:00
tsosunchia 81373fb3a4 Refactor trace_handler.go to improve variable naming for clarity 2025-10-29 12:48:35 +08:00
tsosunchia 0f09cddde0 Merge pull request #127 from nxtrace/alert-autofix-49
Potential fix for code scanning alert no. 49: Client-side cross-site scripting
2025-10-29 12:44:23 +08:00
tsosunchia fee8812bdc Refactor app.js to normalize error keys and prevent prototype pollution 2025-10-29 12:41:36 +08:00
tsosunchiaandCopilot d1c6be66aa Update server/web/assets/app.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-29 12:38:47 +08:00
tsosunchiaandCopilot Autofix powered by AI b2a70ac384 Potential fix for code scanning alert no. 49: Client-side cross-site scripting
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-29 12:30:19 +08:00
tsosunchia d04f3d1ef0 Refactor globalping.go to add nil checks for ProbeMeasurement 2025-10-29 11:32:32 +08:00
tsosunchia 3715f3b183 Refactor trace_handler.go to improve target parsing and error handling 2025-10-29 11:20:18 +08:00
tsosunchia fc1c580ad7 Refactor ws_handler.go to improve session handling and snapshot logic 2025-10-29 11:16:42 +08:00
tsosunchia 5bf76a52d7 Refactor globalping.go to improve hop limit handling and loop structure 2025-10-29 11:14:58 +08:00
tsosunchia a210fb6ab3 Enhance error handling in viper.go for configuration file loading 2025-10-29 11:12:11 +08:00
tsosunchia a6fcb6aafd Refactor globalping.go to improve maxTimings calculation and loop structure 2025-10-29 11:10:57 +08:00
tsosunchia caa5cd9607 Merge remote-tracking branch 'origin/main' 2025-10-29 11:06:13 +08:00
tsosunchia d8418d7ec5 Add locking mechanism to Result.reduce for thread safety 2025-10-29 11:05:54 +08:00
tsosunchiaandcoderabbitai[bot] 1c5665a664 Update trace/globalping.go
globalping IPv4 与 IPv6 标志冲突时的选择策略不明确

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-29 11:01:55 +08:00
tsosunchia 04af30d940 Update default destination port for UDP protocol in app.js (33494) 2025-10-29 10:53:29 +08:00
tsosunchia 088a64581f Fix typos in README and update data provider list in handlers 2025-10-29 10:49:10 +08:00
tsosunchia d2fd8bc4a4 Enhance configuration file path handling with dynamic user home and XDG support 2025-10-29 10:41:43 +08:00
tsosunchia 40f50e3e96 Add error handling for empty globalping measurement results 2025-10-29 10:40:09 +08:00
tsosunchia 0285fafa35 Add default local listen address handling with IPv4 and IPv6 support 2025-10-29 10:36:23 +08:00
tsosunchia cb6cf066a7 Refactor address handling in cmd.go to improve input validation and access host determination
规范化监听地址:支持纯端口输入并统一回传可访问地址
2025-10-29 10:33:37 +08:00
tsosunchia 0da91ab3e2 typo 2025-10-29 10:29:05 +08:00
tsosunchiaandCopilot c77a025b83 Update server/web/assets/style.css
The .hidden class is defined twice (lines 368-370 and 511-513). Remove the duplicate definition to avoid confusion and potential CSS specificity issues.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-29 10:25:06 +08:00
tsosunchiaandCopilot b1b8e0407f Update cmd/cmd.go:typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-29 10:22:52 +08:00
tsosunchia 123246c4ac 添加v6默认IP 2025-10-29 10:10:16 +08:00
tsosunchia a0f739af08 基础设施维护者增加MoeDove
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-28 21:56:42 +08:00