[V1] Hide Folders in browse directive

1. My Caddy version (caddy -version):

Caddy v1.0.4 (h1:wwuGSkUHo6RZ3oMpeTt7J09WBB87X5o+IZN4dKehcQE=)

2. How I run Caddy:

Systemd, as non-privilaged user

a. System environment:

OS, relevant versions, systemd? docker? etc.
Ubuntu 18.04

c. Service/unit/compose file:

[Unit]
Description=Caddy's service
ConditionFileIsExecutable=/usr/local/bin/caddy

[Service]
StartLimitInterval=5
StartLimitBurst=10

User=caddyserver
Group=caddyserver


Environment=CLOUDFLARE_EMAIL=(REDACTED)
Environment=CLOUDFLARE_API_KEY=(REDACTED)

ExecStart=/usr/local/bin/caddy "-agree=true" "-conf=/opt/caddy/caddy.conf" "-email=(REDACTED)"

Restart=always
RestartSec=120

[Install]
WantedBy=multi-user.target

d. My complete Caddyfile:

basically

https://cdn.example.com {

        tls /opt/caddy/cert/pub /opt/caddy/cert/priv

        root /opt/fileserver/
        log /opt/caddy/log/cdn.log
	errors /opt/caddy/log/cdn.err
        browse /
}


3. The problem I’m having:

I dont know how to hide .folder/s in the browse directive,
specifically .hidden folders,

Any ideas?

I don’t have a way to test this to confirm currently, but if I recall correctly, the internal directive can be used to hide files and folders. I’m not certain if it works alongside the browse directive, but it might.

If you want to try Caddy v2 (currently in beta), you can use the hide subdirective of the file_server directive.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.