From f9e0fadb689b68633eec933835323fef42793d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Tue, 2 Jun 2026 16:21:49 +0200 Subject: [PATCH] fix: use ssh-keyscan to populate known_hosts for Dagger --- scripts/setup_dagger_remote.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/setup_dagger_remote.sh b/scripts/setup_dagger_remote.sh index 6f99fa2..fa13ee9 100755 --- a/scripts/setup_dagger_remote.sh +++ b/scripts/setup_dagger_remote.sh @@ -22,23 +22,23 @@ chmod 700 ~/.ssh echo "$DAGGER_SSH_KEY" > ~/.ssh/dagger_key chmod 600 ~/.ssh/dagger_key +# Add remote host to known_hosts to satisfy Dagger's internal SSH client +ssh-keyscan -H "$DAGGER_ENGINE_HOST" >> ~/.ssh/known_hosts 2>/dev/null + # Use ssh-agent to manage the key for Dagger's internal SSH client eval "$(ssh-agent -s)" ssh-add ~/.ssh/dagger_key # Export _EXPERIMENTAL_DAGGER_RUNNER_HOST for redirection -# Dagger's Go SSH client will now use the agent to find the key export _EXPERIMENTAL_DAGGER_RUNNER_HOST="ssh://dagger@$DAGGER_ENGINE_HOST" if [ -n "${GITHUB_ENV:-}" ]; then echo "_EXPERIMENTAL_DAGGER_RUNNER_HOST=ssh://dagger@$DAGGER_ENGINE_HOST" >> "$GITHUB_ENV" - # Also pass the agent socket if needed, though Dagger usually handles this if exported echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV" echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> "$GITHUB_ENV" fi # Verify echo "Verifying connection to remote Dagger engine..." -# Ensure remote dagger knows which socket to use if ! timeout 45 dagger query --progress=plain '{ version }' ; then echo "Error: Dagger engine unreachable via SSH at $DAGGER_ENGINE_HOST" # Debug: try to just run id over ssh