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

Feat/add file config #119

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

jaydouble
Copy link

added SMF_CONFIG_FILE variable to use a file for config.
to add file, be creative, you can use a bind mount, but also a secret.
A bit easier to read if you have more than one forward to make. Maybe also a bit less change for misstakes.

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2023

CLA assistant check
All committers have signed the CLA.

@huan
Copy link
Owner

huan commented Feb 9, 2023

Dear @jaydouble , thank you very much for the contribution; the code looks good!

However, I think it would be better not to introduce another parameter for SMF, which might make it more complicated.

Could you please provide a helper script for loading the data from the file and outputting the string which can satisfy the SMF_CONFIG format?

It would be perfect like this:

$ export SMF_CONFIG=`./scripts/smf-config-file.sh smf.config`
# ...

@jaydouble
Copy link
Author

Maybe better to let the user chose:
If he doesn't want to have a file variable, he can use:

export SMF_CONFIG=$(cat smf.config)
docker run -e SMF_CONFIG ....

If he want to use a config file variable, like when using a docker swarm he can use:

version: "3.8"

volumes:
  config:

services:
  smf:
    image: zixia/simple-mail-forwarder
    volumes:
      - config:/config
    ports:
      - 25:25
    environment:
      SMF_CONFIG_FILE: "/config/forwards"

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

Successfully merging this pull request may close these issues.

3 participants