From 0b9d05c59551d729629ef8f068b4de6c2d013873 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 13 Apr 2024 20:51:36 +0200 Subject: [PATCH 1/4] fix --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 2ba4588..6fb27ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN cargo build --release FROM debian:buster RUN apt update && apt upgrade -y +RUN apt install -y gnupg ca-certificates openssl-1.1 COPY --from=builder /app/target/release/mirrord /mirrord From a78b710d66670994cb9438d1ec179f5591d5d15e Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 13 Apr 2024 20:56:09 +0200 Subject: [PATCH 2/4] fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6fb27ee..7a3d0aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN cargo build --release FROM debian:buster RUN apt update && apt upgrade -y -RUN apt install -y gnupg ca-certificates openssl-1.1 +RUN apt install -y gnupg ca-certificates openssl COPY --from=builder /app/target/release/mirrord /mirrord From 569665a5a24d50236a65448c162292cb92f61fc7 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 13 Apr 2024 21:09:35 +0200 Subject: [PATCH 3/4] debug --- src/proxy.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/proxy.rs b/src/proxy.rs index 4aa6e5b..2346f8c 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -128,6 +128,7 @@ impl Mirror { let status_code = response.status(); let body_bytes = response.bytes().await.ok()?; if status_code.is_success() { + log::debug!("Writing request to {save:?}"); std::fs::write(save, &body_bytes).unwrap(); } let mut http_response = HttpResponse::build( From d1a688d7d7425119b88bd50ed5217671749121ba Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 13 Apr 2024 22:22:17 +0200 Subject: [PATCH 4/4] fix cache --- src/proxy.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/proxy.rs b/src/proxy.rs index 2346f8c..82ae2ea 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -68,9 +68,8 @@ impl Mirror { let p = std::path::Path::new(&path[1..]); let p = std::path::Path::new(&self.data_dir).join(p); + Self::create_cache_dir(p.parent().unwrap()); if !self.no_cache.is_match(path) { - Self::create_cache_dir(p.parent().unwrap()); - if p.exists() { // todo : refresh caches log::info!("Returning {path} from cache");