From 6fbc2b412573894d9e40236007b123b85fc64328 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 16 Aug 2026 13:31:24 -0400 Subject: [PATCH] Stop a missing SSH key making every Tailscale peer look like the Gitea host, and say so when the scripts are absent --- Plugin/varaverk.plg | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Plugin/varaverk.plg b/Plugin/varaverk.plg index 7d60e0d..908e35f 100644 --- a/Plugin/varaverk.plg +++ b/Plugin/varaverk.plg @@ -56,7 +56,17 @@ SRC="/boot/config/plugins/varaverk/Plugin/unraid" [[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR" [[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR" ln -sf "$SRC" "$WEB_DIR" -echo "[Varaverk] web dir symlinked → $SRC" +# The link is made either way — it costs nothing and becomes valid the moment the scripts land, +# which matters because this block runs on every boot while the clone runs once. What is not +# acceptable is reporting success when the target is not there: the symlink dangles, the Varaverk +# tab never appears, and "web dir symlinked" is the only thing anyone sees. +if [[ -d "$SRC" ]]; then + echo "[Varaverk] web dir symlinked → $SRC" +else + echo "[Varaverk] WARNING: $SRC does not exist — the scripts are not installed." + echo "[Varaverk] The Varaverk tab will not appear until the repo is cloned." + echo "[Varaverk] See /boot/config/plugins/varaverk/install.log for why the clone failed." +fi ]]> @@ -143,9 +153,18 @@ if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then elif command -v tailscale >/dev/null 2>&1; then # Try each known peer until we find one hosting Gitea while IFS= read -r peer_ip; do + # Match Gitea's actual banner, not the word "gitea" anywhere in the output. The + # identity path is /root/.ssh/unraid_gitea, so a plain "gitea" match hits ssh's own + # "Warning: Identity file /root/.ssh/unraid_gitea not accessible" — which means a + # missing key made EVERY peer look like a Gitea host. The loop takes the first match + # and breaks, so that picked an arbitrary peer, failed the fetch against it, and fell + # through to the GitHub fallback with an error naming the wrong machine. + # + # These phrases are sentences Gitea emits; none of them can occur in a file path. if ssh -i "$GITEA_SSH_KEY" -p "$SSH_PORT" \ -o ConnectTimeout=3 -o StrictHostKeyChecking=no \ - -o BatchMode=yes "git@${peer_ip}" 2>&1 | grep -q "varaverk\|Gitea\|gitea"; then + -o BatchMode=yes "git@${peer_ip}" 2>&1 \ + | grep -qiE "does not provide shell access|successfully authenticated|welcome to gitea"; then GITEA_IP="$peer_ip" log "Gitea found on Tailscale peer $GITEA_IP" break