Files
terraform-cloudflare-tunnel…/workers/deny-page.js
T
hcornet f8201d9d06
Terraform Apply / Terraform Apply (push) Successful in 2m26s
New update
2026-07-31 12:57:49 +02:00

64 lines
2.4 KiB
JavaScript

/**
* Page de refus d'accès personnalisée — servie sur denied.tips-of-mine.org
* Toutes les applications Access du repo pointent leur custom_deny_url ici.
* Déployée par Terraform : Workers-Deny_Page.tf
*/
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const html = `<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Accès refusé — Tips-Of-Mine</title>
<style>
:root { color-scheme: light dark; }
body {
margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
background: #f5f5f5; color: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
body { background: #16181d; color: #e8e8e8; }
.card { background: #1f232b !important; box-shadow: 0 4px 24px rgba(0,0,0,.4) !important; }
}
.card {
background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08);
max-width: 520px; margin: 1rem; padding: 2.5rem; text-align: center;
}
.icon { font-size: 3rem; }
h1 { font-size: 1.4rem; margin: .75rem 0 .25rem; }
p { line-height: 1.55; opacity: .85; }
.hint {
text-align: left; font-size: .9rem; border-left: 3px solid #f6821f;
padding: .5rem .9rem; margin-top: 1.25rem; opacity: .9;
}
a { color: #f6821f; }
</style>
</head>
<body>
<main class="card">
<div class="icon">&#128683;</div>
<h1>Acc&egrave;s refus&eacute;</h1>
<p>Votre identit&eacute; a bien &eacute;t&eacute; v&eacute;rifi&eacute;e, mais elle ne remplit pas
les conditions d'acc&egrave;s de cette application (groupe, posture du poste, MFA ou localisation).</p>
<div class="hint">
<strong>Que faire ?</strong><br>
&bull; V&eacute;rifiez que vous &ecirc;tes connect&eacute; avec le bon compte&nbsp;;<br>
&bull; V&eacute;rifiez que le client WARP est actif et votre poste conforme&nbsp;;<br>
&bull; Si le besoin est l&eacute;gitime, contactez l'administrateur&nbsp;:
<a href="mailto:[email protected]">[email protected]</a>.
</div>
</main>
</body>
</html>`;
return new Response(html, {
status: 403,
headers: { 'content-type': 'text/html; charset=utf-8' },
});
}