-
-
Notifications
You must be signed in to change notification settings - Fork 959
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
Allow setting Django USE_X_FORWARDED_HOST in settings_docker.py
#8566
Comments
You can customize the settings.py without rebuilding the image, see https://docs.weblate.org/en/latest/admin/install/docker.html#overriding-settings-from-the-data-volume. Exposing USE_X_FORWARDED_HOST in environment seams reasonable way to go. |
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this. You can learn about how to get started in our contributors documentation. |
Oh thanks, I was looking at that page, but never saw it because of the huge list of configuration options above it. |
It's mentioned in the beginning as well (https://docs.weblate.org/en/latest/admin/install/docker.html#docker-environment-variables), but suggestions how to make it easier to spot are welcome. |
Hi @nijel , I would like to work on this issue. Is the solution just exposing the environment variable USE_X_FORWARDED_HOST in dev-docker/environment file ?? Am i correct on this ?? I will be waiting for your response and start raising a PR once you give an approval on this. Thanks |
It needs to be added to https://github.com/WeblateOrg/weblate/blob/main/weblate/settings_docker.py, you are welcome to contribute this. |
@nijel thanks for your reply. Do you want me to add any default value for this environment variable ?? |
Yes, it should default to false as in Django, see how other boolean variables are handled in that file. |
@nijel thanks for this. Have a nice day. Got it !! |
@nijel here is my PR. Please check and let me know if you require any more changes from my end. Thanks !! |
Fixes #8566 Co-authored-by: PavanKumar <dpavankumar@attentive.ai> Co-authored-by: Michal Čihař <michal@cihar.com>
Thank you for your report; the issue you have reported has just been fixed.
|
Describe the problem
It is documented here that:
Altought this is a solution, it is sometimes difficult to adjust the proxy settings.
Describe the solution you'd like
It would be nicer to be able to configure Weblate to use an "X-Forwarded-Host" header which is often supplied.
This is supported by Django with the USE_X_FORWARDED_HOST setting.
This setting isn't currently exposed in the
settings_docker.py
so it can't be set with environment variables.Describe alternatives you've considered
Building a custom docker image with a custom
settings.py
which exposes the setting.Or alternatively mounting a custom
settings.py
into the running container to expose it.Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: