Commit Graph

114 Commits

Author SHA1 Message Date
leonidorlov-hash 4e02f2ea35 fix(ui): restore missing block scripts tag (template syntax error) 2026-08-28 02:28:15 +03:00
leonidorlov-hash 1c62291fcc refactor(ui): move tuning summary to server-level 'Host tuning' modal
Tuning data describes the whole server, not a single protocol config.
Replaces the per-config block with a '📊 Host tuning' button in the
server status bar opening a modal with host sysctls (BBR, qdisc,
conntrack, backlog, somaxconn) and per-AWG-container live values.
Adds POST /api/servers/{id}/host_tuning and host_tuning translation key.
2026-08-28 02:24:03 +03:00
leonidorlov-hash af3f6120b6 fix(awg): never lower an existing higher nf_conntrack_max 2026-08-28 02:11:52 +03:00
leonidorlov-hash 549b26fceb feat(awg): tuning summary in server config modal + raise nf_conntrack_max
- Server config modal now shows container name/status, host BBR/qdisc and
  conntrack usage, and live container sysctl values (buffers, fastopen,
  mtu_probing, nofile).
- setup_host_tuning() also raises net.netfilter.nf_conntrack_max to
  262144 (default ~7680 on small VMs causes 'nf_conntrack: table full'
  packet drops on busy VPN gateways). Persisted via
  /etc/sysctl.d/98-awp-conntrack.conf.
2026-08-28 02:09:55 +03:00
leonidorlov-hash 8acdb8c278 fix(awg): set nofile ulimit via docker run (limits.conf has no effect in containers) 2026-08-28 01:56:18 +03:00
leonidorlov-hash 90b39351b0 feat(awg): container network tuning + host BBR on install
- Dockerfile now writes AmneziaVPN-style sysctl tuning (64MB buffers,
  backlog, fastopen, mtu_probing, etc.) and nofile limits into the image,
  and start.sh applies them via 'sysctl -p' at container start.
- New setup_host_tuning() step in install_protocol: loads tcp_bbr if
  needed and persists BBR + fq qdisc via /etc/sysctl.d/99-awp-bbr.conf
  and /etc/modules-load.d/awp-bbr.conf.
2026-08-28 01:13:47 +03:00
leonidorlov-hash 29cec6f425 fix(ui): don't clobber the open rename editor on 5s auto-refresh
Poll-triggered loadConnections() rebuilt the whole list innerHTML and
destroyed the rename input mid-typing. Polls are now skipped while a
rename editor is open (manual refreshes still work).
2026-08-28 00:50:20 +03:00
leonidorlov-hash 549faafc41 fix(ui): restore live-UI call sites lost in upstream merge; keep peer IP out of rename editor
- invoke parseHandshakeAgo/formatHandshakeCompact/computeRates again so
  the online pulse dot, compact handshake and speed badge render
- startRenameConnection: strip the .client-ip span from the edited name
  (previously saving produced 'Name 10.x.x.x 10.x.x.x')
2026-08-28 00:03:57 +03:00
leonidorlov-hash 4b897a332d fix(awg3): use fixed random H1-H4 instead of ranges (cherry-pick 605fafb) 2026-08-27 23:43:20 +03:00
leonidorlov-hash 738d3736bb feat(install): used-port awareness when installing protocols
Previously the install modal defaulted to a fixed port and only avoided
ports of same-family instances, so installing e.g. AWG3 on a host where
AWG2 already held 55424 failed mid-install with a half-created broken
container ('port is already allocated').

- GET /api/servers/{id}/used-ports: real listening UDP/TCP ports via ss
- api_install_protocol: reject a busy port upfront with a clear error
  naming the owning process, before any docker run
- Install modal: fetches used ports, auto-suggests the first free port,
  live-validates manual input (red field + hint + disabled Install button)
- new translation key port_in_use_by (en/ru/fr/fa/zh)
2026-08-25 04:24:38 +03:00
leonidorlov-hash add408f67f fix(awg): read conntrack table inside the instance container
NAT for the VPN subnet happens in the container's network namespace, so the
host /proc/net/nf_conntrack only sees the container's own IP and per-peer
counts were always zero.
2026-08-25 02:10:05 +03:00
leonidorlov-hash c16c6af7a4 feat(awg): per-peer connection flood warnings (torrent detection)
- Count conntrack entries per peer IP from /proc/net/nf_conntrack (no extra
  packages on the host), matching against the instance subnet
- Record a warning when a peer exceeds 600 simultaneous connections,
  at most one per hour per peer, keeping the last 5 events; persisted in
  conn_warnings.json inside the container data dir (volume-backed)
- Render warnings under the client meta row (.conn-warnings/.conn-warning,
  no inline styles), localized via new conn_warning_text key (en/ru/fr/fa/zh)
- Show peer internal IP next to the client name (.client-ip)
2026-08-25 02:10:05 +03:00
Максимов Владимир Сергеевич dec0e90d11 v1.6.0
Fixed merge requests
Reset user traffic consumption
Implemented automatic backups
2026-08-24 19:14:04 +03:00
Public relations & Virtual technology 2f7d2cb643 Merge pull request #89 from helldweller/feat/awg-3.1
Add AmneziaWG 3.1 protocol support
2026-08-24 16:54:28 +03:00
Public relations & Virtual technology dd84f14f72 Merge branch 'main' into feat/awg-3.1 2026-08-24 16:54:18 +03:00
Public relations & Virtual technology b0f5b10748 Merge pull request #88 from leonidorlov-hash/feature/live-peer-speed
feat(ui): живая скорость пиров, компактный handshake, пульсация онлайна
2026-08-24 14:42:24 +03:00
Public relations & Virtual technology 61287c63cc Merge branch 'main' into feature/live-peer-speed 2026-08-24 14:42:14 +03:00
Public relations & Virtual technology 44b55b1d6d Merge pull request #87 from leonidorlov-hash/fix/traffic-direction
fix(ui): перепутанные бейджи ↓ скачано / ↑ отдано у пиров
2026-08-24 14:37:54 +03:00
Public relations & Virtual technology 617039f648 Merge pull request #86 from leonidorlov-hash/feature/awg-ipv6
feat(awg): dual-stack IPv6 support with automatic host detection
2026-08-24 14:36:38 +03:00
Public relations & Virtual technology facef95fb4 Merge branch 'main' into feature/awg-ipv6 2026-08-24 14:36:09 +03:00
Public relations & Virtual technology 6a99e6b599 Merge pull request #83 from leonidorlov-hash/fix-xray-adu-v26
fix(xray): make hot user add work with Xray-core v26 runtime API
2026-08-24 14:34:02 +03:00
Public relations & Virtual technology c902432eca Merge pull request #82 from leonidorlov-hash/feature/custom-dns
feat: configurable DNS (server-wide + per-peer) and editable peer configs
2026-08-24 14:33:30 +03:00
Public relations & Virtual technology e9bbb86423 Merge pull request #81 from leonidorlov-hash/feature/rename-connection
feat: rename existing connections (peers) across all protocols
2026-08-24 14:32:55 +03:00
Public relations & Virtual technology 9284d04981 Merge pull request #80 from leonidorlov-hash/fix-peer-ip-allocation
Fix peer IP allocation: fill subnet gaps, sort peers by IP, backup config
2026-08-24 14:32:11 +03:00
hell 4acf79a0b5 Describe what 3.1 adds instead of reusing the 2.0 text
The awg3 card reused awg_desc, which talks about awg-go and S3/S4 — true
of 2.0 as well, so the card said nothing about what the newer protocol
actually changes. Give it its own key naming the 3.x additions: header
protection, content padding and randomized timings.

_t() falls back to the key itself rather than to English, so the string is
added to all five locales at once.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 17:25:35 +07:00
hell 3a532a2e40 Add the missing installed-protocol tile for awg3
Installed protocols are rendered from static cards in the template that
applyInstalledAppsVisibility() only shows or hides, while the marketplace
builds its list dynamically from MARKETPLACE_APPS. With an entry in the
array but no static card, awg3 showed up as INSTALLED in Templates and
never got a tile on the server page.

Move the NEW badge to 3.1 as the newest protocol.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 17:02:26 +07:00
hell 862980f991 Keep junk sizes above the header protection floor
With HeaderProtectionKey set, the kernel module rejects any junk size
S1-S4 below HEADER_PROTECTION_NONCE_SIZE (12) — see the per-field checks
in netlink.c. The generator drew them from randint(10, 50), so roughly one
install in six produced an 10 or 11 and failed.

The failure was silent: `awg setconf` only reports "Invalid argument",
because the kernel explains itself through net_dbg_ratelimited, which is
off by default. The panel reported the install as successful while the
interface never came up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 16:41:06 +07:00
hell df2e0fb844 Add AmneziaWG 3.1 protocol support
AmneziaWG 3.1 adds a header protection key, content padding and randomized
protocol timings on top of the 2.0 obfuscation set. The panel generated only
the 2.0 parameters, so servers were always installed as 2.0.

Register awg3 as a separate protocol (container amnezia-awg3) instead of
extending awg2: existing installations keep byte-identical configs, and
clients that predate 3.1 are unaffected.

The parameters are defined once in AWG3_PARAM_MAP and reused by the server
config builder, the config parser and both client config builders. Parsing
matters as much as generation — client configs are rebuilt from the server
config, so a missing parser entry would silently drop the parameters and
break the handshake.

The amneziavpn/amneziawg-go image already ships amneziawg-tools 3.1, so no
image change is needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 16:31:06 +07:00
leonidorlov-hash 19b47ef346 fix(ui): swap down/up traffic badges - awg show reports transfer from server perspective 2026-08-21 20:50:57 +03:00
leonidorlov-hash 0e6ceb0751 feat(ui): live peer speed badge, compact fixed-width handshake, online pulse (wg-easy style) 2026-08-21 20:50:57 +03:00
leonidorlov-hash 128ddca04e fix(ui): swap download/upload traffic badges
awg/wg show reports peer transfer counters from the SERVER's perspective:
- 'received' = bytes the client uploaded
- 'sent' = bytes the client downloaded

The template rendered them the other way around, so the download badge (down arrow) showed the client's upload and vice versa. Swap the badges so arrows match the client's perspective.
2026-08-21 20:50:29 +03:00
leonidorlov-hash 076f7bfa37 fix(awg): parse IPv4 part of dual-stack Address line in _get_subnet_ip/_get_subnet_cidr
With 'Address = 10.8.1.1/24, fd42:8:1::1/64' the CIDR parser returned
'24, fd42:8:1::1', crashing int() in _get_subnet_base when adding a peer.
Both helpers now take only the first comma-separated (IPv4) component.
2026-08-19 01:51:46 +03:00
leonidorlov-hash 91e58c4dec feat(awg): dual-stack IPv6 support with automatic host detection
- install_protocol detects host IPv6 (default route or global address)
  and configures a ULA subnet (fd42:8:1::/64) alongside IPv4 when present
- start.sh learns the IPv6 subnet from the config Address line and adds
  ip6tables forwarding + NAT66 (MASQUERADE) rules; IPv4-only setups are
  untouched
- clients deterministically get an IPv6 derived from their IPv4 last
  octet (10.8.1.N -> fd42:8:1::<hex N>), so existing peers receive IPv6
  automatically when their config is regenerated
- peer AllowedIPs and client Address become dual-stack; clientIpv6 is
  stored in clientsTable; Cloudflare IPv6 DNS is added for v6 clients
- get_client_config and toggle_client re-add path handle IPv6 as well
2026-08-19 00:22:27 +03:00
leonidorlov-hash 0b5b0033dd fix(xray): make hot user add work with Xray-core v26 runtime API
xray api adu in Xray-core v26 builds a full inbound config from the
payload and silently adds 0 users (exit code 0) when port/listen are
missing. Include the inbound's port and listen in the adu payload and
treat "Added 0 user(s)" output as a failure so the caller falls back
to the restart-required error path instead of reporting success.
2026-08-06 01:37:41 +03:00
leonidorlov-hash f05f9a4677 fix: comment out DNS in server config on save (wg-quick/resolvconf), parse commented DNS 2026-08-05 17:10:09 +03:00
leonidorlov-hash e7373730ff fix: comment out DNS in server config on save (awg-quick/resolvconf), parse commented DNS 2026-08-05 17:10:07 +03:00
leonidorlov-hash d5cbe49572 i18n: config_saved (zh) 2026-08-05 03:06:48 +03:00
leonidorlov-hash 83cd8a4941 i18n: config_saved (fa) 2026-08-05 03:06:46 +03:00
leonidorlov-hash d23108f182 i18n: config_saved (fr) 2026-08-05 03:06:43 +03:00
leonidorlov-hash 39e0bb3d08 i18n: config_saved (ru) 2026-08-05 03:06:41 +03:00
leonidorlov-hash c13c044eb7 i18n: config_saved (en) 2026-08-05 03:06:38 +03:00
leonidorlov-hash 4abea44666 feat: editable peer config with Save button, QR/vpn-link regeneration 2026-08-05 03:06:36 +03:00
leonidorlov-hash 83fb6d0fa8 feat: POST /connections/config/save endpoint 2026-08-05 03:06:32 +03:00
leonidorlov-hash a670e6f45e feat(wg): DNS from server config, per-client customConfig + save_client_config 2026-08-05 03:06:29 +03:00
leonidorlov-hash c6c7896be2 feat(awg): DNS from server config, per-client customConfig + save_client_config 2026-08-05 03:06:26 +03:00
leonidorlov-hash 47bd6576a7 i18n: rename keys (zh) 2026-08-05 02:20:56 +03:00
leonidorlov-hash fb366ee6e3 i18n: rename keys (fa) 2026-08-05 02:20:53 +03:00
leonidorlov-hash 0b37b8fcad i18n: rename keys (fr) 2026-08-05 02:20:50 +03:00
leonidorlov-hash 824e86f994 i18n: rename keys (ru) 2026-08-05 02:20:48 +03:00
leonidorlov-hash 73deec212a i18n: rename keys (en) 2026-08-05 02:20:45 +03:00