Commit 9871f73
Ivan Bondarev
feat(v5.11.2): vpn:// QR for one-tap Amnezia VPN app import
Add `<name>.vpnuri.png` - a second per-client QR code rendered from the
existing vpn:// URI - so users can one-tap-import clients into the flagship
Amnezia VPN app (Android/iOS/Desktop). The existing `<name>.png` (scan of
`.conf`) is unchanged and keeps working with WireGuard-compatible clients
(AmneziaWG Windows, wireguard-apple, wg-quick).
Code:
- awg_common.sh + _en.sh: new generate_qr_vpnuri helper with atomic write
(tmp.\$\$ in same dir -> qrencode -> chmod 600 -> mv -f) so a failed
encode never leaves a truncated .vpnuri.png behind.
- generate_client: hook after successful generate_vpn_uri (skipped if URI
failed - no source to encode). generate_client and regenerate_client now
both log_warn on URI failure for consistency.
- manage_amneziawg.sh + _en.sh: regen refreshes both QR codes together;
remove cleans up .vpnuri.png alongside .conf/.png/.vpnuri.
- Updated lock-scope comment in regenerate_client to cover .vpnuri.png
and document the known stale-artefact window against concurrent remove
(peer already out of server config, user resolves on next regen/remove).
Tests:
- tests/test_qr_vpnuri.bats (+10 bats, 261 total, up from 251 on v5.11.1):
happy path, missing .vpnuri -> error, qrencode non-zero exit -> error,
atomic-write (stale PNG preserved on failure, no orphan .tmp.*),
chmod 600 on Linux/Darwin, RU/EN structural parity of the helper,
hooks in generate_client / regenerate_client / manage regen / remove.
Docs:
- ADVANCED.md + _en.md: section 'vpn:// URI import' updated with two
import flows (QR scan for Amnezia VPN app + URI paste), callout about
the two QR formats targeting different client families, migration note
(manage regen <name> for pre-5.11.2 clients).
- CHANGELOG bilingual RU+EN entry [5.11.2] - 2026-04-24.
Release prep:
- SCRIPT_VERSION 5.11.2 and header date 2026-04-24 across all 6 scripts.
- COMMON_SCRIPT_SHA256 / MANAGE_SCRIPT_SHA256 in install_amneziawg{,_en}.sh
refreshed to match the updated helpers.
- README.md + README.en.md: quick-install URLs v5.11.1 -> v5.11.2 and
version badge updated.
Backup/restore already picks up `.vpnuri.png` via the existing *.png
glob in _backup_configs_nolock and chmod 600 *.png in restore_backup -
no changes needed there. Existing clients get the new .vpnuri.png after
one `manage regen <name>`; downgrading to v5.11.1 is safe (stale
.vpnuri.png just sits in /root/awg/ and is ignored).1 parent 39f7e21 commit 9871f73
13 files changed
Lines changed: 434 additions & 84 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
862 | 862 | | |
863 | | - | |
| 863 | + | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
| 866 | + | |
866 | 867 | | |
867 | | - | |
| 868 | + | |
868 | 869 | | |
869 | | - | |
| 870 | + | |
870 | 871 | | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
| 872 | + | |
875 | 873 | | |
876 | | - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
877 | 889 | | |
878 | 890 | | |
879 | 891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
| 859 | + | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
862 | 862 | | |
863 | | - | |
| 863 | + | |
| 864 | + | |
864 | 865 | | |
865 | | - | |
| 866 | + | |
866 | 867 | | |
867 | | - | |
| 868 | + | |
868 | 869 | | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
| 870 | + | |
873 | 871 | | |
874 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
875 | 887 | | |
876 | 888 | | |
877 | 889 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
17 | 47 | | |
18 | 48 | | |
19 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
17 | 47 | | |
18 | 48 | | |
19 | 49 | | |
| |||
0 commit comments