From 96bf1229344173b993d55c6777f1698c8dcbdfc1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 5 Oct 2023 23:00:15 +0200 Subject: [PATCH] fix: tarball for workspace export is generated in /tmp/windmill --- backend/windmill-api/src/workspaces.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 1a6f5e6d3d..d63ea34de7 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -1492,7 +1492,7 @@ async fn tarball_workspace( ) -> Result<([(headers::HeaderName, String); 2], impl IntoResponse)> { require_admin(authed.is_admin, &authed.username)?; - let tmp_dir = TempDir::new_in(".")?; + let tmp_dir = TempDir::new_in("/tmp/windmill/")?; let name = match archive_type.as_deref() { Some("tar") | None => Ok(format!("windmill-{w_id}.tar")), @@ -1696,7 +1696,7 @@ async fn tarball_workspace( archive.finish().await?; - let file = tokio::fs::File::open(file_path).await?; + let file = tokio::fs::File::open(&file_path).await?; let stream = ReaderStream::new(file); let body = StreamBody::new(stream); @@ -1708,6 +1708,5 @@ async fn tarball_workspace( format!("attachment; filename=\"{name}\""), ), ]; - Ok((headers, body)) }