feat(gui): security hardening, UI overhaul, light theme

- CSRF protection on all POST forms (session token)
- ensure_schema() moved to module-level, removed from before_request
- gunicorn now binds to 127.0.0.1 only, runs as unprivileged user wgadmin
- nginx reverse proxy with HTTPS (Let's Encrypt, wg.4mont.ru)
- HTTP → HTTPS redirect before Basic Auth prompt
- Auth moved to nginx level (auth_basic), wg-peerctl called via sudo
- ufw firewall: only 22/80/443/51820 open
- fail2ban: SSH + nginx (5 attempts → 1h ban)
- Add Enable/Disable toggle buttons in peer table
- Add .conf file download route
- Light theme: white background, blue accent, subtle shadows
- Modern sidebar layout, styled badges, responsive forms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 10:10:19 +03:00
parent 530e93c1df
commit 904582e7fa
7 changed files with 620 additions and 170 deletions
+36 -12
View File
@@ -1,15 +1,39 @@
{% extends 'base.html' %}
{% block content %}
<h2>Скрипты и команды</h2>
<h3>Команды</h3>
{% for k, v in commands.items() %}
<p><b>{{ k }}</b></p>
<pre>{{ v }}</pre>
{% endfor %}
<h3>Важные пути</h3>
<ul>
{% for p in paths %}
<li><code>{{ p }}</code></li>
{% endfor %}
</ul>
<div class="page-header">
<h2>Скрипты и пути</h2>
</div>
<div class="card">
<h3>Команды</h3>
<div class="script-list">
{% for key, cmd in commands.items() %}
<div class="script-item">
<div class="script-label">{{ key }}</div>
<div class="script-cmd-wrap">
<pre class="script-cmd">{{ cmd }}</pre>
<button class="btn btn-sm copy-btn" onclick="copyText(this, '{{ cmd | replace("'", "\\'") }}')">Копировать</button>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="card">
<h3>Важные пути</h3>
<ul class="path-list">
{% for path in paths %}
<li class="mono-sm">{{ path }}</li>
{% endfor %}
</ul>
</div>
<script>
function copyText(btn, text) {
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Скопировано!';
setTimeout(() => btn.textContent = 'Копировать', 2000);
});
}
</script>
{% endblock %}