mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 12:55:54 +03:00
[GH-ISSUE #14] .env #6
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#6
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?
Originally created by @ryanburnette on GitHub (Mar 11, 2021).
Original GitHub issue: https://github.com/decke/smtprelay/issues/14
Would you consider using .env for configuration so the binary could be portable? I can PR if you're open to the idea.
@decke commented on GitHub (Mar 12, 2021):
I am not fully sure about your proposal but I think you meant it would be good to have environment variables for all the config parameters that are currently in smtprelay.ini ? I assume you want to run this in a docker environment where this is quite common.
The research that I did so far did lead me to https://github.com/peterbourgon/ff which would be almost compatible from a code point of view to vharitonsky/iniflags which we are currently using. The main difference is a different config file format so we would need a slightly modified parser which seems to be simple when looking at the plaintext parser https://github.com/peterbourgon/ff/blob/master/parse.go#L236
@decke commented on GitHub (Mar 14, 2021):
To correct myself, .env file seems to be a docker feature which contains environment variables and their values (format VAR=VAL) which are parsed and passed to the environment of the container. So for smtprelay it should be enough to support environment variables for all config values. In addition to that there is a pull request https://github.com/peterbourgon/ff/pull/66 which adds a parser for .env files so it could be used instead of the ini file as well. We probably won't need it though.
@ryanburnette commented on GitHub (Jun 30, 2021):
I'm just used to .env as the normal approach, and it's been a while since I opened this issue, but I must not have noticed smtprelay.ini or understood that it was the configuration method. I editing source, recompiled, and had a configured binary, which I found to be a less flexible approach.
Closing.
@decke commented on GitHub (Aug 15, 2022):
Quite recently smtprelay switched to using a different config file parser which also supports .env files.
https://github.com/peterbourgon/ff/pull/89