1. The problem I’m having:
I have the need to get just the list of files from the file_server’s browse directive, to be fed into a shell script, to present a dialog for the user to pick the file which would get processed elsewhere, all inside a terminal session, ie. I can’t parse a HTML file
2. Error messages and/or full log output:
N/A
3. Caddy version:
2.7
4. How I installed and ran Caddy:
Custom compile for acme_dns
a. System environment:
Linux, Devuan/Debian/Ubuntu
typically with supervisor
b. Command:
supervisorctl start caddy
c. Service/unit/compose file:
d. My complete Caddy config:
{
log {
format json
output file /var/log/caddy/apter-global.log {
}
level debug
}
}
localhost {
respond "Hello, world!"
}
localhost:2016 {
respond "Goodbye, world!"
}
aptcacher.theb.org.in {
handle_path /echo {
respond "Goodbye, world!"
}
# Set this path to your site's directory.
log {
output file /var/log/caddy/apter-access.log {
}
level debug
}
tls {
dns acmedns /etc/acmedns/clientstorage.json
propagation_timeout -1
propagation_delay 15s
}
# Enable the static file server.
handle_path /files/* {
file_server {
browse
root /files
}
}
handle_path /hv/* {
file_server {
browse /files/template.file
root /files
}
}
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
5. Links to relevant resources:
I’ve looked, and got lost in caddy/modules/caddyhttp/fileserver/browse.html at master · caddyserver/caddy · GitHub and modules/http.handlers.templates — Caddy Documentation
as I was directed there from file_server (Caddyfile directive) — Caddy Documentation
What I miss, is a “loop” directive, or rather, which variable(s) to pump to a loop directive.
Is there a “How To”/Tutorial I can follow to assist me?