This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

yellow: resolve AirVPN endpoint in main netns for transmission tunnel

Recent wireguard-tools resolve the peer Endpoint in the namespace where
`wg syncconf` runs. The transmission netns has no route until the tunnel
is up, so resolving europe.vpn.airdns.org from inside it always fails;
wg burns ~70s of DNS-retry backoff per attempt before erroring. During a
nixos switch that restarts transmission-netns this stalled the whole
deploy for >2min and left the service (and the download stack) failed.

Resolve the endpoint in the main netns (which has connectivity, and is
already gated on the `host` check above) and hand wg a numeric Endpoint,
so the tunnel comes up instantly. Also fix the bare `sleep` in the DNS
wait loop, which errored under `set -e` instead of retrying.

Assisted-by: Claude Code (claude-opus-4-8)

+14 -4
+14 -4
machines/yellow/config.nix
··· 59 59 path = [ 60 60 pkgs.iproute2 61 61 pkgs.wireguard-tools 62 + pkgs.gnused 63 + pkgs.gawk 62 64 ]; 63 65 script = '' 64 66 set -efux 65 - until ${pkgs.dig.host}/bin/host europe.vpn.airdns.org; do sleep; done 67 + until ${pkgs.dig.host}/bin/host europe.vpn.airdns.org; do sleep 1; done 66 68 67 69 ip link del t2 || : 68 70 ip -n transmission link set lo up ··· 71 73 ip link set airvpn netns transmission 72 74 ip -n transmission addr add 10.176.43.231/32 dev airvpn 73 75 ip -n transmission addr add fd7d:76ee:e68f:a993:41b3:846b:d271:30d8/128 dev airvpn 74 - ip netns exec transmission wg syncconf airvpn <(wg-quick strip ${ 75 - config.clan.core.vars.generators.airvpn.files."airvpn.conf".path 76 - }) 76 + # The transmission netns has no route until the tunnel is up, so wg must 77 + # not resolve the endpoint from inside it: recent wireguard-tools resolve 78 + # in the current netns, which stalls the deploy on ~70s of DNS retries. 79 + # Resolve here in the main netns and hand wg a numeric Endpoint. 80 + conf=$(wg-quick strip ${config.clan.core.vars.generators.airvpn.files."airvpn.conf".path}) 81 + ep=$(printf '%s\n' "$conf" | sed -n 's/^Endpoint *= *//p') 82 + ephost=''${ep%:*} 83 + epport=''${ep##*:} 84 + epip=$(${pkgs.dig.host}/bin/host "$ephost" | awk '/has address/ { print $NF; exit }') 85 + ip netns exec transmission wg syncconf airvpn \ 86 + <(printf '%s\n' "$conf" | sed "s|$ephost:$epport|$epip:$epport|") 77 87 ip -n transmission link set airvpn up 78 88 ip -n transmission route add default dev airvpn 79 89 ip -6 -n transmission route add default dev airvpn