Compare commits

..

No commits in common. "5648c76f788adab6796a18fac4739e68b842c3fe" and "f790438104a26f7b8cde2bfff8caba36a7137c18" have entirely different histories.

7 changed files with 272 additions and 424 deletions

1
.gitignore vendored
View File

@ -8,4 +8,3 @@ target
# Testing # Testing
test-results test-results
tmp

View File

@ -11,17 +11,17 @@ RUN pnpm run build
# BACKEND # BACKEND
FROM rust:1.80-alpine as backend FROM rust:1.76-alpine as backend
WORKDIR /tmp WORKDIR /tmp
RUN apk add --no-cache libc-dev openssl-dev alpine-sdk RUN apk add --no-cache libc-dev openssl-dev alpine-sdk
COPY ./packages/backend ./ COPY ./packages/backend ./
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo build --release RUN cargo build --release
# RUNNER # RUNNER
FROM alpine:3.19 FROM alpine:3.19
WORKDIR /app WORKDIR /app
RUN apk add --no-cache curl libgcc RUN apk add --no-cache curl
COPY --from=backend /tmp/target/release/cryptgeon . COPY --from=backend /tmp/target/release/cryptgeon .
COPY --from=client /tmp/packages/frontend/build ./frontend COPY --from=client /tmp/packages/frontend/build ./frontend
ENV FRONTEND_PATH="./frontend" ENV FRONTEND_PATH="./frontend"

View File

@ -1,6 +1,8 @@
# DEV Compose file. # DEV Compose file.
# For a production file see: README.md # For a production file see: README.md
version: '3.8'
services: services:
redis: redis:
image: redis:7-alpine image: redis:7-alpine

View File

@ -1,3 +1,5 @@
version: '3.8'
services: services:
redis: redis:
image: redis:7-alpine image: redis:7-alpine
@ -14,7 +16,7 @@ services:
SIZE_LIMIT: 4 MiB SIZE_LIMIT: 4 MiB
ports: ports:
- 80:8000 - 80:8000
# Optional health checks # Optional health checks
# healthcheck: # healthcheck:
# test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"] # test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"]

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ name = "cryptgeon"
version = "2.6.1" version = "2.6.1"
authors = ["cupcakearmy <hi@nicco.io>"] authors = ["cupcakearmy <hi@nicco.io>"]
edition = "2021" edition = "2021"
rust-version = "1.80" rust-version = "1.76"
[[bin]] [[bin]]
name = "cryptgeon" name = "cryptgeon"
@ -22,4 +22,4 @@ dotenv = "0.15"
mime = "0.3" mime = "0.3"
env_logger = "0.9" env_logger = "0.9"
log = "0.4" log = "0.4"
redis = { version = "0.25.2", features = ["tls-native-tls"] } redis = "0.23"

View File

@ -36,7 +36,7 @@ pub fn set(id: &String, note: &Note) -> Result<(), &'static str> {
match note.expiration { match note.expiration {
Some(e) => { Some(e) => {
let seconds = e - now(); let seconds = e - now();
conn.expire(id, seconds as i64) conn.expire(id, seconds as usize)
.map_err(|_| "Unable to set expiration on notion")? .map_err(|_| "Unable to set expiration on notion")?
} }
None => {} None => {}