internal/config/config.go parses DNSWATCHER_DNS_INTERVAL and DNSWATCHER_TLS_INTERVAL with time.ParseDuration and, when that fails, uses the default (1 hour, 12 hours) without logging anything. An operator who writes DNSWATCHER_DNS_INTERVAL=5 or =1d gets hourly checks and no hint why. A zero or negative value parses and is accepted. Elsewhere config errors already stop startup (malformed config file, invalid targets).
Definition of done
An interval that does not parse, or is zero or negative, stops startup with an error naming the variable and the value given.
An unset variable still means the default.
Tests in internal/config cover a bad value, a non-positive value and an unset one for each of the two variables.
README: the environment variable table says what a valid value looks like and that an invalid one stops startup.
DNS is never mocked; nothing here touches DNS.
Model: opus-5-5
Found while reviewing https://git.eeqj.de/sneak/dnswatcher/pulls/167.
`internal/config/config.go` parses `DNSWATCHER_DNS_INTERVAL` and `DNSWATCHER_TLS_INTERVAL` with `time.ParseDuration` and, when that fails, uses the default (1 hour, 12 hours) without logging anything. An operator who writes `DNSWATCHER_DNS_INTERVAL=5` or `=1d` gets hourly checks and no hint why. A zero or negative value parses and is accepted. Elsewhere config errors already stop startup (malformed config file, invalid targets).
## Definition of done
- An interval that does not parse, or is zero or negative, stops startup with an error naming the variable and the value given.
- An unset variable still means the default.
- Tests in `internal/config` cover a bad value, a non-positive value and an unset one for each of the two variables.
- README: the environment variable table says what a valid value looks like and that an invalid one stops startup.
- DNS is never mocked; nothing here touches DNS.
Model: opus-5-5
clawbot
added this to the 1.0 milestone 2026-10-01 21:00:00 +02:00
Implemented in #178: an interval that does not parse, or is zero or negative, now stops startup with an error naming the variable and the value; unset still means the default. Note for operators: a deployment that currently sets something like 1d and silently runs on the default will refuse to start once this lands.
Model: opus-5-5
Implemented in https://git.eeqj.de/sneak/dnswatcher/pulls/178: an interval that does not parse, or is zero or negative, now stops startup with an error naming the variable and the value; unset still means the default. Note for operators: a deployment that currently sets something like `1d` and silently runs on the default will refuse to start once this lands.
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.
Found while reviewing #167.
internal/config/config.goparsesDNSWATCHER_DNS_INTERVALandDNSWATCHER_TLS_INTERVALwithtime.ParseDurationand, when that fails, uses the default (1 hour, 12 hours) without logging anything. An operator who writesDNSWATCHER_DNS_INTERVAL=5or=1dgets hourly checks and no hint why. A zero or negative value parses and is accepted. Elsewhere config errors already stop startup (malformed config file, invalid targets).Definition of done
internal/configcover a bad value, a non-positive value and an unset one for each of the two variables.Model: opus-5-5
Implemented in #178: an interval that does not parse, or is zero or negative, now stops startup with an error naming the variable and the value; unset still means the default. Note for operators: a deployment that currently sets something like
1dand silently runs on the default will refuse to start once this lands.Model: opus-5-5