Skip to content
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

Closed
ryanburnette opened this issue Mar 11, 2021 · 4 comments
Closed

.env #14

ryanburnette opened this issue Mar 11, 2021 · 4 comments

Comments

@ryanburnette
Copy link

Would you consider using .env for configuration so the binary could be portable? I can PR if you're open to the idea.

@decke
Copy link
Owner

decke commented 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
Copy link
Owner

decke commented 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 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.

@ryanburnette
Copy link
Author

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
Copy link
Owner

decke commented Aug 15, 2022

Quite recently smtprelay switched to using a different config file parser which also supports .env files.

peterbourgon/ff#89

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

No branches or pull requests

2 participants