-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Adding CORS support via environment variable #1822
Conversation
Signed-off-by: Adyanth H <[email protected]>
Bump, Can someone review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure how I feel about this idea overall.
What is stopping you from using http://pi.hole
instead of your own custom domain name?
I have two of them in HA, which is why I cannot use pi.hole. And I'm using https with a certificate for my lan domain along with my actual domain, both of which can be used to access it (from the internet, protected by SASE). If we are using nginx, we can change the nginx conf bypass CORS check just by using the config file as below, which is what I use on my other pihole instance on raspberry pi. But sadly that cannot be done on the docker image which uses lighttpd.
This may be a vulnerability too? Where an empty origin is always successful in auth.php. |
Signed-off-by: Adyanth H <[email protected]>
Are you saying that this PR could introduce a vuln? |
Hey @PromoFaux , no, that was referring what I am already using with the traditional install + nginx. That was how I was working around for the CORS issue by setting the http origin empty in the PHP environment. Maybe that is a trusted operation, and another discussion altogether. This PR adds support to set accepted names for the Host header to support FQDN other than pi.hole, tested for the docker install with lighttpd. |
One last check, to make sure I'm not entirely missing something here... Isn't this what the |
No, scratch that. I see now. |
@DL6ER, Something to keep in mind for API / V6 (description of issue here: bastienwirtz/homer#194) |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-9-web-v5-6-and-core-v5-4-released/49544/1 |
By submitting this pull request, I confirm the following:
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
This adds support for enabling CORS on per host/domain basis
Fixes #1820
How does this PR accomplish the above?:
This uses an additional environment variable (introduced in pi-hole/docker-pi-hole#864 and pi-hole/docker-pi-hole#867) to get this list of domains where CORS can be enabled.
What documentation changes (if any) are needed to support this PR?:
Need to document the presence and usage of the new environment variable
CORS_HOSTS
.Ex:
CORS_HOSTS=test.domain.com,example.com
.