Add maintenance cleanup for revoked and orphaned configs
CI / Backend (build + test) (push) Failing after 58s
CI / Frontend (lint + typecheck + build) (push) Successful in 31s

Two new maintenance actions remove VpnConfig records (with their traffic
samples) from the database: all revoked configs, and configs whose inbound
or node no longer exists. 3x-ui is not touched; both write an AuditLog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mrleo1nidandClaude Opus 5.5 committed 2026-10-17 01:04:46 +03:00
1 parent 1bc86dc426
commit 2c20fb0427
12 files changed
+367 -1

No files matched your search

+2
View File
@@ -241,6 +241,8 @@ TicketAttachmentDto[] }`.
| DELETE | `/api/admin/maintenance/tickets/closed` | — | `{ deletedCount }` — удаляет все тикеты в статусе `Closed` вместе с комментариями и вложениями (файлы стираются с диска через `IFileStorage.DeleteAsync`) |
| DELETE | `/api/admin/maintenance/audit-logs` | query: `olderThanDays` (1–3650) | `{ deletedCount }` — удаляет записи `AuditLog` старше `olderThanDays` дней |
| DELETE | `/api/admin/maintenance/apps/disabled` | — | `{ deletedCount }` — удаляет все `ClientApp` с `IsEnabled = false` |
| DELETE | `/api/admin/maintenance/configs/revoked` | — | `{ deletedCount }` — удаляет из БД все `VpnConfig` в статусе `Revoked` вместе с их `TrafficSample` (3x-ui не трогает — клиентов там уже нет) |
| DELETE | `/api/admin/maintenance/configs/orphaned` | — | `{ deletedCount }` — удаляет из БД `VpnConfig` (в любом статусе), чей `Inbound` или его `Node` уже удалены, вместе с `TrafficSample` |
| DELETE | `/api/admin/maintenance/factory-reset` | — | `204 No Content` — полный сброс панели к состоянию свежего деплоя |
Тикет/комментарий/вложение — плоские сущности без FK-каскада (см. `SupportTicket`), поэтому хендлер