add caddy errors
Some checks failed
ci / build (push) Failing after 1s
ci / Tests & Checks (push) Failing after 1s

This commit is contained in:
CJ_Clippy 2025-08-13 22:37:48 -08:00
parent 49ec230be4
commit 1129c0c85c
6 changed files with 163 additions and 2 deletions

View File

@ -1,3 +1,31 @@
future.porn
future.porn {
reverse_proxy server:5000
reverse_proxy server:5000
handle_errors {
root * /srv/errors
@401 expression `{http.error.status_code} == 401`
handle @401 {
rewrite * /401.html
file_server
}
@403 expression `{http.error.status_code} == 403`
handle @403 {
rewrite * /403.html
file_server
}
@404 expression `{http.error.status_code} == 404`
handle @404 {
rewrite * /404.html
file_server
}
@5xx expression `{http.error.status_code} >= 500`
handle @5xx {
rewrite * /500.html
file_server
}
}
}

View File

@ -9,6 +9,7 @@ services:
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./errors:/srv/errors
networks:
- default

View File

@ -0,0 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future.porn - Unauthorized</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
</head>
<body>
<section class="section has-text-centered">
<div class="container">
<h1 class="title is-1">401 - Unauthorized</h1>
<p class="subtitle">You are not authorized to access this page. Please <a href="/auth/patreon">log in</a> and try
again.</p>
<figure class="image is-128x128 is-inline-block" style="margin-top: 2rem;">
<img src="https://http.cat/401" alt="401 Cat">
</figure>
</div>
</section>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future.porn - Access Denied</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
</head>
<body>
<section class="section has-text-centered">
<div class="container">
<h1 class="title is-1">403 - Forbidden</h1>
<p class="subtitle">You found the velvet rope… but you're not on the list.</p>
<div class="content">
<p>This page is off-limits. It might be private, restricted, or just not ready for public viewing.</p>
<p>
You can:
</p>
<ul style="list-style: none; padding-left: 0;">
<li>Log in with the correct credentials</li>
<li><a href="/">Return to the homepage</a></li>
<li><a href="/contact">Request access</a></li>
</ul>
</div>
<figure class="image is-128x128 is-inline-block" style="margin-top: 2rem;">
<img src="https://http.cat/403" alt="403 Cat">
</figure>
</div>
</section>
</body>
</html>

View File

@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future.porn - Page Not Found</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
</head>
<body>
<section class="section has-text-centered">
<div class="container">
<h1 class="title is-1">404 - Page Not Found</h1>
<p class="subtitle">Looks like you took a wrong turn in the timeline.</p>
<div class="content">
<p>The page you're looking for doesn't exist or has been moved.</p>
<p>
You can:
</p>
<ul style="list-style: none; padding-left: 0;">
<li>Double-check the URL</li>
<li><a href="/">Return to the homepage</a></li>
</ul>
</div>
<figure class="image is-128x128 is-inline-block" style="margin-top: 2rem;">
<img src="https://http.cat/404" alt="404 Cat">
</figure>
</div>
</section>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>future.porn - Internal Server Error</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
</head>
<body>
<section class="section has-text-centered">
<div class="container">
<h1 class="title is-1">500 - Internal Server Error</h1>
<p class="subtitle">The timeline has glitched. We're working on it.</p>
<div class="content">
<p>Something went wrong on our side. A human has been notified.</p>
<p>
You can:
</p>
<ul style="list-style: none; padding-left: 0;">
<li>Wait a moment and <a href="javascript:location.reload()">try again</a></li>
<li><a href="/">Return to the homepage</a></li>
<li><a href="/contact">Contact support</a></li>
</ul>
</div>
<figure class="image is-128x128 is-inline-block" style="margin-top: 2rem;">
<img src="https://http.cat/500" alt="500 Cat">
</figure>
</div>
</section>
</body>
</html>