feat: fix YouTask peer enable + add Made by Galyaviev signature

- peer_enable: make PSK optional, only pass --client-preshared-key if non-empty
- peer_enable: strip /32 suffix from client_address before passing to wg-peerctl
- All pages: add "Made by Galyaviev" in Dancing Script handwritten font
- login.html: styled login page with signature below card
- base.html: signature in sidebar footer
- style.css: .made-by Dancing Script style

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 10:48:55 +03:00
parent 2391007a81
commit e96078bc46
4 changed files with 29 additions and 5 deletions
+7 -5
View File
@@ -563,11 +563,11 @@ def peer_enable(peer_id: int):
name = item.get("name", "")
pk = item.get("public_key", "")
addr = item.get("client_address", "")
addr = (item.get("client_address", "") or "").split("/")[0] # strip /32 if present
routes = item.get("advertised_routes", "") or ""
psk = item.get("peer_psk", "") or ""
if not (name and pk and addr and psk):
flash("Недостаточно данных для включения peer (нужны name/public key/address/psk)", "error")
if not (name and pk):
flash("Недостаточно данных для включения peer", "error")
return redirect(url_for("index"))
cmd = [
@@ -575,10 +575,12 @@ def peer_enable(peer_id: int):
"add",
"--client-name", name,
"--client-public-key", pk,
"--client-address", addr,
"--client-preshared-key", psk,
"--persistent-keepalive", "25",
]
if addr:
cmd += ["--client-address", addr]
if psk:
cmd += ["--client-preshared-key", psk]
if routes:
cmd += ["--client-routes", routes]
+9
View File
@@ -103,6 +103,15 @@ body {
.logout-btn:hover { background: #fee2e2; color: #dc2626; }
.made-by {
font-family: 'Dancing Script', cursive;
font-size: 15px;
color: #b0b8cc;
text-align: center;
padding: 8px 0 4px;
letter-spacing: 0.02em;
}
/* ─── Layout ────────────────────────────────────────────────── */
.layout { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
main { padding: 28px 32px; flex: 1; max-width: 1400px; width: 100%; }
+2
View File
@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>WG Admin</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap" />
</head>
<body>
<aside class="sidebar">
@@ -31,6 +32,7 @@
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
Выйти
</a>
<div class="made-by">Made by Galyaviev</div>
</div>
</aside>
<div class="layout">
+11
View File
@@ -4,6 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>WG Admin — Вход</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap" />
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@@ -153,6 +154,15 @@
color: var(--text-muted);
margin-top: 16px;
}
.made-by-login {
text-align: center;
font-family: 'Dancing Script', cursive;
font-size: 17px;
color: #9ca3af;
margin-top: 20px;
letter-spacing: 0.02em;
}
</style>
</head>
<body>
@@ -196,5 +206,6 @@
<div class="divider"></div>
<p class="footer">wg.4mont.ru &nbsp;·&nbsp; WireGuard Admin Panel</p>
</div>
<p class="made-by-login">Made by Galyaviev</p>
</body>
</html>