From dc897064cd78604058bdf68c167bb18d83b89700 Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 15 Jul 2026 05:17:02 -0400 Subject: [PATCH] fix(iso): derive ARCHIPELAGO_HOST_IP from the default route, not hostname -I MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unit's ExecStartPre baked the first hostname -I token into host-ip.env, which config.rs prefers over its own detection — once a VPN/bridge interface existed (netbird's wg tunnel), every host_ip consumer (install configs, VPN, mint URLs) got the tunnel IP. Read the main-table default route's src address instead, falling back to hostname -I on routeless hosts. Co-Authored-By: Claude Fable 5 --- image-recipe/configs/archipelago.service | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/image-recipe/configs/archipelago.service b/image-recipe/configs/archipelago.service index 87f89149..fc3ec8d9 100644 --- a/image-recipe/configs/archipelago.service +++ b/image-recipe/configs/archipelago.service @@ -21,7 +21,10 @@ EnvironmentFile=-/var/lib/archipelago/telemetry.env Environment="XDG_RUNTIME_DIR=/run/user/1000" # + prefix runs these as root (needed for chown/mkdir outside ReadWritePaths) ExecStartPre=+/bin/bash -c 'mkdir -p /run/user/1000 /var/lib/containers && chown archipelago:archipelago /run/user/1000 && chmod 700 /run/user/1000' -ExecStartPre=+/bin/bash -c 'mkdir -p /var/lib/archipelago && chown archipelago:archipelago /var/lib/archipelago && echo "ARCHIPELAGO_HOST_IP=$(hostname -I 2>/dev/null | awk "{print $$1}")" > /var/lib/archipelago/host-ip.env && chown archipelago:archipelago /var/lib/archipelago/host-ip.env' +# Host IP from the main-table default route — hostname -I token order breaks +# once a VPN/bridge interface exists (netbird's wg tunnel sorted first and +# poisoned every host_ip consumer). Falls back to hostname -I when routeless. +ExecStartPre=+/bin/bash -c 'mkdir -p /var/lib/archipelago && chown archipelago:archipelago /var/lib/archipelago && IP=$(ip -4 route show default 2>/dev/null | sed -n "s/.* src \([0-9.]*\).*/\1/p" | head -1); [ -n "$$IP" ] || IP=$(hostname -I 2>/dev/null | awk "{print $$1}"); echo "ARCHIPELAGO_HOST_IP=$$IP" > /var/lib/archipelago/host-ip.env && chown archipelago:archipelago /var/lib/archipelago/host-ip.env' ExecStart=/usr/local/bin/archipelago Restart=on-failure RestartSec=5