caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
55.53k stars 3.91k forks source link

Unexpected need of execute permissions #6283

Closed Lueton closed 2 months ago

Lueton commented 2 months ago

Hi! Im a bit confused by the need of execute permissions for my caddy file_server.

The used directory recursively has myuser:mygroup 644 permissions. The caddy user has mygroup as group. As long as i do not upgrade permissions to 654 (with group execute permissions) i always get 403 with access denied error.

Is this intended or am i doing something wrong?

Caddy: v2.7.8 OS: Ubuntu 22.04 Caddyfile: (names replaced)

my-domain {
    tls /var/lib/caddy/mycert.cer /var/lib/caddy/mycert.key
    encode gzip

    handle {
        root * /srv/frontend
        try_files {path} /index.html
        file_server
    }
}
mohammed90 commented 2 months ago

This is how permissions work on Linux, see: https://unix.stackexchange.com/questions/21251/execute-vs-read-bit-how-do-directory-permissions-in-linux-work. The operating system requires the execution permission to allow the user to read the directory contents.

Lueton commented 2 months ago

This is how permissions work on Linux, see: https://unix.stackexchange.com/questions/21251/execute-vs-read-bit-how-do-directory-permissions-in-linux-work. The operating system requires the execution permission to allow the user to read the directory contents.

Well 😅. Thank you for clarification and growing my linux knowledge.