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

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
test2
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
+21
View File
@@ -147,6 +147,27 @@ async def check_ssh(
return RedirectResponse("/admin/servers?flash=ssh_ok", status_code=status.HTTP_303_SEE_OTHER)
@router.post("/servers/{server_id}/install-vpn")
async def install_vpn(
server_id: int,
db: AsyncSession = Depends(get_db),
admin=Depends(require_admin),
):
if _is_redirect(admin):
return admin
try:
await vpn_service.install_vpn_on_server(db, server_id)
return RedirectResponse(
"/admin/servers?flash=vpn_installed",
status_code=status.HTTP_303_SEE_OTHER,
)
except Exception as exc: # noqa: BLE001
return RedirectResponse(
f"/admin/servers?flash=error:{exc}",
status_code=status.HTTP_303_SEE_OTHER,
)
@router.post("/servers/{server_id}/delete")
async def delete_server(
server_id: int,