You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tag/version of Container Images
0.4.* but I believe 0.3.* is also affected
Currently DJANGO_ALLOWED_HOSTS is retrieved directly from the environment. This seems to limit us to setting a single host/domain in that environment variable because ALLOWED_HOSTS expects a different python list entry for each allowed host.
In our current proof of concept installation we are trying to deploy a single mailman 3 installation with vhosts for different list domains. In order to make that work with DJANGO_ALLOWED_HOSTS I had to modify settings.py like this:
django_allowed_hosts = os.environ.get('DJANGO_ALLOWED_HOSTS')
if django_allowed_hosts:
ALLOWED_HOSTS.extend(django_allowed_hosts.split(':'))
The split on : is somewhat arbitrary and may be a bad choice as it would conflict with ipv6 addresses.
It does seem like something like this is necessary to support adding multiple allowed hosts via DJANGO_ALLOWED_HOSTS? Another approach would be to avoid this env var entirely and append to ALLOWED_HOSTS in our settings_local.py file. Reporting this as it seems this env var doesn't currently work as expected. I'm happy to submit a pull request too if we can agree on a good way to address this.
The text was updated successfully, but these errors were encountered:
when we want to get all configuration into the docker-compose.yml, your approach points into a good direction - ALLOWED_HOSTS should be added to the settings_local.py during container startup using web/docker-entrypoint.sh
I have seen comma (,) being used as a delimiter in such cases and it would probably not break existing values either, so I am okay with adding that. Would you be interested to open a PR for that?
maxking
changed the title
[BUG] DJANGO_ALLOWED_HOSTS limited to listing one extra host/domain
DJANGO_ALLOWED_HOSTS limited to listing one extra host/domain
Jan 6, 2023
Tag/version of Container Images
0.4.* but I believe 0.3.* is also affected
Currently
DJANGO_ALLOWED_HOSTS
is retrieved directly from the environment. This seems to limit us to setting a single host/domain in that environment variable because ALLOWED_HOSTS expects a different python list entry for each allowed host.In our current proof of concept installation we are trying to deploy a single mailman 3 installation with vhosts for different list domains. In order to make that work with
DJANGO_ALLOWED_HOSTS
I had to modify settings.py like this:The split on
:
is somewhat arbitrary and may be a bad choice as it would conflict with ipv6 addresses.It does seem like something like this is necessary to support adding multiple allowed hosts via
DJANGO_ALLOWED_HOSTS
? Another approach would be to avoid this env var entirely and append toALLOWED_HOSTS
in oursettings_local.py
file. Reporting this as it seems this env var doesn't currently work as expected. I'm happy to submit a pull request too if we can agree on a good way to address this.The text was updated successfully, but these errors were encountered: