Private
Public Access
1
0

fix(api): protocol-aware monitor filtering for multi-protocol monitors
All checks were successful
continuous-integration/drone/push Build is passing

Servers with monitor filtering returned incorrect results when monitors
have same names but different protocols (v4/v6). Monitor lookup now
considers both name and IP version to match the correct protocol.

- Add GetMonitorByNameAndIPVersion SQL query with protocol matching
- Update history parameter parsing to use server IP version context
- Fix both /scores/{ip}/log and Grafana endpoints
- Remove unused GetMonitorByName query

Fixes abh/ntppool#264
Reported-by: Anssi Johansson <https://github.com/avijc>
This commit is contained in:
2025-07-27 00:37:49 -07:00
parent 8262b1442f
commit eb5459abf3
6 changed files with 135 additions and 103 deletions

View File

@@ -47,10 +47,13 @@ select * from servers
where
ip = sqlc.arg(ip);
-- name: GetMonitorByName :one
-- name: GetMonitorByNameAndIPVersion :one
select * from monitors
where
tls_name like sqlc.arg('tls_name')
tls_name like sqlc.arg('tls_name') AND
ip_version = sqlc.arg('ip_version') AND
is_current = 1 AND
status != 'deleted'
order by id
limit 1;