Full uninstall from the installer

On a server with an existing installation the menu gets a third choice,
«Удалить»; UNINSTALL=y runs it without the menu. After typing «удалить» it
offers a backup of /etc/amnezia and cli.env to /root, then removes the
services and the systemd unit, brings awg1 down, drops the shaping and
torrent nft tables, closes the ports it had opened in UFW, firewalld or
iptables, removes the Prometheus that `awg-ctrl monitor install` set up
(only ours), and deletes /opt/awg-control, /etc/amnezia, the awg-ctrl
command, the sysctl file and the install logs, which hold the panel
password. AmneziaWG packages, module and PPA go only on a separate yes.

kill_related moved above the menu so the uninstall can use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bNGYiDst62wH3ZGTRPFLJ
This commit is contained in:
Claude
2026-10-28 11:45:48 +00:00
parent 13da9a7200
commit 619af21085
2 changed files with 195 additions and 34 deletions
+17
View File
@@ -57,6 +57,23 @@ AWG_GEN=auto bash <(curl -Ls https://raw.githubusercontent.com/maeneko/forgettin
`REPO_BASE`, `REPO_FALLBACK`, `ARCHIVE_URL`, `BRAND` перед запуском установщика
(подробности — в комментариях `install.sh` и в `.env`).
### Удаление
Тот же установщик: на сервере с установкой — пункт **3 «Удалить»**, без меню —
`UNINSTALL=y` (подтверждение «удалить» тогда не спрашивается):
```bash
UNINSTALL=y bash <(curl -Ls https://raw.githubusercontent.com/maeneko/forgetting/main/install.sh)
```
Удаляются сервисы и юнит systemd, интерфейс `awg1`, nft-таблицы шейпинга и блокировки
торрентов, открытые установщиком порты (UFW, firewalld или iptables), Prometheus из
`awg-ctrl monitor install`, `/opt/awg-control`, `/etc/amnezia` (пользователи, ключи, базы),
команда `awg-ctrl`, sysctl-файл и логи установки (в них пароль панели). Перед этим установщик
предлагает сохранить копию данных в `/root/forgetting-backup-<время>.tar.gz`. AmneziaWG
(пакеты, модуль, PPA) — по отдельному вопросу; общие зависимости (dkms, build-essential,
iptables, заголовки ядра) остаются. Ноду после удаления уберите и из списка серверов панели.
### Секретный путь панели
Установщик выдаёт панели случайный путь: она открывается по `http://IP:PORT/<путь>/`, а на