mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 12:55:54 +03:00
[PR #72] [MERGED] Support environment variables for config #101
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/smtprelay#101
Loading…
Add table
Add a link
Reference in a new issue
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?
📋 Pull Request Information
Original PR: https://github.com/decke/smtprelay/pull/72
Author: @decke
Created: 5/23/2022
Status: ✅ Merged
Merged: 5/25/2022
Merged by: @decke
Base:
master← Head:ff-config📝 Commits (7)
2647717Replace iniflags config file parser with peterbourgon/ff/v38cc31a9Properly handle config parsing errors because logging is not setup yet7e3dbd5Add config parameter for ini filee9a2b9aFix IniParser() to support various common formatsf69d1f0Improve examples in ini file to not quote strings at allc83544bAdd note how to use environment variables for configuration1bf205eCompress if statement📊 Changes
5 files changed (+96 additions, -31 deletions)
View changed files
📝
README.md(+1 -0)📝
config.go(+81 -24)📝
go.mod(+1 -1)📝
go.sum(+5 -2)📝
smtprelay.ini(+8 -4)📄 Description
As requested in #14 and discussed a few times it makes sense in container environments to support environment variables for configuration.
This PR switches github.com/vharitonsky/iniflags to github.com/peterbourgon/ff/v3 which is very similar and supports environment variables. IniParser was created based on his PlainParser example (Apache 2.0 license). Small tweaks were necessary like providing a separate flagset for the options.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.