Stop startup on a list or map setting in neoirc.yaml (closes #268)
check / check (push) Failing after 4s

viper.GetString returns the empty string for a list or a map in neoirc.yaml, so IRC_LISTEN_ADDR: [":6667"] turned the IRC listener off and MOTD or SERVER_NAME went blank without an error.

Every setting is now read through getString in internal/config, which uses cast.ToStringE, the conversion viper.GetString wraps. A list or a map is an error naming the setting, without its value, since the value may be a password. An environment value, the empty string included, still wins over the file. TRUSTED_PROXIES uses the same helper. A config file that does not parse makes New return an error naming the file instead of calling panic.

Model: opus-5-5
This commit was merged in pull request #270.
This commit is contained in:
clawbot committed 2026-11-11 00:07:58 +01:00
1 parent f42c6214a0
commit 72d8f2c12b
4 files changed
+245 -98

No files matched your search

+2 -1
View File
@@ -1722,7 +1722,8 @@ exceptions:
A `neoirc.yaml` that is not valid YAML stops the server at startup. A setting
that does not parse or is out of range also stops the server at startup, and the
error names the setting.
error names the setting. The same holds for a setting given a list or a map in
`neoirc.yaml`.
- `PORT` (default `8080`): the HTTP port. `0` lets the system pick a free port.
- `IRC_LISTEN_ADDR` (default `:6667`): the address of the IRC listener. The