-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
2.4.6 regression: presence of symlink breaks file_server browse #4411
Comments
The change in #4354 must've been the cause. @HayatoShiba would you be willing to look into this, since it was your change? Thanks! |
I've noticed this issue as well for v2.4.6-- you can see here -- the symbolic links that point to directories are browseable (see Extractions link "By Common Name"). Inside those directores, however, you'll get a 404. I have verified that the symlinks are there. The Extractions link "By Date" are the sources to which the symlinks point, for reference. Please let me know if I can provide any more information. |
@mcguirepr89 could you try building from PR #4415, with the proposed fix? Confirmations that it fixes it will speed up the process! |
Sure thing! Give me a little bit and I'll let you know |
@francislavoie unfortunately, that did not fix the issue on my end -- you can see the same site is now being served from a caddy built from PR #4415 for a frameless caddy-only site go here |
Okay, thanks @mcguirepr89. @jjlin see the above? |
@mcguirepr89 Are you sure your build actually includes the fix? Try this: mkdir /tmp/symlink-test
echo foo > /tmp/symlink-test/foo
ln -s foo /tmp/symlink-test/foo-symlink
caddy file-server -browse -root /tmp/symlink-test -listen :8080 Without the fix (version 2.4.6): $ curl -I http://localhost:8080
HTTP/1.1 404 Not Found
Server: Caddy
Date: Fri, 12 Nov 2021 21:12:16 GMT With the fix (PR #4415): $ curl -I http://localhost:8080
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Server: Caddy
Date: Fri, 12 Nov 2021 21:12:30 GMT If that works the same way for you, can you elaborate on your directory structure and what your Caddyfile or command line looks like? |
@jjlin The directory structure is below:
I'm so sorry I have to go at the moment but will update when I am back And my Caddyfile (with basicauth stuff removed):
|
Well, I don't see anything unusual there. I'm still thinking something else is going wrong on your side. Famous last words, but I don't see anything that could go catastrophically wrong in the PR. It would be helpful if others affected by this issue could offer some additional data points. I serve a directory structure with lots of symlinks, and the fix works fine for me. |
Please turn on the |
Hello @francislavoie and @jjlin -- I apologize for the delay. Please find the debug-enabled logging for the site using #4415. The log shows me attempting to access a directory with symbolic links:
The messages do say
@jjlin I am not able to do much more until tomorrow when I will be able to test these things on a clean install, but please let me know how I can help. Thank you all, |
I've still not been able to get back to try on a clean install -- but I did downgrade to 2.4.5 and now everything works as expected. I didn't change anything else on my end except for the downgrade. |
@mcguirepr89 It's a bit difficult to determine what's really going wrong without access to your environment. Could you maybe pare down your directory structure and config to create a minimal reproducible example? Also, it would probably be better to move this discussion over to #4415 since your issue is really with that specific implementation. |
If someone else with the problem can verify that #4415 fixes the problem, we can probably merge it. |
Thank you everyone for helping with this! |
I echo those thanks |
It seems that if a symlink exists in a directory, that directory's contents can't be viewed with the browser. The error is 404. It happens with valid and broken symlinks. 2.4.5 does not have this issue.
The text was updated successfully, but these errors were encountered: