ft_chatons/core/caddy/config/sites/outils.caddy
2026-03-02 15:31:24 +01:00

42 lines
826 B
Plaintext

outils.chatons.duckdns.org {
header X-Chatons "miaou"
respond /healthcheck "OK"
redir / /hello/world
redir /hello /hello/world
handle_path /hello/* {
respond "Hello {path.0}!"
}
handle /date {
templates
respond `{{now | date "2006-01-02 15:04:05"}}`
}
handle /ip {
respond "{http.request.remote.host}"
}
handle_path /b64/encode/* {
templates
respond `{{ .Req.URL.Path | trimPrefix "/" | b64enc }}`
}
handle_path /b64/decode/* {
templates
respond `{{ .Req.URL.Path | trimPrefix "/" | b64dec }}`
}
basic_auth /secretpage {
# username "towel" password "poisson"
towel $2a$14$/cfdN3/kWYwiw/OeAtLcjOxj/NFZa3gUxqePMSoNh1VmoDzS1BP5S
}
handle_path /secretpage {
respond "Welcome, {http.auth.user.id}" 200
}
handle_path /teapot {
respond "HTML Tea! Tea! Teapot!" 418
}
}