Stop a missing SSH key making every Tailscale peer look like the Gitea host, and say so when the scripts are absent

This commit is contained in:
Gmer4Lfe
2026-08-16 13:31:24 -04:00
parent 64de77c065
commit 6fbc2b4125
+21 -2
View File
@@ -56,7 +56,17 @@ SRC="/boot/config/plugins/varaverk/Plugin/unraid"
[[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR" [[ -L "$WEB_DIR" ]] && rm -f "$WEB_DIR"
[[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR" [[ -d "$WEB_DIR" ]] && rm -rf "$WEB_DIR"
ln -sf "$SRC" "$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
]]> ]]>
</INLINE> </INLINE>
</FILE> </FILE>
@@ -143,9 +153,18 @@ if [[ ! -d "$SCRIPTS_DIR/.git" ]]; then
elif command -v tailscale >/dev/null 2>&1; then elif command -v tailscale >/dev/null 2>&1; then
# Try each known peer until we find one hosting Gitea # Try each known peer until we find one hosting Gitea
while IFS= read -r peer_ip; do 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" \ if ssh -i "$GITEA_SSH_KEY" -p "$SSH_PORT" \
-o ConnectTimeout=3 -o StrictHostKeyChecking=no \ -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" GITEA_IP="$peer_ip"
log "Gitea found on Tailscale peer $GITEA_IP" log "Gitea found on Tailscale peer $GITEA_IP"
break break