internal/config reads every setting with viper.GetString. When neoirc.yaml gives a setting a list or a map (IRC_LISTEN_ADDR: [":6667"]), GetString returns the empty string with no error. For settings where the empty string is valid, startup goes on with the wrong value: an IRC_LISTEN_ADDR written as a list turns the IRC listener off, and MOTD or SERVER_NAME silently go blank. Separately, a config file that does not parse makes New call panic instead of returning the error.
Standing ruling: a setting that is set but invalid makes startup fail loudly; the config helper returns the error, the constructor propagates it, and startup aborts.
Definition of done
In internal/config, one check over every setting the server reads: a value from the config file that is a list or a map stops startup with an error naming the setting. Strings, numbers and booleans are accepted as now. TRUSTED_PROXIES (from #264) uses the same check instead of its own.
A config file that does not parse makes New return an error naming the file; no panic.
Table-driven tests in internal/config's external test package: a list and a map for IRC_LISTEN_ADDR and for MOTD each stop startup with an error naming the setting; a file that does not parse returns an error.
README.md "Configuration": one sentence that a setting given a list or a map in the file stops startup.
Start after #264 is merged into next, since both change internal/config/config.go.
`internal/config` reads every setting with `viper.GetString`. When `neoirc.yaml` gives a setting a list or a map (`IRC_LISTEN_ADDR: [":6667"]`), `GetString` returns the empty string with no error. For settings where the empty string is valid, startup goes on with the wrong value: an `IRC_LISTEN_ADDR` written as a list turns the IRC listener off, and `MOTD` or `SERVER_NAME` silently go blank. Separately, a config file that does not parse makes `New` call `panic` instead of returning the error.
Standing ruling: a setting that is set but invalid makes startup fail loudly; the config helper returns the error, the constructor propagates it, and startup aborts.
## Definition of done
- In `internal/config`, one check over every setting the server reads: a value from the config file that is a list or a map stops startup with an error naming the setting. Strings, numbers and booleans are accepted as now. `TRUSTED_PROXIES` (from https://git.eeqj.de/sneak/neoirc/pulls/264) uses the same check instead of its own.
- A config file that does not parse makes `New` return an error naming the file; no `panic`.
- Table-driven tests in `internal/config`'s external test package: a list and a map for `IRC_LISTEN_ADDR` and for `MOTD` each stop startup with an error naming the setting; a file that does not parse returns an error.
- `README.md` "Configuration": one sentence that a setting given a list or a map in the file stops startup.
Start after https://git.eeqj.de/sneak/neoirc/pulls/264 is merged into `next`, since both change `internal/config/config.go`.
Read first: `AGENTS.md`, `CONVENTIONS.md`, `REPO_POLICIES.md`.
Model: opus-5-5
clawbot
self-assigned this 2026-11-10 22:24:56 +01:00
Built in #270. Every setting goes through one helper that rejects a list or a map from neoirc.yaml with an error naming the setting. TRUSTED_PROXIES uses the same helper. A config file that does not parse now returns an error naming the file instead of panicking.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/neoirc/pulls/270. Every setting goes through one helper that rejects a list or a map from `neoirc.yaml` with an error naming the setting. `TRUSTED_PROXIES` uses the same helper. A config file that does not parse now returns an error naming the file instead of panicking.
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.
internal/configreads every setting withviper.GetString. Whenneoirc.yamlgives a setting a list or a map (IRC_LISTEN_ADDR: [":6667"]),GetStringreturns the empty string with no error. For settings where the empty string is valid, startup goes on with the wrong value: anIRC_LISTEN_ADDRwritten as a list turns the IRC listener off, andMOTDorSERVER_NAMEsilently go blank. Separately, a config file that does not parse makesNewcallpanicinstead of returning the error.Standing ruling: a setting that is set but invalid makes startup fail loudly; the config helper returns the error, the constructor propagates it, and startup aborts.
Definition of done
internal/config, one check over every setting the server reads: a value from the config file that is a list or a map stops startup with an error naming the setting. Strings, numbers and booleans are accepted as now.TRUSTED_PROXIES(from #264) uses the same check instead of its own.Newreturn an error naming the file; nopanic.internal/config's external test package: a list and a map forIRC_LISTEN_ADDRand forMOTDeach stop startup with an error naming the setting; a file that does not parse returns an error.README.md"Configuration": one sentence that a setting given a list or a map in the file stops startup.Start after #264 is merged into
next, since both changeinternal/config/config.go.Read first:
AGENTS.md,CONVENTIONS.md,REPO_POLICIES.md.Model: opus-5-5
Built in #270. Every setting goes through one helper that rejects a list or a map from
neoirc.yamlwith an error naming the setting.TRUSTED_PROXIESuses the same helper. A config file that does not parse now returns an error naming the file instead of panicking.Model: opus-5-5