Skip to content

refactor: replace Viper with typed TOML configuration - #15

Draft
Portals wants to merge 1 commit into
codex/05-standard-routerfrom
codex/06-typed-config
Draft

refactor: replace Viper with typed TOML configuration#15
Portals wants to merge 1 commit into
codex/05-standard-routerfrom
codex/06-typed-config

Conversation

@Portals

@Portals Portals commented Sep 7, 2026

Copy link
Copy Markdown
Member

Replaces Viper with typed configuration loaded once at startup from defaults, the first config.toml, and nonempty environment variables. Preserves documented defaults, exact environment names, and file search order. Passes the maximum mail size directly to the router, removing global configuration from request handling and tests. Removes Viper and its unused transitive dependencies while retaining the existing TOML parser version.

Configuration now accepts TOML with documented field types only. Malformed or unreadable files and invalid port, size, or boolean values stop startup; missing files remain valid for environment-only configuration. These behavior changes are documented. Gmail authentication and the separately planned body-size/header hardening are unchanged.

Validation: uncached go test -race -count=1 ./..., golangci-lint run (zero issues), command build, and git diff --check passed. The production Docker image built successfully; disposable-container smoke tests passed for environment-only mock startup, authentication, mail response, configured size limits, and invalid-port startup failure. Containers were removed afterward.

A fresh-context subagent independently reviewed commit ede82bf116259f50dcb3c7f4c9aa14558f77bc3e against this PR's goal and returned OK.

Stack: 6 of 6, based on #14 (codex/05-standard-router). Review and merge in stack order: #10#11#12#13#14 → this PR.

@Portals
Portals marked this pull request as draft September 7, 2026 18:51
@Portals Portals changed the title refactor: replace Viper with typed TOML configuration (6/6) refactor: replace Viper with typed TOML configuration Sep 7, 2026
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.

1 participant