diff --git a/Dockerfile b/Dockerfile index 2ba4588..7a3d0aa 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 COPY --from=builder /app/target/release/mirrord /mirrord diff --git a/src/proxy.rs b/src/proxy.rs index d408005..86adbd1 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -122,9 +122,8 @@ impl Mirror { } // check if cache should be used + Self::create_cache_dir(p.parent().unwrap()); if !self.no_cache.is_match(path) || !self.is_cache_invalid(&p) { - Self::create_cache_dir(p.parent().unwrap()); - // use cache if present if let Some(resp) = self.fetch_cache(&p, req).await { log::info!("Returning {path} from cache"); @@ -219,6 +218,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(