Контейнер лендинга запускается с --restart unless-stopped и переживает
переустановку. При SKIP_LANDING=1 скрипт новый не поднимал, но старый
продолжал держать порт 80, и лендинг «всё равно открывался».
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Даты «Задать дату» (lastDisconnectedAt) и отключение по расписанию
(scheduledTunnelDisconnectAt) тоже живут в clientsTable и терялись при
затирании. Снимок хранит и их, но возвращает только когда запись реально
затёрли (пропал creationDate) — иначе воскресало бы снятое в панели расписание.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Приложение AmneziaVPN при переподключении пересобирает clientsTable из awg0.conf
и оставляет только clientId с именами «Client N» — имена, даты создания и last_config
пропадают. Панель теперь держит снимок этих полей в DATA_DIR и восстанавливает их
при следующем чтении состояния, попутно чиня файл в контейнере.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Addresses tester feedback: the installer gave no signal about whether
a working AmneziaWG server was present, so failures ("cannot create
client") were hard to diagnose.
install.sh now prints a "Проверка AmneziaWG" block after deploy:
- lists every container that actually holds /opt/amnezia/awg/*.conf,
with its UDP port and client count;
- states that the panel auto-discovers them (no manual AWG_PROFILES);
- if none found, warns loudly that this is normal on a fresh VPS and
spells out the two ways forward (deploy an instance from the panel's
"Протоколы / инстансы", or install a server with the Amnezia app),
noting that until then the client list is empty by design.
Add a "Протоколы / инстансы" section that spins up AmneziaWG server
containers straight from the panel, with port + variant selection —
no need to run the Amnezia desktop app to set up the server.
Core (scripts/awg-instance.sh):
- create <awg2|awg|legacy> <port> [name]: pulls the public image
(amneziavpn/amneziawg-go:2.0.0 / :0.2.18 / amneziavpn/amnezia-wg),
generates server keys + psk, writes awg0.conf/wg0.conf with a free
10.8.<N>.0/24 subnet (scans running containers to avoid clashes),
random AmneziaWG obfuscation (Jc/Jmin/Jmax/S1..S4/H1..H4 as single
uint32 values — ranges break awg setconf), and a start.sh that
brings the iface up via userspace amneziawg-go + NAT MASQUERADE.
remove <name>, list.
Backend (server.js):
- Profiles are now dynamic: env AWG_PROFILES merged with managed
instances persisted in /data/instances.json (getProfiles()), so a
new instance is usable immediately without restarting the panel.
- /api/instances (list with running/peers), /api/instances/create,
/delete, /stop, /start. create runs the script then registers the
profile; delete tears down container + data + profile.
Infra:
- Dockerfile: add bash iproute2 coreutils, COPY scripts.
- install.sh: mkdir /opt/amnezia-instances and bind-mount it into the
panel so docker-in-docker bind paths line up.
UI (index.html/app.js/styles.css):
- Cards per instance (icon, NEW badge, description, РАБОТАЕТ/ОСТАНОВЛЕН,
port, connections) with Стоп/Старт, Подключения (switches the active
instance), Удалить; plus a create form (variant + port).
Verified end to end on a live VPS: create awg2/awg/legacy instances,
interfaces come up, a client created on a new instance gets the right
subnet (10.8.20.2) and Endpoint (host:51850).
Add "Новый клиент" (direct) flow alongside cascade:
- server.js: POST /api/clients/create — Endpoint = this server's
public IP:ListenPort (CLIENT_CONFIG_ENDPOINT or request host),
reuses the same key/peer/conf pipeline as create-cascade.
- public/index.html: "Новый клиент" panel with #direct-form
(name + optional tunnel IP).
- public/app.js: downloadDirectConf() handler + form binding.
install.sh hardening so fresh installs work out of the box:
- Auto-detect a single amnezia-awg* container (e.g. amnezia-awg2,
Amnezia AWG 2.0 default) -> AWG_CONTAINER, instead of the fixed
"amnezia-awg" default that mismatched and blocked client ops.
- Auto-default CLIENT_CONFIG_ENDPOINT to the host primary IP so
direct .conf exports get a correct Endpoint without manual env.
Fixes "cannot create users" on servers whose WG container is
named amnezia-awg2.
Private repos return 404 on archive/refs/heads/<branch>.tar.gz
without Authorization. Use api.github.com/.../tarball/<ref> when
GITHUB_TOKEN/GH_TOKEN is set; tolerate the SHA-suffixed top dir.
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid pipefail exits on stopped container and zero AWG grep matches;
add curl timeouts and tarball override for flaky GitHub.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add AMNEZIA_EDITION=community with API/UI locks for client mutations,
export, cascade, WARP and host time sync; banner + Boosty CTA.
Install passes edition from AMNEZIA_EDITION env or .amnezia-panel-edition.
Co-authored-by: Cursor <cursoragent@cursor.com>
Hide users/warp/cascade blocks via env; block warp/cascade APIs when hidden.
install.sh passes UI_HIDE_* and restores from previous container on upgrade.
Co-authored-by: Cursor <cursoragent@cursor.com>
Describe :80 landing vs :HOST_PORT admin; export filename ASCII note.
Fix install.sh echoes that still referred to a support footer on landing.
Co-authored-by: Cursor <cursoragent@cursor.com>
- install.sh: snapshot /root/amnezia-admin.awg-profiles.json + restore from old container
- GET /api/clients/export-config (+ profileId); optional EXPORT_CONFIG_SECRET
- UI: direct link, copy URL, hint when last_config missing
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds POST /api/clients/export-config, UI button when exportAvailable, CLIENT_* env for Endpoint/DNS in install.sh.
Co-authored-by: Cursor <cursoragent@cursor.com>