Targets removed from DNSWATCHER_TARGETS stay on the dashboard, in /api/v1/status and in the startup counts #223

Closed
opened 2026-10-02 07:35:33 +02:00 by clawbot · 1 comment
Collaborator

Found in the trial run for #149.

The trial was restarted with bbc.co.uk and www.bbc.co.uk removed from DNSWATCHER_TARGETS. Their port entries were removed at the first check, but their domain, hostname and certificate entries stay in the state for good. The dashboard and /api/v1/status still list both names under Domains and Hostnames and their four certificates under TLS certificates, each with a "checked" age that only grows. They are counted in the summary counts, and the startup notification said "Monitoring 8 domain(s)" while the watcher starting log line, from the configuration, said 7.

The README does not say what happens to a removed target. The dashboard's summary counts are described as counts of "monitored" domains and hostnames, and a removed name is no longer monitored.

To see it, run with two targets, then restart with one: the other stays on the dashboard. cleanupStalePorts in internal/watcher/watcher.go removes port entries; nothing removes the rest. From reading the code, not seen in the run: a certificate entry for an address a name no longer resolves to is never removed either.

Definition of done

  • After the first check following a restart, the state holds no domain, hostname or certificate entry for a name that is no longer in DNSWATCHER_TARGETS, and no certificate entry for an address its name no longer has. Removing them sends no notification.
  • The dashboard, /api/v1/status and the startup notification then count only configured names.
  • README "State Management" says what happens to a removed target.
  • A test loads a state holding an extra name and checks that it is gone after the first check, with no notification.

Model: opus-5-5

Found in the trial run for https://git.eeqj.de/sneak/dnswatcher/issues/149. The trial was restarted with `bbc.co.uk` and `www.bbc.co.uk` removed from `DNSWATCHER_TARGETS`. Their port entries were removed at the first check, but their domain, hostname and certificate entries stay in the state for good. The dashboard and `/api/v1/status` still list both names under Domains and Hostnames and their four certificates under TLS certificates, each with a "checked" age that only grows. They are counted in the summary counts, and the startup notification said "Monitoring 8 domain(s)" while the `watcher starting` log line, from the configuration, said 7. The README does not say what happens to a removed target. The dashboard's summary counts are described as counts of "monitored" domains and hostnames, and a removed name is no longer monitored. To see it, run with two targets, then restart with one: the other stays on the dashboard. `cleanupStalePorts` in `internal/watcher/watcher.go` removes port entries; nothing removes the rest. From reading the code, not seen in the run: a certificate entry for an address a name no longer resolves to is never removed either. ## Definition of done - After the first check following a restart, the state holds no domain, hostname or certificate entry for a name that is no longer in `DNSWATCHER_TARGETS`, and no certificate entry for an address its name no longer has. Removing them sends no notification. - The dashboard, `/api/v1/status` and the startup notification then count only configured names. - README "State Management" says what happens to a removed target. - A test loads a state holding an extra name and checks that it is gone after the first check, with no notification. Model: opus-5-5
clawbot added this to the 1.0 milestone 2026-10-02 07:35:33 +02:00
Author
Collaborator

Built in #246: the first check after startup removes the domain, hostname and certificate entries of a name no longer in DNSWATCHER_TARGETS, without a notification. A certificate entry for an address its name no longer has is removed at each port check, except while none of that name's nameservers answer.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/dnswatcher/pulls/246: the first check after startup removes the domain, hostname and certificate entries of a name no longer in `DNSWATCHER_TARGETS`, without a notification. A certificate entry for an address its name no longer has is removed at each port check, except while none of that name's nameservers answer. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#223