diff --git a/.gitignore b/.gitignore index 7df2c28..e87eb0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ email + +errors/img/ diff --git a/Caddyfile b/Caddyfile index 60ed10b..f4a3165 100644 --- a/Caddyfile +++ b/Caddyfile @@ -17,8 +17,9 @@ handle_errors { #respond "{http.error.status_code} {http.error.status_text}" - rewrite * /{http.error.status_code}.jpg - root * /var/www/errors + templates + rewrite * /index.html + root * /etc/caddy/errors file_server } } diff --git a/conf.d/errors.boba.best b/conf.d/errors.boba.best new file mode 100644 index 0000000..027e45a --- /dev/null +++ b/conf.d/errors.boba.best @@ -0,0 +1,7 @@ +# vim: ft=caddyfile + +errors.boba.best { + root * /etc/caddy/errors/img + file_server + import basicerrors +} diff --git a/errors/dl.sh b/errors/dl.sh new file mode 100755 index 0000000..ba442e3 --- /dev/null +++ b/errors/dl.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p img/ +cd img/ +curl https://http.cat | grep -oE '[0-9]{3}\.jpg' | sort | uniq | parallel $@ 'wget -q https://http.cat/{} && echo "DL {}"' diff --git a/errors/index.html b/errors/index.html new file mode 100644 index 0000000..2aaea9c --- /dev/null +++ b/errors/index.html @@ -0,0 +1,11 @@ + + + {{placeholder "http.error.status_code"}} {{placeholder "http.error.status_text"}} + + +
+

{{placeholder "http.error.status_code"}} {{placeholder "http.error.status_text"}}

+ cat +
+ +