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
Hi, currently there's no way to have multiple URL's be trusted for both CORS & CSRF_TRUSTED_ORIGINS list (which breaks my setup and probably others' too).
Should be a quick fix - CORS is already implemented by parsing KHOJ_DOMAIN (per #662), and still works.
However, CSRF allowlist seems to not be correctly splitting the env variable on its commas (per below screenshot).
To Reproduce
Steps to reproduce the behavior:
Add a comma and a second URL to the KHOJ_DOMAINS env variable.
I'm pretty sure the offending line(s) for a potential fix are:
zazer0
changed the title
[FIX] Regression allowing KHOJ_DOMAIN to be a comma-seperated list
[FIX] Regression breaking KHOJ_DOMAIN's ability to be a comma-seperated list
Jan 9, 2025
Hi @zazer0, can you describe why you need to allow multiple domains? Is setting KHOJ_DOMAIN to khoj.zazers.domain not good enough?
The ability to specify multiple KHOJ_DOMAIN via a comma separated list passed via an environment variable isn't supported. The KHOJ_DOMAIN is used to configure the CSRF_COOKIE_DOMAIN and SESSION_COOKIE_DOMAIN Django variables as well and those variables only allow a single domain.
debanjum
changed the title
[FIX] Regression breaking KHOJ_DOMAIN's ability to be a comma-seperated list
[FIX] Add multiple domains to allowed list via KHOJ_DOMAIN
Jan 11, 2025
Describe the bug
Hi, currently there's no way to have multiple URL's be trusted for both CORS & CSRF_TRUSTED_ORIGINS list (which breaks my setup and probably others' too).
Should be a quick fix - CORS is already implemented by parsing KHOJ_DOMAIN (per #662), and still works.
However, CSRF allowlist seems to not be correctly splitting the env variable on its commas (per below screenshot).
To Reproduce
Steps to reproduce the behavior:
Add a comma and a second URL to the KHOJ_DOMAINS env variable.
I'm pretty sure the offending line(s) for a potential fix are:
khoj/src/khoj/app/settings.py
Lines 31 to 42 in 8803686
Is someone with Django knowledge able to fix this? 🙏
Screenshots
Platform
If self-hosted
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: