Commit Graph

74 Commits

Author SHA1 Message Date
Бобырев Андрей
6e05a366c9 docs: add PROJECT_INDEX.md
Указатель проекта по регламенту синхронизации: пути, состав репозитория,
порты и переменные, известные грабли, текущее состояние.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 11:26:00 +03:00
Бобырев Андрей
7b92bfb852 fix: remove stale landing container when SKIP_LANDING=1
Контейнер лендинга запускается с --restart unless-stopped и переживает
переустановку. При SKIP_LANDING=1 скрипт новый не поднимал, но старый
продолжал держать порт 80, и лендинг «всё равно открывался».

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 11:23:54 +03:00
34415a4b8a fix: keep disconnect dates in the clients metadata snapshot
Даты «Задать дату» (lastDisconnectedAt) и отключение по расписанию
(scheduledTunnelDisconnectAt) тоже живут в clientsTable и терялись при
затирании. Снимок хранит и их, но возвращает только когда запись реально
затёрли (пропал creationDate) — иначе воскресало бы снятое в панели расписание.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 11:40:14 +03:00
194ac8c742 fix: keep client names and dates when Amnezia app rewrites clientsTable
Приложение AmneziaVPN при переподключении пересобирает clientsTable из awg0.conf
и оставляет только clientId с именами «Client N» — имена, даты создания и last_config
пропадают. Панель теперь держит снимок этих полей в DATA_DIR и восстанавливает их
при следующем чтении состояния, попутно чиня файл в контейнере.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 02:10:36 +03:00
andrey271192
8e5d51ab2c fix: auto-detect wg binary in containers 2026-06-22 15:46:43 +03:00
andrey271192
b3600959ef fix: auto-discover amnezia client sources 2026-06-22 00:34:12 +03:00
andrey271192
4e6ab2dd6a fix: parse legacy clients table formats 2026-06-21 19:29:08 +03:00
andrey271192
dfeabe02d7 feat: sync app-created peers into clients table 2026-06-21 19:19:49 +03:00
andrey271192
fd66b0a024 fix: show peers missing clients table 2026-06-21 19:16:01 +03:00
andrey271192
cb5fca3d0f fix: load clients for selected profile 2026-06-21 19:00:51 +03:00
andrey271192
a9a67afb54 fix: show distinct awg instance labels 2026-06-21 18:34:26 +03:00
andrey271192
8c67d7df93 fix: dedupe duplicate awg instances 2026-06-21 18:32:10 +03:00
andrey271192
cff27e27b6 feat: import clients from amnezia configs 2026-06-21 18:22:36 +03:00
andrey271192
8ba2a266e5 fix: refresh stale awg profile snapshots 2026-06-21 18:14:02 +03:00
andrey271192
cbc20a1b71 fix: auto-detect awg profiles on install 2026-06-21 17:53:58 +03:00
andrey271192
1960c2212a feat(install): AmneziaWG presence check + clear warnings/logs
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.
2026-06-16 21:46:49 +03:00
andrey271192
cdd47f157b feat(instances): show app-installed AmneziaWG, not only panel-created
The instances section listed only panel-managed instances, so an
AmneziaWG container set up by the Amnezia desktop app (e.g.
amnezia-awg2) did not appear as a card.

/api/instances now iterates ALL effective profiles (env-discovered +
managed): resolves each container, reads ListenPort and peer count,
and detects the variant from the interface config (S3/S4 -> awg2,
S1/S2 -> awg, wg0 -> legacy). Native (non-managed) instances are
flagged managed:false.

UI: native cards get an "приложение Amnezia" tag and hide the Удалить
button (the panel must not tear down app-managed containers); they
keep Подключения and Стоп/Старт. Stop/start now resolve the real
container name so they work for native instances too.

Verified live: native amnezia-awg2 shows as "AmneziaWG 2.0" port
37395 (managed:false) alongside a panel-created Legacy :5534.
2026-06-16 21:40:42 +03:00
andrey271192
546c1127f8 feat: deploy AmneziaWG instances from the panel (no Amnezia app)
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).
2026-06-16 21:33:02 +03:00
andrey271192
f1b7fa522c fix: runtime auto-discovery of AmneziaWG container
Tester hit 'No such container: amnezia-awg' after a stock install
on a VPS where Amnezia created the WG container as amnezia-awg2.
Install-time detection was not enough.

The panel now resolves the real container at runtime: if the
configured AWG_CONTAINER lacks the conf file (or does not exist),
it scans running containers for one holding awg0.conf, preferring
amnezia-awg* names. All docker exec paths (clients list/create/
enable/disable/delete, WARP, host-setup) and the API container
field use the resolved name. Clear error lists running containers
if none match.

Result: install -> login -> change password -> create client works
with no manual AWG_CONTAINER/AWG_PROFILES on single-instance setups.
2026-06-16 21:11:36 +03:00
andrey271192
e498e98e12 fix(export): Amnezia-standard DNS + drop empty I2-I5 junk lines
Two issues reported on direct/cascade client creation:
- DNS hardcoded to Google (8.8.8.8/8.8.4.4). Default now 1.1.1.1/
  1.0.0.1 (Amnezia standard); still overridable via
  CLIENT_EXPORT_DNS1/DNS2 env.
- Config emitted empty I2 =/I3 =/I4 =/I5 = lines when the server
  only defines I1. Now only non-empty I-params are written, so the
  client's AmneziaWG obfuscation matches the server head exactly
  (mismatched/empty junk lines could break some clients).
2026-06-16 20:10:00 +03:00
andrey271192
2899bba55f style: compact icon action buttons, no horizontal scroll
Replace text action buttons with 32px icon buttons (tooltips kept
via title/aria-label): ⏻ выключить, ▶ включить, ⬇ .conf,
🔗 прямая ссылка, ⧉ копировать URL, 🗑 удалить. Actions cell
shrinks to content (width:1%, nowrap) so the table fits without
left-right scrolling.
2026-06-16 19:57:49 +03:00
andrey271192
4ebb81cede style: client action buttons flow in a row, not a column
Widen actions cell (min-width 360px) and keep buttons nowrap +
no-shrink so Выключить/Скачать/Прямая ссылка/Копировать/Удалить
wrap horizontally instead of stacking one per line.
2026-06-16 19:50:54 +03:00
andrey271192
c49e7eea8d feat: direct client creation + auto-detect AWG container
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.
2026-06-16 19:30:11 +03:00
Андрей Бобырев
c202f0bda5 chore: add npm lockfile 2026-06-07 03:05:26 +03:00
Андрей Бобырев
d21419cfdb fix: default awg container name 2026-06-06 14:46:37 +03:00
Андрей Бобырев
05e6d007e2 docs: make pro repo public install source 2026-06-06 14:16:56 +03:00
Андрей Бобырев
ec65bbc59a docs: move support block to bottom of README 2026-05-15 06:05:56 +03:00
Андрей Бобырев
038020408a feat: donate links on login screen + unified README support block
- public/index.html: gate-donate nav with Boosty/Ozon/Telegram on login
- public/styles.css: .gate-donate styles
- landing: proj-support-strip
- README: blockquote + "Поддержка проекта" section
- .github/FUNDING.yml: added
- version bumped to 1.2.28

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 05:52:17 +03:00
Андрей Бобырев
b212413e68 docs(readme): note screenshots match deploy bundle
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 05:06:26 +03:00
Андрей Бобырев
e9583ac4f1 docs(readme): PRO install via deploy repo, sources path separate
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 05:01:39 +03:00
Андрей Бобырев
9e5ed8a1e7 docs(readme): drop PAT install block, single curl line
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 04:58:28 +03:00
Андрей Бобырев
4e8f82616d docs(readme): private repo install PAT + Bearer on raw
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 04:55:05 +03:00
Андрей Бобырев
df1f9dc826 docs(ui): human cascade guide + kaskad_web_vpn
Expand cascade fold with steps, DNAT primer, install one-liner, link to github.com/andrey271192/kaskad_web_vpn; README and panel-guide aligned.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 04:49:14 +03:00
Андрей Бобырев
0e7a7df636 feat(mtproto): Telegram proxy panel and /api routes
- Docker telegrammessenger/proxy: install/restart/remove from UI
- GET/POST /api/mtproto/*, UI_HIDE_MTPROTO / UI_HIDE_SECTIONS=mtproto
- install.sh vars MTPRO_*; /health returns version; docs

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 04:39:19 +03:00
Андрей Бобырев
845683b986 fix(install): auth tarball download with GITHUB_TOKEN
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>
2026-05-15 02:46:55 +03:00
Андрей Бобырев
39a74e5f0a fix(install): align with amnezia_web main (curl opts, port, AWG count)
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>
2026-05-15 02:00:50 +03:00
Андрей Бобырев
ce63b8b0be ci: publish Docker image to GHCR on version tags
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.0.0
2026-05-14 23:24:40 +03:00
Андрей Бобырев
74163944c2 chore: align community default Boosty URL with PRO subscription link
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 22:38:30 +03:00
Андрей Бобырев
33f855219c fix(ui): show AmneziaWG PRO in panel heading
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:59:47 +03:00
Андрей Бобырев
c454b9e701 feat: split community (read-only) vs PRO panel editions
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>
2026-05-14 21:51:24 +03:00
Андрей Бобырев
16366b2f74 fix: correct repo slug amnezia_web-PRO (not mnezia)
URLs and default GITHUB_REPO must match github.com/andrey271192/amnezia_web-PRO.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:40:23 +03:00
Андрей Бобырев
76c4af30f2 fix: use GitHub slug mnezia_web-PRO in URLs and branding
Amnezia_web-PRO path 404s; canonical repo is andrey271192/mnezia_web-PRO.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:38:51 +03:00
Андрей Бобырев
8556a166d2 chore(ui): footer brand Amnezia_web-PRO
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:36:55 +03:00
Андрей Бобырев
5916518121 chore: mention Amnezia_web-PRO in package description
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:36:41 +03:00
Андрей Бобырев
7995afca0e chore: rename project/repo slug to Amnezia_web-PRO
Update default GITHUB_REPO, README install URLs, package repository,
and footer GitHub link.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:36:30 +03:00
Андрей Бобырев
61af58a9cf docs: clarify AWG_PROFILES with sudo and snapshot file
Document sudo -E, avoid broken curl | bash -c wrappers, and file-based
profiles. Warn during install when multiple amnezia-awg* containers run
without AWG_PROFILES.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 21:31:02 +03:00
Андрей Бобырев
62f40f92fb feat(warp): host install/uninstall via panel SSH + clarify status
POST /api/warp/host-setup runs warp-amnezia.sh on VPS root SSH.
UI buttons when sshpass available; explain missing warp.conf status.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 20:18:23 +03:00
Андрей Бобырев
47842a4047 fix(ui): collapsible panels with arrow + tighter clients table
Use details/summary for WARP, cascade, users; fix broken users markup.
Fold long last_config hints; fixed table columns; widen shell max width.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 20:11:45 +03:00
Андрей Бобырев
8f1d7a7c4a feat(ui): optional UI_HIDE_* panels; doc WARP free vs paid plans
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>
2026-05-14 20:01:43 +03:00
Андрей Бобырев
50558aff63 docsfeat(warp): clarify optional install + add uninstall command
README/panel-guide/UI explain WARP is not required; document uninstall.
Add warp-amnezia.sh uninstall to strip warp conf, rules, and start.sh block.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 19:53:14 +03:00