ft_chatons/core/caddy/config/sites/outils.caddy

59 lines
1.3 KiB
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 {
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
}
handle_path /links {
header Content-Type text/html
respond <<HTML
<html>
<head><title>Links</title></head>
<body>
<ul>
<li><a href="https://cloud.chatons.duckdns.org">Nextcloud</a></li>
<li><a href="https://peertube.chatons.duckdns.org">Nextcloud</a></li>
<li><a href="https://vogsphere.chatons.duckdns.org">Gitea</a></li>
<li><a href="https://keycloak.chatons.duckdns.org">Keycloak</a></li>
<li><a href="https://diagrams.chatons.duckdns.org">Diagrams</a></li>
</ul>
</body>
</html>
HTML 200
}
}