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:
+7
-5
@@ -563,11 +563,11 @@ def peer_enable(peer_id: int):
|
|||||||
|
|
||||||
name = item.get("name", "")
|
name = item.get("name", "")
|
||||||
pk = item.get("public_key", "")
|
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 ""
|
routes = item.get("advertised_routes", "") or ""
|
||||||
psk = item.get("peer_psk", "") or ""
|
psk = item.get("peer_psk", "") or ""
|
||||||
if not (name and pk and addr and psk):
|
if not (name and pk):
|
||||||
flash("Недостаточно данных для включения peer (нужны name/public key/address/psk)", "error")
|
flash("Недостаточно данных для включения peer", "error")
|
||||||
return redirect(url_for("index"))
|
return redirect(url_for("index"))
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
@@ -575,10 +575,12 @@ def peer_enable(peer_id: int):
|
|||||||
"add",
|
"add",
|
||||||
"--client-name", name,
|
"--client-name", name,
|
||||||
"--client-public-key", pk,
|
"--client-public-key", pk,
|
||||||
"--client-address", addr,
|
|
||||||
"--client-preshared-key", psk,
|
|
||||||
"--persistent-keepalive", "25",
|
"--persistent-keepalive", "25",
|
||||||
]
|
]
|
||||||
|
if addr:
|
||||||
|
cmd += ["--client-address", addr]
|
||||||
|
if psk:
|
||||||
|
cmd += ["--client-preshared-key", psk]
|
||||||
if routes:
|
if routes:
|
||||||
cmd += ["--client-routes", routes]
|
cmd += ["--client-routes", routes]
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,15 @@ body {
|
|||||||
|
|
||||||
.logout-btn:hover { background: #fee2e2; color: #dc2626; }
|
.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 ────────────────────────────────────────────────── */
|
||||||
.layout { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
|
.layout { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
|
||||||
main { padding: 28px 32px; flex: 1; max-width: 1400px; width: 100%; }
|
main { padding: 28px 32px; flex: 1; max-width: 1400px; width: 100%; }
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>WG Admin</title>
|
<title>WG Admin</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<aside class="sidebar">
|
<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>
|
<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>
|
</a>
|
||||||
|
<div class="made-by">Made by Galyaviev</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>WG Admin — Вход</title>
|
<title>WG Admin — Вход</title>
|
||||||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&display=swap" />
|
||||||
<style>
|
<style>
|
||||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
|
||||||
@@ -153,6 +154,15 @@
|
|||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
margin-top: 16px;
|
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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -196,5 +206,6 @@
|
|||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<p class="footer">wg.4mont.ru · WireGuard Admin Panel</p>
|
<p class="footer">wg.4mont.ru · WireGuard Admin Panel</p>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="made-by-login">Made by Galyaviev</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user