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

Allow setting CSRF_TRUSTED_ORIGINS via .env #305

Closed
jangrewe opened this issue May 23, 2024 · 3 comments
Closed

Allow setting CSRF_TRUSTED_ORIGINS via .env #305

jangrewe opened this issue May 23, 2024 · 3 comments

Comments

@jangrewe
Copy link

I have just set up the whole OpenWISP stack with the edge images and got this error:

Forbidden (Origin checking failed - https://openwisp.faked.org/ does not match any trusted origins.): /admin/login/

(It worked fine with the latest images.)

There is a fix mentioned in ansible-openwisp2: openwisp/ansible-openwisp2#443
But editing the settings.py is not that easy with Docker images, for as a workaround i'm mounting a fixed settings.py into the Dashboard container - and then it works.

It would be great if setting CSRF_TRUSTED_ORIGINS via the .env file would be possible, similar to how DJANGO_ALLOWED_HOSTS is already handled.

Thanks!

@nemesifier
Copy link
Member

@jangrewe I am open to adding this. In the meantime, this should let you define custom settings: https://github.com/openwisp/docker-openwisp?tab=readme-ov-file#custom-django-settings.

@jangrewe
Copy link
Author

Oh snap, ich completely forgot about that, because when doing my "docker-compose.yml to custom Ansible role" thing, i didn't add that bind mount because i though "nah, i won't be needing that..." - shame on me! 🫣

But thanks for adding this anyways, as it seems to be not a one-off situation that this needs to be set. 😉

@nemesifier
Copy link
Member

I think the docs about customizing settings is good enough for this, hence I'm closing.
BTW: the docs for advanced customizations are being moved to the Unified Documentation Website.

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

No branches or pull requests

2 participants