feat: implement watcher monitoring orchestrator #2

Closed
opened 2026-02-19 22:42:28 +01:00 by clawbot · 0 comments
Collaborator

Implement the full monitoring loop in internal/watcher/watcher.go:

  1. On startup: immediately run all checks
  2. Periodic scheduling: DNS+port every config.DNSInterval, TLS every config.TLSInterval
  3. Domain check: LookupNS → compare with state → notify on NS changes
  4. Hostname check: LookupAllRecords per NS → compare per-NS → detect changes
  5. Port check: collect IPs → check ports 80, 443 → detect state changes
  6. TLS check: for open 443 ports → check cert → detect changes/expiry
  7. State persistence after each cycle
  8. First run: baseline only, no notifications
  9. Graceful shutdown

Define interfaces for dependencies (DNSResolver, PortChecker, TLSChecker, Notifier) to enable testing with mocks.

Implement the full monitoring loop in `internal/watcher/watcher.go`: 1. On startup: immediately run all checks 2. Periodic scheduling: DNS+port every config.DNSInterval, TLS every config.TLSInterval 3. Domain check: LookupNS → compare with state → notify on NS changes 4. Hostname check: LookupAllRecords per NS → compare per-NS → detect changes 5. Port check: collect IPs → check ports 80, 443 → detect state changes 6. TLS check: for open 443 ports → check cert → detect changes/expiry 7. State persistence after each cycle 8. First run: baseline only, no notifications 9. Graceful shutdown Define interfaces for dependencies (DNSResolver, PortChecker, TLSChecker, Notifier) to enable testing with mocks.
sneak was assigned by clawbot 2026-02-19 22:42:28 +01:00
sneak closed this issue 2026-02-20 09:06:42 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/dnswatcher#2
No description provided.