From 7daf873e37a149ef417848a84421547d38241660 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 30 Dec 2023 22:40:08 +0100 Subject: [PATCH] feat: with ingored host key checking Signed-off-by: kjuulh --- crates/cuddle-ci/src/rust_service/ssh_agent.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/cuddle-ci/src/rust_service/ssh_agent.rs b/crates/cuddle-ci/src/rust_service/ssh_agent.rs index 1327b76..e20c7ad 100644 --- a/crates/cuddle-ci/src/rust_service/ssh_agent.rs +++ b/crates/cuddle-ci/src/rust_service/ssh_agent.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use async_trait::async_trait; -use dagger_sdk::{Container, Socket}; +use dagger_sdk::{Container, ContainerWithNewFileOptsBuilder, Socket}; use eyre::Context; use crate::{dagger_middleware::DaggerMiddleware, leptos_service::LeptosService}; @@ -26,7 +26,19 @@ impl DaggerMiddleware for SshAgent { let socket = self.client.host().unix_socket(&sock_var); + let home = container.env_variable("HOME").await?; + let c = container + .with_new_file_opts( + format!("{home}/.ssh/config"), + ContainerWithNewFileOptsBuilder::default().contents( + r#" +Host * + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null + "#, + ), + ) .with_unix_socket(&sock_var, socket) .with_env_variable("SSH_AUTH_SOCK", &sock_var);