1. Caddy version (caddy version
):
v2.0.0
2. How I run Caddy:
a. System environment:
On Ubuntu 20.04 amd64, installed using the official repository.
b. Command:
systemctl restart caddy
c. Service/unit/compose file:
default from repo - systemd
d. My complete Caddyfile or JSON config:
:80
root * /usr/share/caddy
file_server {
browse /etc/caddy/browse.tpl
}
The browse.tpl template was apparently made for Caddy v1 and can be found here.
The alternate template used can be found here.
3. The problem I’m having:
Accessing the web server results in a blank page.
4. Error messages and/or full log output:
2020/05/24 21:44:25.281 ERROR http.log.error template: browse.tpl:223:39: executing “browse.tpl” at <.BreadcrumbMap>: can’t evaluate field BreadcrumbMap in type fileserver.browseListing {“request”: {“method”: “GET”, “uri”: “/”, “proto”: “HTTP/1.1”, “remote_addr”: “87.160.xxx.xxx:49887”, “host”: “141.164.54.xxx”, “headers”: {“Accept-Language”: [“en-US,en;q=0.5”], “Dnt”: [“1”], “Connection”: [“keep-alive”], “Upgrade-Insecure-Requests”: [“1”], “If-None-Match”: [“"q9tge59fm"”], “Accept”: [“text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”], “Accept-Encoding”: [“gzip, deflate”], “If-Modified-Since”: [“Mon, 04 May 2020 16:56:29 GMT”], “Cache-Control”: [“max-age=0”], “User-Agent”: [“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0”]}}, “duration”: 0.000934518, “status”: 500, “err_id”: “bkyysr3jw”, “err_trace”: “fileserver.(*FileServer).serveBrowse (browse.go:80)”}
The second template results in the following error as soon as the browse folder isn’t empty:
"msg":"template: browse.tpl:27:33: executing \"browse.tpl\" at <$.Replace>: can't evaluate field Replace in type fileserver.browseListing"
5. What I already tried:
Browse without a template works fine
6. Links to relevant resources:
Browse plugin KODI/XBMC support - Thread used as reference