-
-
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
Some directories return 404 with file-server --browse
#4542
Comments
Can you give us a config to reproduce this? |
Ah, the It's pretty bare-bones, I don't think it should be hiding anything by defaut:
Let me try to reproduce it real quick. What happens when you run |
So I just tried the same command on my Linux machine and it works for me. I'm guessing it has something to do with your system setup. PROTECT_HOME=true? Something else funky might be going on. I recommend troubleshooting with |
Oh, try enabling Also try a caddyfile:
|
$ sudo caddy environ
caddy.HomeDir=/root
caddy.AppDataDir=/root/.local/share/caddy
caddy.AppConfigDir=/root/.config/caddy
caddy.ConfigAutosavePath=/root/.local/share/caddy/autosave.json
caddy.Version=v2.4.6
runtime.GOOS=linux
runtime.GOARCH=amd64
runtime.Compiler=gc
runtime.NumCPU=8
runtime.GOMAXPROCS=8
runtime.Version=go1.17.3
os.Getwd=/home/lonble
COLORTERM=truecolor
XAUTHORITY=/run/user/1000/gdm/Xauthority
LANG=en_US.UTF-8
TERM=xterm-256color
DISPLAY=:0
PATH=/home/lonble/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/lonble/Programs
MAIL=/var/mail/root
LOGNAME=root
USER=root
HOME=/root
SHELL=/bin/bash
SUDO_COMMAND=/usr/bin/caddy environ
SUDO_USER=lonble
SUDO_UID=1000
SUDO_GID=1000 $ curl -v 127.0.0.1
* Trying 127.0.0.1:80...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Server: Caddy
< Date: Sat, 22 Jan 2022 08:27:21 GMT
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact |
run with
run with the Caddyfile:
I accessed /, /home/, /home/lonble/
|
I can access / normally on my VPS, but I can't access directories such as /bin, /lib, /etc, which is strange.
The title of this Issue doesn't reflect the problem very accurately, I'll update it. |
file-server --browse
Could you try building from the At this point this is the 3rd report in a couple weeks about 404s from |
I built caddy from the |
For me, symbolic link cause 404, not sure if it's same as the author reproduce steps
|
For me, not related to symbolic links. Both /usr/bin/ and /bin/ are inaccessible. |
@gutenye maybe you should open a new issue and in detail show the behaviour you're seeing. Please enable the @lonble thanks for checking! We did make some changes since v2.4.6 was released in the fileserver package but I didn't think it was related to 404s. We've had five commits in that package since the last release. I think the last one I the most likely to have been the fix (but you could confirm by building against those specific commits to find where it was resolved): https://github.com/caddyserver/caddy/commits/master/modules/caddyhttp/fileserver |
After checking several other issues about reporting 404, I found the problem. As described by @bones-was-here in #4411 ,
After my testing, it is confirmed that it has been fixed in #4415 . |
I can also confirm that a basic
With the (broken) symlink in place, I tried both the release When might we see the next release containing the patch/fix from #4415? |
When we've merged in all the changes we have in the v2.5.0 milestone, probably. For now, it's fine to use a build from the |
Looks like until the fix is released the workaround is to use the previous stable branch (assuming go 1.18+): go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
xcaddy build v2.4.5 Another option that worked is building from the commit hash of the linked pull request (this will produce xcaddy build c8b5a81607c9c2799f46f42154ee311884723aa4 [Unrelated to this issue]: master (b4f1a71) throws an error (both with go Output of cloud.google.com/go/kms/apiv1: ambiguous import: found package cloud.google.com/go/kms/apiv1 in multiple modules:
cloud.google.com/go v0.83.0 (/Users/vio/projects/go/pkg/mod/cloud.google.com/[email protected]/kms/apiv1)
cloud.google.com/go/kms v1.1.0 (/Users/vio/projects/go/pkg/mod/cloud.google.com/go/[email protected]/apiv1) |
The fix is released in |
When I use file-server, I find that caddy always returns 404 when I access the root "/" of the disk or the user's home directory, even i run it as root. The documentation doesn't explain the reason for this, or even say anything about auto-hiding these directories. This is already causing a lot of trouble for my actual use case and I need some option to disable this implicit feature.
The text was updated successfully, but these errors were encountered: