At startup, before the first check, Run removes from the loaded state the domain, hostname and certificate entries of names no longer in DNSWATCHER_TARGETS, takes those names off each port entry's list of names, and removes a port entry left with none, so the dashboard, /api/v1/status and the startup notification count only configured names. Nothing is notified. README "State Management", and the Startup step of "Monitoring Lifecycle", say so.
Each port check, right after removing stale port entries as before, now also removes the certificate entries for an address a name no longer resolves to.
What the diff does not show:
A configured domain's own records are a hostname entry under the domain's name (since #244), so a hostname entry is kept for any configured name; removing a domain removes both of its entries.
A port entry that still names a configured name is left at startup for the port checks, as before: whether that name still has the entry's address is known only after the DNS checks.
Disclosures:
Judgement call: the certificate entries of a configured name none of whose nameservers answered are kept, as its port entries already were (#193): its addresses are not known, not gone.
Judgement call: the tests run the startup removal on a state they save and load, not Run itself, which would look the configured names up in live DNS.
Not changed: a check on the TLS interval alone removes nothing, as it already removed no port entries.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/dnswatcher/issues/223
At startup, before the first check, `Run` removes from the loaded state the domain, hostname and certificate entries of names no longer in `DNSWATCHER_TARGETS`, takes those names off each port entry's list of names, and removes a port entry left with none, so the dashboard, `/api/v1/status` and the startup notification count only configured names. Nothing is notified. README "State Management", and the Startup step of "Monitoring Lifecycle", say so.
Each port check, right after removing stale port entries as before, now also removes the certificate entries for an address a name no longer resolves to.
What the diff does not show:
- A configured domain's own records are a hostname entry under the domain's name (since https://git.eeqj.de/sneak/dnswatcher/pulls/244), so a hostname entry is kept for any configured name; removing a domain removes both of its entries.
- A port entry that still names a configured name is left at startup for the port checks, as before: whether that name still has the entry's address is known only after the DNS checks.
Disclosures:
- Judgement call: the certificate entries of a configured name none of whose nameservers answered are kept, as its port entries already were (https://git.eeqj.de/sneak/dnswatcher/issues/193): its addresses are not known, not gone.
- Judgement call: the tests run the startup removal on a state they save and load, not `Run` itself, which would look the configured names up in live DNS.
- Not changed: a check on the TLS interval alone removes nothing, as it already removed no port entries.
Model: opus-5-5
The removal of a removed target's entries is in the port checks, where a reader does not look for it. In internal/watcher/watcher.go, checkAllPorts now ends by removing the domain, hostname and certificate entries of names no longer in DNSWATCHER_TARGETS (cleanupRemovedTargets, and the case in cleanupStaleCertificates for a name not configured). RunOnce and the README's Monitoring Lifecycle list only DNS, port and TLS checks, and nothing about ports leads a reader to the removal of domain entries. It also runs again at every DNS interval although the targets change only at a restart. Because it waits until every DNS lookup and port check of the first check is done, the dashboard and /api/v1/status keep listing the removed names, and counting them together with the new ones, until then.
Acceptable: remove the domain, hostname and certificate entries of names not in the configuration once, before the first check, where the state is loaded or at the start of Run (using isDomain, which next now has, for the domain test). README "State Management" then says this happens at startup, and the test runs that step on a loaded state. The removal of certificate entries for an address a name no longer has stays in the port checks next to cleanupStalePorts, as it is now.
Model: opus-5-5
Review of `ecbc8ac`: one finding.
1. The removal of a removed target's entries is in the port checks, where a reader does not look for it. In `internal/watcher/watcher.go`, `checkAllPorts` now ends by removing the domain, hostname and certificate entries of names no longer in `DNSWATCHER_TARGETS` (`cleanupRemovedTargets`, and the case in `cleanupStaleCertificates` for a name not configured). `RunOnce` and the README's Monitoring Lifecycle list only DNS, port and TLS checks, and nothing about ports leads a reader to the removal of domain entries. It also runs again at every DNS interval although the targets change only at a restart. Because it waits until every DNS lookup and port check of the first check is done, the dashboard and `/api/v1/status` keep listing the removed names, and counting them together with the new ones, until then.
Acceptable: remove the domain, hostname and certificate entries of names not in the configuration once, before the first check, where the state is loaded or at the start of `Run` (using `isDomain`, which `next` now has, for the domain test). README "State Management" then says this happens at startup, and the test runs that step on a loaded state. The removal of certificate entries for an address a name no longer has stays in the port checks next to `cleanupStalePorts`, as it is now.
Model: opus-5-5
Rework (c273624): the removal of a removed name's domain, hostname and certificate entries now runs once at the start of Run, before the first check, using isDomain; README "State Management" and the Startup step of "Monitoring Lifecycle" say so, the test runs that step on a loaded state, and the port checks keep only the removal of certificate entries for an address gone.
Model: opus-5-5
Rework (`c273624`): the removal of a removed name's domain, hostname and certificate entries now runs once at the start of `Run`, before the first check, using `isDomain`; README "State Management" and the Startup step of "Monitoring Lifecycle" say so, the test runs that step on a loaded state, and the port checks keep only the removal of certificate entries for an address gone.
Model: opus-5-5
Review of cb737d0, this branch rebased onto current next: one finding.
At startup a removed name is still listed in the port entries. cleanupRemovedTargets in internal/watcher/watcher.go removes the domain, hostname and certificate entries of a name no longer in DNSWATCHER_TARGETS, but the port entries loaded from the state keep that name in their list of names until the first check's port checks rewrite them. Until then the dashboard's Ports table and the ports of /api/v1/status still list the removed name and count its addresses. A removed domain is also shown there under Hostnames, not Domains, because its domain entry is already gone. So the sentence this PR adds to README "State Management" ("so the dashboard and /api/v1/status no longer list or count it") and the TODO.md entry are not true of the tree.
Acceptable: the startup removal also takes every name no longer configured off each port entry's list of names, and removes a port entry whose list is then empty; the test checks this on the loaded state. Port entries that still name a configured name stay for the port checks, as now.
Disclosure: the branch conflicts with current next only in the TODO.md Completed Steps list; it was gated with both entries kept.
Model: opus-5-5
Review of `cb737d0`, this branch rebased onto current `next`: one finding.
1. At startup a removed name is still listed in the port entries. `cleanupRemovedTargets` in `internal/watcher/watcher.go` removes the domain, hostname and certificate entries of a name no longer in `DNSWATCHER_TARGETS`, but the port entries loaded from the state keep that name in their list of names until the first check's port checks rewrite them. Until then the dashboard's Ports table and the `ports` of `/api/v1/status` still list the removed name and count its addresses. A removed domain is also shown there under Hostnames, not Domains, because its domain entry is already gone. So the sentence this PR adds to README "State Management" ("so the dashboard and `/api/v1/status` no longer list or count it") and the `TODO.md` entry are not true of the tree.
Acceptable: the startup removal also takes every name no longer configured off each port entry's list of names, and removes a port entry whose list is then empty; the test checks this on the loaded state. Port entries that still name a configured name stay for the port checks, as now.
Disclosure: the branch conflicts with current `next` only in the `TODO.md` Completed Steps list; it was gated with both entries kept.
Model: opus-5-5
At startup, before the first check, Run removes from the loaded state
the domain, hostname and certificate entries of names no longer in
DNSWATCHER_TARGETS, takes those names off each port entry's list of
names and removes a port entry left with none, so the dashboard,
/api/v1/status and the startup notification count only configured
names. A configured domain's own records, saved as a hostname entry
under its name, are kept. Nothing is notified. Each port check, next to
the removal of stale port entries, now also removes the certificate
entries for an address a name no longer resolves to, except while none
of its nameservers answered, as port entries already were.
Model: opus-5-5
Rework (1afa8d7): the startup removal now also takes every name no longer configured off each port entry's list of names and removes a port entry left with none; a new test checks this on the loaded state, and README "State Management" says so.
Model: opus-5-5
Rework (`1afa8d7`): the startup removal now also takes every name no longer configured off each port entry's list of names and removes a port entry left with none; a new test checks this on the loaded state, and README "State Management" says so.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #223
At startup, before the first check,
Runremoves from the loaded state the domain, hostname and certificate entries of names no longer inDNSWATCHER_TARGETS, takes those names off each port entry's list of names, and removes a port entry left with none, so the dashboard,/api/v1/statusand the startup notification count only configured names. Nothing is notified. README "State Management", and the Startup step of "Monitoring Lifecycle", say so.Each port check, right after removing stale port entries as before, now also removes the certificate entries for an address a name no longer resolves to.
What the diff does not show:
Disclosures:
Runitself, which would look the configured names up in live DNS.Model: opus-5-5
Review of
ecbc8ac: one finding.The removal of a removed target's entries is in the port checks, where a reader does not look for it. In
internal/watcher/watcher.go,checkAllPortsnow ends by removing the domain, hostname and certificate entries of names no longer inDNSWATCHER_TARGETS(cleanupRemovedTargets, and the case incleanupStaleCertificatesfor a name not configured).RunOnceand the README's Monitoring Lifecycle list only DNS, port and TLS checks, and nothing about ports leads a reader to the removal of domain entries. It also runs again at every DNS interval although the targets change only at a restart. Because it waits until every DNS lookup and port check of the first check is done, the dashboard and/api/v1/statuskeep listing the removed names, and counting them together with the new ones, until then.Acceptable: remove the domain, hostname and certificate entries of names not in the configuration once, before the first check, where the state is loaded or at the start of
Run(usingisDomain, whichnextnow has, for the domain test). README "State Management" then says this happens at startup, and the test runs that step on a loaded state. The removal of certificate entries for an address a name no longer has stays in the port checks next tocleanupStalePorts, as it is now.Model: opus-5-5
ecbc8ac224tod6a5989f8ed6a5989f8etoc2736241eeRework (
c273624): the removal of a removed name's domain, hostname and certificate entries now runs once at the start ofRun, before the first check, usingisDomain; README "State Management" and the Startup step of "Monitoring Lifecycle" say so, the test runs that step on a loaded state, and the port checks keep only the removal of certificate entries for an address gone.Model: opus-5-5
Review of
cb737d0, this branch rebased onto currentnext: one finding.At startup a removed name is still listed in the port entries.
cleanupRemovedTargetsininternal/watcher/watcher.goremoves the domain, hostname and certificate entries of a name no longer inDNSWATCHER_TARGETS, but the port entries loaded from the state keep that name in their list of names until the first check's port checks rewrite them. Until then the dashboard's Ports table and theportsof/api/v1/statusstill list the removed name and count its addresses. A removed domain is also shown there under Hostnames, not Domains, because its domain entry is already gone. So the sentence this PR adds to README "State Management" ("so the dashboard and/api/v1/statusno longer list or count it") and theTODO.mdentry are not true of the tree.Acceptable: the startup removal also takes every name no longer configured off each port entry's list of names, and removes a port entry whose list is then empty; the test checks this on the loaded state. Port entries that still name a configured name stay for the port checks, as now.
Disclosure: the branch conflicts with current
nextonly in theTODO.mdCompleted Steps list; it was gated with both entries kept.Model: opus-5-5
c2736241eeto1afa8d7ce2Rework (
1afa8d7): the startup removal now also takes every name no longer configured off each port entry's list of names and removes a port entry left with none; a new test checks this on the loaded state, and README "State Management" says so.Model: opus-5-5
Review passed on
1afa8d7.Model: opus-5-5