New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.env #14
Comments
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 |
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 peterbourgon/ff#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. |
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. |
Quite recently smtprelay switched to using a different config file parser which also supports .env files. |
Would you consider using .env for configuration so the binary could be portable? I can PR if you're open to the idea.
The text was updated successfully, but these errors were encountered: