Address publication review feedback

Add the AGPL LICENSE file and a deployment-security note in the README
to clarify that the unauthenticated /collect endpoint must run on a
trusted network.

Fix the IPv6 reachability rule so it consults the IP actually probed:
PingTargetResult now carries ResolvedIP populated from pinger.IPAddr(),
which lets the rule classify hostname targets correctly instead of
always reporting "No IPv6 target pinged".

Tighten error handling: ipsFromService now propagates JSON errors,
ExtractMetrics wraps decode failures, the count option returns an
explicit error when out of range instead of silently clamping, and the
"all pings failed" message no longer concatenates every per-target
error. Threshold validation is factored into validateThresholdPair and
shared between the RTT and packet-loss rules.

Add unit tests covering address resolution, threshold validation, and
each rule's evaluation paths.
This commit is contained in:
nemunaire 2026-04-26 10:40:32 +07:00
commit 2aa596afd5
17 changed files with 1291 additions and 33 deletions

2
go.mod
View file

@ -5,6 +5,7 @@ go 1.25.0
require (
git.happydns.org/checker-sdk-go v1.3.0
git.happydns.org/happyDomain v0.7.0
github.com/miekg/dns v1.1.72
github.com/prometheus-community/pro-bing v0.8.0
)
@ -26,7 +27,6 @@ require (
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/miekg/dns v1.1.72 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect