Noob question. Tying to apply dark theme to basic file browser

1. Caddy version (caddy version):

v2.2.1

2. How I run Caddy:

as a systemd service

a. System environment:

Manjarolinux

b. Command:

systemctl start caddy
systemctl enable caddy

d. My complete Caddyfile or JSON config:

teddy.dnsuser.de
root * /var/www/html
file_server browse

3. The problem I’m having:

I’m trying to apply this theme to the file browser:

5. What I already tried:

Based on what I gather from the included README and example caddyfiles, I have tried to simply clone the repo to /var/www/html and adjust the Caddyfile, but it seems I haven’t figured out how to do that properly.
Using root * /var/www/html/caddy-browse-template of course just starts the file browser inside the cloned repo :crazy_face: and pointing root to /var/www/html/caddy-browse-template/template.html fails to display anything.
This doesn’t work either:

teddy.dnsuser.de
{
    root /var/www/html/caddy-browse-template/static
    browse / /var/www/html/caddy-browse-template/template.html
}

Your help will be much appreciated. :slight_smile:

Hmm, yeah that repo makes it confusing. They’re using JSON instead of a Caddyfile for the Caddy v2 example, but they call the file “caddyfile.v2”.

You used their Caddy v1 example, which is not compatible with Caddy v2.

You want something like this:

teddy.dnsuser.de {
	root * /var/www/html
	file_server {
		browse /path/to/template
	}
}

See the docs:

Also, I’d recommend keeping your template file outside of your site root (like not inside /var/www/html) because then it’ll be browsable itself. Not really problematic, but cleaner to keep it outside.

1 Like

Thank’s a lot for your help @francislavoie!
I have now moved the theme repo outside the fileserver’s root (to /var/www/caddy-browse-template) and tried changing the Caddyfile to

teddy.dnsuser.de {
	root * /var/www/html
	file_server {
		browse /var/www/caddy-browse-template/template.html
	}
}

In Firefox this gives me a broken styling and when I click on the directory packages for example, I get an error message that the page isn’t available.
At the same time Chromium displays a somewhat better styling:

and there I can open directories.

Looking at the content of template.html I see links like /icons/favicon.svg or /style.css.
In the theme repo those reside inside static/
So I tried moving template.html inside the static/ dir so it can “see” those files.
The effect now being that I can open packages/ directory now also in Firefox, but styling is still broken like before in FF and it looks the same as before in Chromium, too, with the bright background…

I have now also opened an issue on the theme’s github with more screenshots of more attempts, as I cannot post more than one currently here as a new forum user:
https://github.com/cs91chris/caddy-browse-template/issues/1

1 Like

Cool - yeah at this point I’d call this an issue with that template. Will mark this as solved for now.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.