Skip to content

v5.11.4: hotfix — vpn:// psk_key + PPA outage retry#69

Merged
bivlked merged 2 commits intomainfrom
v5.11.4/development
May 4, 2026
Merged

v5.11.4: hotfix — vpn:// psk_key + PPA outage retry#69
bivlked merged 2 commits intomainfrom
v5.11.4/development

Conversation

@bivlked
Copy link
Copy Markdown
Owner

@bivlked bivlked commented May 4, 2026

Summary

Hotfix patch addressing two reported user bugs after v5.11.3, no architectural changes.

  • Issue Подключение не работает в Shadowrocket iOS #67 (@haritos90) — manage add --psk correctly wrote PSK to server [Peer] and client .conf, but generate_vpn_uri did not include the psk_key field in inner JSON. AmneziaVPN parser reads psk_key directly (amnezia-client awgProtocolConfig.cpp), so vpn:// import silently came up without PSK and the handshake failed at "never". Also tightened CR / trailing-whitespace stripping for PresharedKey = and AllowedIPs = so CRLF configs edited on Windows do not leak \r into the JSON.

  • Issue ppa amnezia не доступны #68 (@saligin / @baikov) — ppa.launchpadcontent.net briefly went down on May 3rd; apt-get update returns 0 tolerantly even when an InRelease did not download, so apt-get install amneziawg-dkms failed with "Unable to locate package" and the script died. New apt_wait_for_ppa_package helper polls apt-cache for the canonical package across 3 attempts with 30 s and 60 s backoff (and a fresh apt update between retries). On final failure: friendly message pointing at ppa amnezia не доступны #68 explaining this is a Launchpad infrastructure outage, not a script bug.

Test plan

  • bash -n on all 6 scripts — clean
  • shellcheck -S warning on all 6 scripts — clean
  • bats tests/ — 312/312 PASS (was 296, +16 new bats: 5 in test_v5114_psk_uri.bats, 11 in test_v5114_ppa_retry.bats)
  • RU/EN parity — confirmed by Codex code+docs audits (round 1 + round 2)
  • VPS test on clean Debian 13 trixie (150.241.230.21):
    • PSK fix: full install → manage add testpsk --psk → server [Peer] PSK = client .conf PSK = decoded vpn:// inner JSON psk_key (all three match)
    • PPA retry: iptables-blocked PPA → 3 attempts logged → friendly final error; happy-path: rc=0, 0 s, 0 warnings
  • SHA256 pins refreshed for awg_common.sh + manage_amneziawg.sh in both RU and EN installers
  • SCRIPT_VERSION + # Версия / # Version + # Дата / # Date bumped in 6 scripts
  • CHANGELOG.md + CHANGELOG.en.md entries ## [5.11.4] — 2026-05-04 (release.yml awk parser format)
  • README.md + README.en.md badge + 11 URL refs each bumped to v5.11.4
  • Replies posted on Подключение не работает в Shadowrocket iOS #67, ppa amnezia не доступны #68, D#66

Ivan Bondarev added 2 commits May 4, 2026 12:03
Two bug fixes on top of v5.11.3, no architectural changes.

Issue #67 (haritos90):
manage add --psk wrote PresharedKey to server [Peer] and client .conf
correctly, but generate_vpn_uri did not include the psk_key field in
the inner JSON awg block. AmneziaVPN parser reads psk_key directly
(amnezia-client awgProtocolConfig.cpp), so vpn:// import silently
came up without PSK and the handshake failed. awg_common.sh / _en.sh:
extract PSK via awk (pipefail-safe; trailing CR + trailing whitespace
stripped); pass as 19th positional arg to perl; emit psk_key into
inner JSON only when non-empty. Also tightened tr -d ' \r' on
AllowedIPs so CRLF configs don't leak \r into JSON.

Issue #68 (saligin / baikov):
ppa.launchpadcontent.net briefly went down; apt update at step 2
returned non-zero and the script died. install_amneziawg.sh / _en.sh:
new apt_update_with_retry helper near apt_update_tolerant — 3 attempts
with 30 s and 60 s sleeps between them (~1.5 min total wait), 1800 s
delay cap to guard against arithmetic overflow. After three failures:
friendly log lines explaining Launchpad outage with link to issue #68.

Tests: +16 new bats (312 total).
- test_v5114_psk_uri.bats (+5): PSK present / absent / indented / CRLF
  / empty PresharedKey =.
- test_v5114_ppa_retry.bats (+11): success on first / retry until
  success / max attempts / exponential backoff / 1800 s cap / RU+EN
  parity / issue #68 link in both installers.

SHA256 pins refreshed for awg_common.sh + manage_amneziawg.sh in both
RU and EN installers.

bash -n + shellcheck -S warning clean for 6 scripts. bats 312/312 PASS.
The first round of the PPA retry helper (apt_update_with_retry) gated
on the rc of apt_update_tolerant. That turned out to never trigger in
practice: Debian apt-get update returns 0 tolerantly even when an
InRelease did not download — exactly the saligin / #68 scenario. Real
fix has to detect that the PPA package itself is missing from the cache.

apt_wait_for_ppa_package <pkg> [max] [delay] now polls apt-cache show
for the canonical package, with apt_update_tolerant re-runs between
retries. Same backoff math (30 s → 60 s, 1800 s cap), same friendly
final error pointing to issue #68. Test rewrites stub apt-cache plus
apt_update_tolerant separately and verify the helper drives apt update
only between retries (not before the first attempt).

VPS test (Debian 13 trixie 150.241.230.21) verified Test 1 (PSK fix):
server [Peer], client .conf, and decoded vpn:// inner JSON all carry
the same psk_key. Test 2 (PPA retry) re-runs after this redesign push.

Bats: 312/312 PASS. shellcheck clean. CHANGELOG entries updated to
explain the apt-cache-based check (RU + EN).
@bivlked bivlked merged commit b918dbd into main May 4, 2026
3 checks passed
@bivlked bivlked deleted the v5.11.4/development branch May 4, 2026 09:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e83a8c922

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install_amneziawg.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant