feat: add DNSWATCHER_SEND_TEST_NOTIFICATION env var #85
Reference in New Issue
Block a user
Delete Branch "feature/send-test-notification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When set to a truthy value, sends a startup status notification to all configured notification channels after the first full scan completes on application startup. The notification is clearly an all-ok/success message showing the number of monitored domains, hostnames, ports, and certificates.
Changes:
SendTestNotificationconfig field readingDNSWATCHER_SEND_TEST_NOTIFICATIONmaybeSendTestNotification()in watcher, called after initialRunOnceinRunCloses #84
✅ Review: PASS
Requirement Completeness Checklist
Source: issue #84
DNSWATCHER_SEND_TEST_NOTIFICATIONconfig.go: struct field, viper default, viper readwatcher.go:maybeSendTestNotification()called afterRunOnce()inRun()w.notify.SendNotification()which dispatches to Slack, Mattermost, and ntfy.envexample, Docker run example all updatedCode Quality
maybeSendTestNotification()is well-placed (afterRunOnce(), before ticker loop), with early return when disabled. Notification message includes useful operational info (domain/hostname/port/cert counts).Run(), confirmingRunOnce()alone doesn't trigger it, and disabled path. All uset.Parallel().docker build .passes (includesmake check: lint, fmt, tests).Files Changed
README.md— docs updated in all three relevant locationsinternal/config/config.go— config struct + viper wiringinternal/config/config_test.go— default and override assertionsinternal/watcher/watcher.go— feature implementationinternal/watcher/watcher_test.go— 3 new testsClean, focused PR. All issue requirements satisfied.