Skip to content

feat(config): unknown WALGIT__ overrides fail closed - #100

Open
jonasgrosch wants to merge 2 commits into
tobi:mainfrom
conxai-technologies:conxai/config-strict
Open

jonasgrosch wants to merge 2 commits into
tobi:mainfrom
conxai-technologies:conxai/config-strict

Conversation

@jonasgrosch

Copy link
Copy Markdown

WALGIT__SERVER__LSITEN=0.0.0.0:8080 was dropped with a WARN and the server ran on the default
listen address; a wrong-typed value did the same. The TOML file already refuses unknown keys
(deny_unknown_fields); the environment path now matches it.

  • A malformed name, unknown section/key or wrong-typed value is an error at startup and in
    walgit config check, naming every such variable and, for a typo, the nearest known key:
    WALGIT__SERVER__LSITEN: unknown key lsiten in [server]; did you mean WALGIT__SERVER__LISTEN?
  • Nothing of a refused batch is applied. Suggestions use serde's expected one of list; no new dependency.
  • No escape hatch: no non-config variable uses the prefix. The old tolerance answered config/image
    skew (2026-08-21); that is now ordering plus config check --env-file run by the serving binary.
    --strict and apply_env_report are removed (the check is always strict). Recorded as D50 —
    this reverses the earlier warn-and-ignore decision, so push back if you'd rather keep a switch.
  • walgit.example.toml [store.s3] now shows the real defaults (force_path_style = true,
    local endpoint): the default endpoint is the rustfs/MinIO rig, which needs path-style. Pinned by a test.

Tests: unit test for every refusal kind; walgit-cli/tests/config_env.rs drives the real binaries
(typo refused by config check and by walgit-server startup; valid override applied).
cargo fmt --all --check and cargo clippy --locked --workspace --all-targets -- -D warnings clean.

🤖 Generated with Claude Code

jonasgrosch-conxai and others added 2 commits October 1, 2026 02:09
An environment override this build could not apply was dropped with a
WARN: `WALGIT__SERVER__LSITEN=0.0.0.0:8080` left the server on the default
127.0.0.1:8080, a wrong-typed value likewise ran the default. The file
itself already refuses unknown keys (`deny_unknown_fields`); the env path
now does the same.

A malformed name, an unknown section or key, or a value of the wrong type
is an error at startup and in `walgit config check`, naming every such
variable at once and, for an unknown key, the nearest known one:

  WALGIT__SERVER__LSITEN: unknown key `lsiten` in [server]; did you mean WALGIT__SERVER__LISTEN?

Nothing of a refused batch is applied. The nearest key comes from serde's
own `expected one of` list (Levenshtein over the siblings, no new
dependency).

No escape hatch. The warn-and-ignore loader existed for config/image skew
(2026-08-21: a host on an older image crash-looped on a newer key), not
for foreign variables sharing the prefix — nothing in the tree sets a
non-config `WALGIT__*` name. That case is answered by ordering (image
before the env that needs it) and by `config check --env-file` run by the
binary that will serve; `--strict` and `apply_env_report` are removed, as
the check is now always strict. Recorded as D50. walgit-config no longer
uses tracing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
walgit.example.toml documents "every key with its default", but its
[store.s3] block showed AWS values: `force_path_style = false` and an AWS
endpoint, while `S3Config::default()` is `force_path_style = true` with
`endpoint = "http://127.0.0.1:9000"`.

The code is right: the flag goes straight to aws-sdk-s3, and the default
endpoint is the local rustfs/MinIO rig, which needs path-style addressing
(s3.rs notes it as required for rustfs; virtual-hosted would address
`bucket.host`). So the example follows the code, and says when to set
false (AWS, virtual-hosted addressing). `example_configurations_parse_
and_validate` now pins the example's [store.s3] to the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nibzard added a commit to nibzard/walgit that referenced this pull request Oct 15, 2026
…t apply

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants