diff --git a/Plugin/unraid/include/common.php b/Plugin/unraid/include/common.php index cd503f2..fee1391 100644 --- a/Plugin/unraid/include/common.php +++ b/Plugin/unraid/include/common.php @@ -544,7 +544,10 @@ function vv_network_stats(): array { } // Tailscale IP — use `tailscale ip` CLI (interface name varies: tailscale0, tailscale1, etc.) - $tsIp = trim(shell_exec('tailscale ip -4 2>/dev/null | head -1') ?: ''); + // Bounded like every other tailscale lookup in the tree. vv_network_stats() is served by + // api/monitor_fast.php, which the Monitor page polls once a second; an unbounded call here + // makes a slow tailscale silently drop that live cadence to whatever the CLI takes. + $tsIp = trim(shell_exec('timeout 2 tailscale ip -4 2>/dev/null | head -1') ?: ''); return [ 'available' => true, diff --git a/common.sh b/common.sh index 5840b49..818f82f 100755 --- a/common.sh +++ b/common.sh @@ -910,8 +910,12 @@ resolve_remote_ip() { local attempts=3 for ((i=1; i<=attempts; i++)); do - # Direct lookup — works when MagicDNS short-name resolution is active - REMOTE_SERVER=$(tailscale ip -4 "$ts_name" 2>/dev/null) + # Direct lookup — works when MagicDNS short-name resolution is active. + # Bounded, because it is not active here: the two hosts sit on separate tailnets, so + # this call cannot succeed and blocks ~5s before giving up, while the status fallback + # below answers in milliseconds. resolve_tailscale_ip() was bounded for this reason; + # this function has the same lookup and was missed. + REMOTE_SERVER=$(timeout 2 tailscale ip -4 "$ts_name" 2>/dev/null) # Fallback — parse tailscale status for FQDN entries (e.g. hostname.tailXXXX.ts.net) if [[ -z "$REMOTE_SERVER" ]]; then