Generate and deploy real WG/AWG configs to VPS over SSH

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-25 21:38:22 +03:00
co-authored by Cursor
parent 321a5b2504
commit cd106b68bc
10 changed files with 477 additions and 35 deletions
+6 -1
View File
@@ -23,7 +23,12 @@
<div class="panel-head"><strong>QR‑код</strong></div>
<div class="panel-body">
<img class="qr" src="/admin/clients/{{ client.id }}/qr" alt="QR config" />
<p class="muted" style="margin-top:0.8rem">Отсканируйте в клиенте WireGuard / AmneziaWG.</p>
<p class="muted" style="margin-top:0.8rem">
Готовый рабочий конфиг: скачайте `.conf` или отсканируйте QR в WireGuard / AmneziaWG.
{% if not client.server.vpn_installed %}
<br><strong>Сначала нажмите «Установить VPN на сервер» в разделе Серверы</strong> — иначе пиры не будут на VPS.
{% endif %}
</p>
{% if client.notes %}
<p><strong>Заметка:</strong> {{ client.notes }}</p>
{% endif %}
+7 -1
View File
@@ -16,6 +16,8 @@
<div class="flash">Сервер удалён</div>
{% elif flash == 'ssh_ok' %}
<div class="flash">SSH проверка успешна</div>
{% elif flash == 'vpn_installed' %}
<div class="flash">VPN установлен на VPS — можно создавать клиентов и скачивать .conf</div>
{% endif %}
{% endif %}
@@ -85,13 +87,17 @@
{{ s.name }}
<span class="badge badge-proto">{{ s.protocol }}</span>
{% if s.ssh_reachable %}<span class="badge badge-ok">SSH ok</span>{% else %}<span class="badge badge-off">SSH ?</span>{% endif %}
{% if s.vpn_installed %}<span class="badge badge-ok">VPN installed</span>{% else %}<span class="badge badge-off">VPN not installed</span>{% endif %}
</strong>
<div class="actions">
<form method="post" action="/admin/servers/{{ s.id }}/check-ssh" class="inline-form">
<button class="btn btn-sm btn-ghost" type="submit">Проверить SSH</button>
</form>
<form method="post" action="/admin/servers/{{ s.id }}/install-vpn" class="inline-form" onsubmit="return confirm('Установить Docker + VPN контейнер на VPS? Это займёт 1–3 минуты.')">
<button class="btn btn-sm btn-accent" type="submit">{% if s.vpn_installed %}Переустановить VPN{% else %}Установить VPN на сервер{% endif %}</button>
</form>
<form method="post" action="/admin/servers/{{ s.id }}/sync" class="inline-form">
<button class="btn btn-sm btn-ghost" type="submit">Синхр. conf</button>
<button class="btn btn-sm btn-ghost" type="submit">Синхр. conf → VPS</button>
</form>
<form method="post" action="/admin/servers/{{ s.id }}/delete" class="inline-form" onsubmit="return confirm('Удалить сервер и всех клиентов?')">
<button class="btn btn-sm btn-danger" type="submit">Удалить</button>