From e08c9d1871fc1b9f6fd112da0f8832f1748f78aa Mon Sep 17 00:00:00 2001 From: Matthieu Guegan Date: Thu, 16 May 2024 09:45:26 +0200 Subject: [PATCH 1/3] Bump redis crate to 0.25.2 This will enable TLS feature --- packages/backend/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/Cargo.toml b/packages/backend/Cargo.toml index 99957d6..63a2ee8 100644 --- a/packages/backend/Cargo.toml +++ b/packages/backend/Cargo.toml @@ -22,4 +22,4 @@ dotenv = "0.15" mime = "0.3" env_logger = "0.9" log = "0.4" -redis = "0.23" +redis = { version = "0.25.2", features = ["tls-native-tls"] } From ed3e5f48a04b3ec0a5382f05692e4341cd99e4a9 Mon Sep 17 00:00:00 2001 From: Matthieu Guegan Date: Thu, 16 May 2024 09:47:01 +0200 Subject: [PATCH 2/3] Fix wrong type due to updated lib See https://github.com/redis-rs/redis-rs/pull/589 --- packages/backend/src/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/store.rs b/packages/backend/src/store.rs index d18d947..bebf2d2 100644 --- a/packages/backend/src/store.rs +++ b/packages/backend/src/store.rs @@ -36,7 +36,7 @@ pub fn set(id: &String, note: &Note) -> Result<(), &'static str> { match note.expiration { Some(e) => { let seconds = e - now(); - conn.expire(id, seconds as usize) + conn.expire(id, seconds as i64) .map_err(|_| "Unable to set expiration on notion")? } None => {} From f8c17487bd67c30f45ea55113353d15a4dfe52ef Mon Sep 17 00:00:00 2001 From: Matthieu Guegan Date: Thu, 16 May 2024 09:55:04 +0200 Subject: [PATCH 3/3] Support dynamically-linked and/or native musl targets See https://github.com/rust-lang/rust/pull/40113#issuecomment-323193341 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55b7eff..b9ffd53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,13 +15,13 @@ FROM rust:1.76-alpine as backend WORKDIR /tmp RUN apk add --no-cache libc-dev openssl-dev alpine-sdk COPY ./packages/backend ./ -RUN cargo build --release +RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo build --release # RUNNER FROM alpine:3.19 WORKDIR /app -RUN apk add --no-cache curl +RUN apk add --no-cache curl libgcc COPY --from=backend /tmp/target/release/cryptgeon . COPY --from=client /tmp/packages/frontend/build ./frontend ENV FRONTEND_PATH="./frontend"