Configuration should prefer environment variables per CODE_STYLEGUIDE #10
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#10
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Per CODE_STYLEGUIDE rule: "Almost all services/servers should accept their configuration via environment variables. Only go full config file if absolutely necessary."
The current
internal/config/config.gouses a custompkg/configpackage that wraps Viper with a YAML-based multi-environment config file format (withconfigDefaults,environments.dev.config,environments.prod.configsections, and value resolution via$ENV:,$GSM:,$ASM:,$FILE:prefixes). This is significantly more complex than the standard Viper +AutomaticEnv()pattern from GO_HTTP_SERVER_CONVENTIONS §8.Additionally, the example config file (
configs/config.yaml.example) references PostgreSQL (dburl: postgres://...) but the application uses SQLite.Recommendation: Simplify to use Viper directly with
AutomaticEnv()as the primary configuration method, with optional config file fallback. Environment variable names should beWEBHOOKER_PORT,WEBHOOKER_DBURL, etc. Thepkg/configpackage could remain as a library but the internal config should follow the standard pattern.clawbot referenced this issue2026-03-02 00:56:20 +01:00