Replace Basic Auth with login page, add HTTP redirect and log viewer
- Session-based login page instead of HTTP Basic Auth - /ca.crt download works without login for easy device access - HTTP port (default 8080) redirects to HTTPS automatically - Nginx access/error log viewer in WebUI - API still supports Basic Auth for curl/scripts - Logout button and log navigation in header Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,6 +199,8 @@
|
||||
<h1>HTTPS Reverse Proxy</h1>
|
||||
<div style="display:flex;align-items:center;gap:15px;">
|
||||
<a href="/ca.crt" class="btn btn-sm btn-primary" style="text-decoration:none;">CA-Zertifikat herunterladen</a>
|
||||
<a href="/logs" class="btn btn-sm" style="text-decoration:none;background:#0f3460;color:#e0e0e0;">Logs</a>
|
||||
<a href="/logout" class="btn btn-sm" style="text-decoration:none;background:#e74c3c;color:white;">Abmelden</a>
|
||||
<span class="badge">Self-Signed SSL - 100 Jahre</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>HTTPS Proxy - Login</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: #1a1a2e;
|
||||
color: #e0e0e0;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.login-card {
|
||||
background: #16213e;
|
||||
border-radius: 10px;
|
||||
padding: 40px;
|
||||
border: 1px solid #0f3460;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
.login-card h1 {
|
||||
color: #00d4ff;
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.login-card .subtitle {
|
||||
color: #8899aa;
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.form-group label {
|
||||
font-size: 0.85em;
|
||||
color: #8899aa;
|
||||
margin-bottom: 5px;
|
||||
display: block;
|
||||
}
|
||||
input {
|
||||
background: #1a1a2e;
|
||||
border: 1px solid #0f3460;
|
||||
color: #e0e0e0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 6px;
|
||||
font-size: 0.95em;
|
||||
width: 100%;
|
||||
}
|
||||
input:focus {
|
||||
outline: none;
|
||||
border-color: #00d4ff;
|
||||
}
|
||||
.btn {
|
||||
padding: 12px 20px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 0.95em;
|
||||
font-weight: 600;
|
||||
width: 100%;
|
||||
background: #00d4ff;
|
||||
color: #1a1a2e;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.btn:hover { background: #00b8d4; }
|
||||
.error {
|
||||
background: rgba(231, 76, 60, 0.2);
|
||||
border: 1px solid #e74c3c;
|
||||
color: #e74c3c;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.ca-link {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #0f3460;
|
||||
}
|
||||
.ca-link a {
|
||||
color: #00d4ff;
|
||||
text-decoration: none;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.ca-link a:hover { text-decoration: underline; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-card">
|
||||
<h1>HTTPS Reverse Proxy</h1>
|
||||
<p class="subtitle">Anmeldung erforderlich</p>
|
||||
|
||||
{% if error %}
|
||||
<div class="error">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label>Benutzername</label>
|
||||
<input type="text" name="username" autofocus required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Passwort</label>
|
||||
<input type="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn">Anmelden</button>
|
||||
</form>
|
||||
|
||||
<div class="ca-link">
|
||||
<a href="/ca.crt">CA-Zertifikat herunterladen</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,157 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>HTTPS Proxy - Logs</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: #1a1a2e;
|
||||
color: #e0e0e0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.header {
|
||||
background: #16213e;
|
||||
padding: 20px 30px;
|
||||
border-bottom: 2px solid #0f3460;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.header h1 { color: #00d4ff; font-size: 1.5em; }
|
||||
.header-right { display: flex; align-items: center; gap: 15px; }
|
||||
.badge {
|
||||
background: #0f3460;
|
||||
color: #00d4ff;
|
||||
padding: 5px 15px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.nav-link {
|
||||
color: #00d4ff;
|
||||
text-decoration: none;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.nav-link:hover { text-decoration: underline; }
|
||||
.container { max-width: 1400px; margin: 30px auto; padding: 0 20px; }
|
||||
.card {
|
||||
background: #16213e;
|
||||
border-radius: 10px;
|
||||
padding: 25px;
|
||||
margin-bottom: 25px;
|
||||
border: 1px solid #0f3460;
|
||||
}
|
||||
.card h2 {
|
||||
color: #00d4ff;
|
||||
margin-bottom: 20px;
|
||||
font-size: 1.2em;
|
||||
border-bottom: 1px solid #0f3460;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.controls {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
.btn {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 0.85em;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn-primary { background: #00d4ff; color: #1a1a2e; }
|
||||
.btn-primary:hover { background: #00b8d4; }
|
||||
.btn-active { background: #00d4ff; color: #1a1a2e; }
|
||||
.btn-inactive { background: #0f3460; color: #8899aa; }
|
||||
.btn-inactive:hover { background: #1a3a6e; color: #e0e0e0; }
|
||||
select {
|
||||
background: #1a1a2e;
|
||||
border: 1px solid #0f3460;
|
||||
color: #e0e0e0;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.log-output {
|
||||
background: #0d0d1a;
|
||||
border: 1px solid #0f3460;
|
||||
border-radius: 6px;
|
||||
padding: 15px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.6;
|
||||
overflow-x: auto;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
white-space: pre;
|
||||
color: #b0b0b0;
|
||||
}
|
||||
.empty-log {
|
||||
color: #8899aa;
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>HTTPS Reverse Proxy - Logs</h1>
|
||||
<div class="header-right">
|
||||
<a href="/" class="nav-link">Proxy-Ziele</a>
|
||||
<a href="/logout" class="nav-link">Abmelden</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<h2>Nginx Logs</h2>
|
||||
|
||||
<div class="controls">
|
||||
<a href="/logs?type=access&lines={{ lines }}"
|
||||
class="btn {{ 'btn-active' if log_type == 'access' else 'btn-inactive' }}">Access Log</a>
|
||||
<a href="/logs?type=error&lines={{ lines }}"
|
||||
class="btn {{ 'btn-active' if log_type == 'error' else 'btn-inactive' }}">Error Log</a>
|
||||
|
||||
<form method="GET" action="/logs" style="display:flex;gap:10px;align-items:center;">
|
||||
<input type="hidden" name="type" value="{{ log_type }}">
|
||||
<label style="color:#8899aa;font-size:0.85em;">Zeilen:</label>
|
||||
<select name="lines" onchange="this.form.submit()">
|
||||
<option value="50" {{ "selected" if lines == 50 }}>50</option>
|
||||
<option value="100" {{ "selected" if lines == 100 }}>100</option>
|
||||
<option value="250" {{ "selected" if lines == 250 }}>250</option>
|
||||
<option value="500" {{ "selected" if lines == 500 }}>500</option>
|
||||
<option value="1000" {{ "selected" if lines == 1000 }}>1000</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<a href="/logs?type={{ log_type }}&lines={{ lines }}" class="btn btn-primary">Aktualisieren</a>
|
||||
</div>
|
||||
|
||||
{% if log_content %}
|
||||
<div class="log-output">{{ log_content }}</div>
|
||||
{% else %}
|
||||
<div class="empty-log">
|
||||
<p>Keine Log-Eintraege vorhanden.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Auto-scroll to bottom
|
||||
const logOutput = document.querySelector('.log-output');
|
||||
if (logOutput) {
|
||||
logOutput.scrollTop = logOutput.scrollHeight;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user