config: stop startup on an invalid DNS or TLS interval (closes #177)
check / check (push) Successful in 1m13s

DNSWATCHER_DNS_INTERVAL and DNSWATCHER_TLS_INTERVAL were parsed with
time.ParseDuration and silently replaced by the default when that failed,
so a value like 5 or 1d gave hourly checks with no hint why, and zero or
negative values were accepted. Both now go through parseInterval, which
returns an error naming the variable and the value, and startup stops the
same way it does for invalid targets. An unset variable still gets its
default from setupViper. The three tests that pinned the old fallback are
replaced. The README says what a valid value looks like.

Model: opus-5-5
This commit is contained in:
2026-10-01 19:11:31 +00:00
parent f7cc6b42e0
commit f9fc9e882a
4 changed files with 62 additions and 40 deletions
+2
View File
@@ -19,6 +19,8 @@ Rationale, Design, TODO, License, Author) if any are still missing.
# Completed Steps
- 2026-10-01: a `DNSWATCHER_DNS_INTERVAL` or `DNSWATCHER_TLS_INTERVAL` that is
not a positive duration stops startup instead of being ignored (closes #177).
- 2026-10-01: wildcard CORS now applies only to the public routes, not to
`/metrics`, and allows only the methods they serve (closes #100).
- 2026-10-01: `internal/state` and `internal/watcher` no longer export test-only