-
Notifications
You must be signed in to change notification settings - Fork 104
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
Move basic enviroment variables into a configuration file #650
base: main
Are you sure you want to change the base?
Conversation
This is a good refactoring, and conforms to good practices for providing a level of indirection for configuration parameters. Symlinking |
mailman.cfg
Outdated
DATABASE_TYPE="postgres" | ||
DATABASE_CLASS="mailman.database.postgresql.PostgreSQLDatabase" | ||
POSTGRES_DB="mailmandb" | ||
POSTGRES_USER="mailman" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add the missing line break here?
Also Docker Compose interprets values behind the =
equal sign literally, that means the double quotation marks "
must be avoided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups, that's right. Done.
e72ef05
to
ce02630
Compare
Do you think it would make (aesthetic) sense to switch from array to object notation for the For example environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} becomes environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} which I find a bit more readable sometimes. |
Thanks for taking time to work on this :-) I am fine with the idea to move the env vars into a separate file, although, let's not call it 'mailman.cfg`, which is the name of the config file for Mailman 3 core and is bound to cause confusion with the users. I'd let it be '.env' so folks familiar with the docker/compose ecosystem guess the purpose fast. For folks who aren't, they'll need to learn about it anyway. |
Indeed. The symlink from the conventional Anyone who needs this gimmick is always free to establish it for themselves. Following Occam's razor, when the same result can be achieved with less boilerplate, it's better to choose the simpler option. |
I've got a question regarding the two other compose files ( From reading the README, I could not really understand the pupose of the -postorius.yaml. What's it for? Also, i've noticed some inconsitencies:
I'd propose to remove the |
Another option might be to remove the MySQL Support entirely. Since the database is setup automatically in a container and exclusively for this application, I don't really see the point in letting the user choose here. |
It does not have Hyperkitty in it, it only includes the Web UI for managing Mailman Core.
Yes, because the postorius container does not include HK like mailman-web container does.
Definitely a bug.
|
I'd consider this ready to merge. Please review again. :) What still needs to be done prior to releasing: Write some paragraphs on how existing installations can migrate their configuration from within the docker-compose.yaml into the new .env file. On upgrading, they will get merge conflicts, since they changed the compose files. So that should be addressed. |
Thank you for the changes. One last detail about the environment configuration: Over the years it has become useful to us that (1) Does it seem useful to rename the file to About the other subjects:
|
Sure. Done that. Regarding your other points, I'd suggest to handle these as seperate issues. IMHO they are not linked to the objective of this pull request, which is to remove environment values from the docker-compose.yml |
Can you rebase with the main branch? I think there is an issue related to django-allauth that makes the existing configs fail. |
nvm, I realized GH allows me to do that, so I have just updated the PR |
Actually, I now realize that the tests are failing because we might need to update the tests as well. |
Found that discussion by furtune ... this was the onyl way to achive a running docker config with the -postorius.yaml |
This PR moves the essential environment variables, everyone will need to configure, into a dedicated mailman.cfg file, that is read by docker-compose via the added .env symlink.
The current approach of defining the environment variables directly in the docker-compose.yml file complects the composition of the mailman application with it's configuration. Problems are:
Would you give me some feedback on this idea? If you'd consider merging it, I would also adapt the other two compose files (-mysql and -postorious) to the new format and write some lines on these changes for the NEWS.md and how existing installations can migrate their configuration (they will get merge conflicts, since they changed the compose files.)