This commit is contained in:
Vasco
2026-04-25 18:13:21 +01:00
parent 457018b127
commit eb5a014949
3 changed files with 23 additions and 344 deletions

View File

@@ -1,204 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Identity Verification - Coimbra VPN</title>
<style>
:root {
--primary: #6366f1;
--primary-hover: #4f46e5;
--bg: #0b0f1a;
--card-bg: #161b2c;
--input-bg: #1f2937;
--text: #f8fafc;
--text-muted: #94a3b8;
--border: rgba(255, 255, 255, 0.1);
}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Coimbra VPN</title>
</head>
<body>
<h1>Two-Factor Auth</h1>
<p>Enter your UNIX credentials and TOTP code</p>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
<form action="/dologin" method="POST">
body {
font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
background-color: var(--bg);
background-image:
radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
color: var(--text);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="username">
.login-card {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 1.5rem;
padding: 2.5rem;
width: 100%;
max-width: 420px;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
animation: slideUp 0.6s ease-out;
}
<br>
@keyframes slideUp {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
<label for="password">UNIX Password (password + 6 digit TOTP)</label>
<input type="password" id="password" placeholder="password + TOTP" required>
.header {
text-align: center;
margin-bottom: 2rem;
}
.logo {
width: 64px;
height: 64px;
background: linear-gradient(135deg, var(--primary), #8b5cf6);
border-radius: 1rem;
margin: 0 auto 1.5rem;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}
h1 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.5rem;
}
p.subtitle {
color: var(--text-muted);
font-size: 0.875rem;
}
.form-group {
margin-bottom: 1.25rem;
}
label {
display: block;
font-size: 0.875rem;
font-weight: 500;
margin-bottom: 0.5rem;
color: var(--text-muted);
}
input {
width: 100%;
padding: 0.75rem 1rem;
background: var(--input-bg);
border: 1px solid var(--border);
border-radius: 0.75rem;
color: var(--text);
font-size: 1rem;
transition: all 0.2s;
outline: none;
}
input:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.otp-group {
position: relative;
}
button {
width: 100%;
padding: 0.875rem;
background: var(--primary);
color: white;
border: none;
border-radius: 0.75rem;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
margin-top: 1rem;
}
button:hover {
background: var(--primary-hover);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
button:active {
transform: translateY(0);
}
.error-message {
display: none;
background: rgba(239, 44, 44, 0.1);
color: #ef4444;
padding: 0.75rem;
border-radius: 0.75rem;
font-size: 0.875rem;
margin-bottom: 1.5rem;
border: 1px solid rgba(239, 44, 44, 0.2);
text-align: center;
}
</style>
</head>
<body>
<div class="login-card">
<div class="header">
<div class="logo">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="white" viewBox="0 0 256 256"><path d="M160,16a80.09,80.09,0,0,0-80,80,8,8,0,0,0,16,0,64,64,0,1,1,64,64,8,8,0,0,0,0,16,80,80,0,0,0,0-160Zm0,128a48,48,0,1,0-48-48A48.05,48.05,0,0,0,160,144Zm0-80a32,32,0,1,1-32,32A32,32,0,0,1,160,64Zm-48,128a8,8,0,0,1,8,8v16a8,8,0,0,1-16,0V200A8,8,0,0,1,112,192Zm-32,8a8,8,0,0,1,8,8v16a8,8,0,0,1-16,0V208A8,8,0,0,1,80,200Zm80,32a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h32A8,8,0,0,1,160,232Zm48-32a8,8,0,0,1,8,8v16a8,8,0,0,1-16,0V208A8,8,0,0,1,208,200Zm24,8a8,8,0,0,1-8,8H192a8,8,0,0,1,0-16h32A8,8,0,0,1,232,208ZM48,152a8,8,0,0,1,8,8v40a8,8,0,0,1-16,0V160A8,8,0,0,1,48,152ZM24,160a8,8,0,0,1,8,8v16a8,8,0,0,1-16,0V168A8,8,0,0,1,24,160Z"></path></svg>
</div>
<h1>Two-Factor Auth</h1>
<p class="subtitle">Enter your UNIX credentials and TOTP code</p>
</div>
<div id="error-box" class="error-message">Invalid credentials or TOTP code.</div>
<form id="login-form" action="/dologin" method="POST">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="httpd_username" placeholder="e.g. john" required autocomplete="username">
</div>
<div class="form-group">
<label for="password">UNIX Password</label>
<input type="password" id="password" placeholder="••••••••" required autocomplete="current-password">
</div>
<div class="form-group">
<label for="otp">TOTP Code</label>
<input type="text" id="otp" placeholder="6-digit code" required pattern="[0-9]{6}" inputmode="numeric" autocomplete="one-time-code">
</div>
<input type="hidden" id="httpd_password" name="httpd_password">
<button type="submit">Verify & Access</button>
<button type="submit">Login</button>
</form>
</div>
<script>
// Check for error query param
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('error')) {
document.getElementById('error-box').style.display = 'block';
}
document.getElementById('login-form').addEventListener('submit', function(e) {
const password = document.getElementById('password').value;
const otp = document.getElementById('otp').value;
// Concatenate password + TOTP as expected by pam_google_authenticator forward_pass
document.getElementById('httpd_password').value = password + otp;
// Allow form to submit
});
</script>
</body>
</body>
</html>