config: a metrics username without a password stops startup (closes #268) #277

Merged
clawbot merged 1 commits from fix/268-metrics-password into next 2026-10-13 19:10:59 +02:00
Collaborator

DNSWATCHER_METRICS_USERNAME turns on /metrics, and its Basic Auth used DNSWATCHER_METRICS_PASSWORD as it was, empty included, so a request with the username and an empty password got in. dnswatcher now refuses to start when the username is set and the password is unset or empty, with ErrNoMetricsPassword: "DNSWATCHER_METRICS_PASSWORD must be set when DNSWATCHER_METRICS_USERNAME is set". The README's variable table says the password is required with the username.

Closes #268.

Judgement call: the check is in config.New, after buildConfig, not among the other settings in buildConfig: it compares two settings buildConfig has already read, and buildConfig is at the linter's length limit.

Unchanged: a password set without a username still leaves /metrics off; the issue does not ask about that case.

Model: opus-5-5

`DNSWATCHER_METRICS_USERNAME` turns on `/metrics`, and its Basic Auth used `DNSWATCHER_METRICS_PASSWORD` as it was, empty included, so a request with the username and an empty password got in. dnswatcher now refuses to start when the username is set and the password is unset or empty, with `ErrNoMetricsPassword`: "DNSWATCHER_METRICS_PASSWORD must be set when DNSWATCHER_METRICS_USERNAME is set". The README's variable table says the password is required with the username. Closes https://git.eeqj.de/sneak/dnswatcher/issues/268. Judgement call: the check is in `config.New`, after `buildConfig`, not among the other settings in `buildConfig`: it compares two settings `buildConfig` has already read, and `buildConfig` is at the linter's length limit. Unchanged: a password set without a username still leaves `/metrics` off; the issue does not ask about that case. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 18:13:47 +02:00
clawbot self-assigned this 2026-10-13 18:13:47 +02:00
Author
Collaborator

Review: FAIL

  • Needs rebase onto current next: TODO.md conflicts in Completed Steps with the entry for #264, which landed on next after this branch was cut. Acceptable: the branch rebased onto current next as one commit, keeping both entries, this one at the top.

Model: opus-5-5

Review: FAIL - Needs rebase onto current `next`: `TODO.md` conflicts in Completed Steps with the entry for https://git.eeqj.de/sneak/dnswatcher/issues/264, which landed on `next` after this branch was cut. Acceptable: the branch rebased onto current `next` as one commit, keeping both entries, this one at the top. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-13 18:35:49 +02:00
Author
Collaborator

Review: PASS
Needs rebase: TODO.md only

Model: opus-5-5

Review: PASS Needs rebase: TODO.md only Model: opus-5-5
clawbot added 1 commit 2026-10-13 19:07:52 +02:00
DNSWATCHER_METRICS_USERNAME turns on /metrics, and its Basic Auth used
DNSWATCHER_METRICS_PASSWORD as it was, empty included, so the username
with an empty password got in. config.New now refuses a username
without a password with ErrNoMetricsPassword, whose message names both
variables. The README's variable table says the password is required
with the username.

Judgement call: the check is in New, after buildConfig, since it
compares two settings buildConfig has already read; buildConfig is
also at the linter's length limit.

Model: opus-5-5
clawbot force-pushed fix/268-metrics-password from 33cd81a5ff to bd0b186cf2 2026-10-13 19:07:52 +02:00 Compare
clawbot removed the needs-rebase label 2026-10-13 19:10:58 +02:00
clawbot merged commit b9686c6d7b into next 2026-10-13 19:10:59 +02:00
clawbot deleted branch fix/268-metrics-password 2026-10-13 19:10:59 +02:00
Sign in to join this conversation.