-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add support for context path #313
Conversation
add an optional environment variable: LD_CONTEXT_PATH
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.
Thanks, this looks very promising. I did give this a shot at some point, and could not come up with a good solution, but the path
nesting you are using here makes this pretty easy.
I did an initial review and some manual testing, I still need to test running the production app from a Docker container.
Did you already test that this works with a reverse proxy such as nginx? Would you have a configuration that I could reproduce the tests with?
I am using docker and Nginx on my NAS for linking.
|
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.
Changes look good, also could not find any issues with testing the Docker image 👌
Why it is called "context path"? |
hello, using test image from dockerhub did not work with subpath. access to nginx block conf
image version nginx logs:
linkding logs:
|
add |
Try removing the slash which end of proxy_pass. @kt1024
|
@s2marine just tried remove
just found similar issue #39 . |
@0x9394 After removing the LD_CONTEXT_PATH configuration, I still get CSRF errors. You should create a new issue for that.
|
following these 2 links in running container I found in
now I get reverse proxy with subpath working, just in a ugly way:
|
Same problem here with apache proxy to https://my.domain/ with no subdir. The ugly solutions works great. Would be great to have an option to set the real hostname on proxy side. |
So it seems this is not a context path problem, but related to changes to CSRF handling in Django 4.0, which is used since the latest linkding release. I need to dig a bit deeper into the docs to see if this can be configured in a reasonable way out of the box. Currently it looks like if you are running a proxy you might need to configure the specific domain to get the application running, which is not a great experience. It doesn't seem to be a general problem, as I don't have this issue with my personal installation (using Caddy), or with the demo instance running on fly.io. For now I created an issue for this: #340 |
add an optional environment variable: LD_CONTEXT_PATH.
I'm not very familiar with django, but I tried my best to do it.
Please let me know if there is any code to improve.
Thank you.
Closes: #127