-
Notifications
You must be signed in to change notification settings - Fork 103
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
[BUG] ALLOWED_HOSTS hardcodes 'mailman-web' breaking container use with host networking #549
Comments
Just ran into this issue. Makes the image unuseable |
Also running into this when deploying to AWS Fargate. I've worked around it for now, but would be good if this line doesn't throw. It would simplify my deployment a lot. Would it be possible to make it optional? If it resolves add it in, otherwise handle the exception and not add it in? |
Hey friend, would you have any documentation or crib notes that you could share regarding your Fargate deployment, please? This is exactly what I want to do, but not sure where to get started. Thanks! |
Perhaps something like - this? |
I am fine with adding another env var, You can also just update ALLOWED_HOSTS completely in your settings.py. Please feel free to send a PR. |
Tag/version of Container Images
0.4.* but I believe 0.3.* is also affected
Currently ALLOWED_HOSTS hardcodes mailman-web which means you cannot use host networking or name your containers with different names. In particular it is the
gethostbyname()
call that fails becausemailman-web
does not resolve when using host networking or when you name the container differently.In our proof of concept deployment I was able to modify names and urls using existing environment variables for everything else that needs to know where the web container is located. This usage was the only one that required me to replace the
settings.py
file. In particular we cannot usesettings_local.py
here because thesettings.py
definition ofALLOWED_HOSTS
is always evaluated.I'm not sure what the best way to address this would be to maintain backward compatibility. I think the best option may be to see if
mailman-web
resolves and if so add both the name and IP address toALLOWED_HOSTS
otherwise leave it out. That way we can catch and handle thegethostbyname()
error if the name isn't valid.I'm happy to submit a PR to address this, but was hoping for a bit of direction on the best approach before I did that.
The text was updated successfully, but these errors were encountered: