Improve blockpage reliability and deployment

This commit is contained in:
Christian Krakau-Louis
2026-05-22 12:46:40 +02:00
parent 085abe990b
commit f2bbdcc3ab
12 changed files with 1041 additions and 352 deletions
+101 -53
View File
@@ -1,74 +1,122 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8">
<title>Access Blocked</title>
<!-- Materialize CSS -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
rel="stylesheet"
/>
<!-- Material Icons -->
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
color-scheme: light dark;
--bg: #f4f7fb;
--panel: #ffffff;
--text: #1f2937;
--muted: #5f6b7a;
--border: #d7dee8;
--accent: #c2410c;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #101827;
--panel: #162033;
--text: #f8fafc;
--muted: #cbd5e1;
--border: #334155;
--accent: #fb923c;
}
}
* {
box-sizing: border-box;
}
body {
display: flex;
margin: 0;
min-height: 100vh;
flex-direction: column;
background: #f5f5f5;
display: grid;
place-items: center;
padding: 24px;
background: var(--bg);
color: var(--text);
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main {
flex: 1 0 auto;
width: min(100%, 680px);
padding: 32px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--panel);
box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}
.container {
margin-top: 5rem;
.status {
display: inline-flex;
align-items: center;
gap: 10px;
margin-bottom: 18px;
color: var(--accent);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
font-size: 0.8rem;
}
.card-panel {
padding: 2rem;
text-align: center;
.status::before {
content: "";
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--accent);
}
.blocked-icon {
font-size: 4rem;
color: #e53935;
h1 {
margin: 0 0 12px;
font-size: clamp(2rem, 6vw, 3.4rem);
line-height: 1.05;
letter-spacing: 0;
}
.blocked-title {
font-size: 2.5rem;
margin: 1rem 0;
p {
margin: 0 0 16px;
color: var(--muted);
font-size: 1.05rem;
line-height: 1.6;
}
.blocked-url {
font-size: 1.2rem;
color: #555;
word-break: break-all;
dl {
margin: 26px 0 0;
padding-top: 20px;
border-top: 1px solid var(--border);
}
dt {
margin-bottom: 8px;
color: var(--muted);
font-size: 0.85rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
}
dd {
margin: 0;
overflow-wrap: anywhere;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.95rem;
}
</style>
</head>
<body>
<main>
<div class="container">
<div class="card-panel z-depth-3">
<i class="material-icons blocked-icon">block</i>
<h2 class="blocked-title">Access Blocked</h2>
<p>This site has been blocked by your network policy.</p>
<p>If you believe this is an error, please contact your network administrator.</p>
<h5>Requested URL:</h5>
<p id="requestedUrl" class="blocked-url"></p>
</div>
</div>
<div class="status">Network policy</div>
<h1>Access Blocked</h1>
<p>This destination is blocked by the network policy currently applied to this connection.</p>
<p>If you believe this is incorrect, contact the network administrator and include the requested URL below.</p>
<dl>
<dt>Requested URL</dt>
<dd>{{ .RequestedURL }}</dd>
</dl>
</main>
<!-- Materialize JS (optional for any interactive components) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script>
// On page load, insert the current URL into the block page.
document.addEventListener("DOMContentLoaded", function () {
var urlElement = document.getElementById("requestedUrl");
if (urlElement) {
urlElement.textContent = window.location.href;
}
});
</script>
</body>
</html>