Can't filemanager be used for multible defined paths in one domain?

Hi there, something odd happened.
I try to set up filemanager for multible paths but it somewhat only works for the first entry.
While a direct attept to open a file works like a charm (for user2), the baseurl just brings a 404.
A 3rd entry tried at three webpages served by caddy already completly ends in a 404. :no_mouth:


[22/Jan/2017:09:31:55 +0100] "GET /user1/ HTTP/2.0" 200 2502

[22/Jan/2017:09:25:19 +0100] "GET /user2/ HTTP/2.0" 404 38
# filemanager interface missing
[22/Jan/2017:09:25:15 +0100] "GET /user2/H6E6ta86_400x400.jpg HTTP/2.0" 200 11042

# public/ folder of a rails app
[22/Jan/2017:09:27:58 +0100] "GET /test HTTP/2.0" 404 38
[22/Jan/2017:09:36:44 +0100] "GET /test/apple-touch-icon.png HTTP/2.0" 404 14

# a simple placeholderpage already served by caddy
[22/Jan/2017:09:36:50 +0100] "GET /test/ HTTP/2.0" 404 38
[22/Jan/2017:09:40:33 +0100] "GET /test/index.html HTTP/2.0" 404 38
[22/Jan/2017:09:40:54 +0100] "GET /test/bg.jpg HTTP/2.0" 404 14

# an images index "page/directory" already served by caddy 
[22/Jan/2017:09:42:12 +0100] "GET /test/ HTTP/2.0" 404 38
[22/Jan/2017:09:42:28 +0100] "GET /test/version-example.jpg HTTP/2.0" 404 14
users.domai.n {
        tls inbox@domai.n {
                key_type rsa4096
        }
        gzip
        header / {
                Strict-Transport-Security "max-age=31536000;"
        }
        basicauth /user1 user1 pass
        basicauth /user2 user2 pass
        filemanager /user1 {
                show            /home/mh-users/user1
                allow_new       true
                allow_edit      true
                block           /secret/file
                user1:
                allow_command   git
        }
        filemanager /user2 {
                show            /home/mh-users/user2
                allow_new       true
                allow_edit      true
                user2:
                allow_command   git
        }
        filemanager /test {
                show /var/www/images
        }
        root /home/mh-users
        log /var/log/caddy/mhusers_access.log
        errors /var/log/caddy/mhusers_errors.log
}

Revision: ee15361

1 Like

This is, indeed, a bug. I’ll work on it. Can you post this on GitHub issues, please?

One thing, I didn’t stop noticing you’re using some options that are unnecessary:

filemanager /user1 {
       show            /home/mh-users/user1
       allow_new       true
       allow_edit      true
       block           /secret/file
       user1:
       allow_command   git
}

Could be simply replaced by:

filemanager /user1 {
       show            /home/mh-users/user1
       block           /secret/file
}

The options allow_new and allow_edit are true by default and the command git is allowed by default too, as well as svn and hg.

Update 1: Oh, you don’t need to. I just fixed this :smile:

1 Like

Wonderful, it is working, thank you!
And thanks for the default setting hints. :blush:

1 Like

You’re welcome. You can check the default on the documentation: caddyserver.com/docs/filemanager.