Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/revoltchat/backend into fea…
Browse files Browse the repository at this point in the history
…t/pushd
  • Loading branch information
IAmTomahawkx committed Sep 29, 2024
2 parents 48735e9 + 8fc791f commit 5a8c556
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
if: github.event_name != 'pull_request'
strategy:
matrix:
project: [delta, bonfire, autumn]
project: [delta, bonfire, autumn, january]
name: Build ${{ matrix.project }} image
steps:
# Configure build environment
Expand Down Expand Up @@ -102,6 +102,10 @@ jobs:
"autumn": {
"path": "crates/services/autumn",
"tag": "${{ github.repository_owner }}/autumn"
},
"january": {
"path": "crates/services/january",
"tag": "${{ github.repository_owner }}/january"
}
}
export_to: output
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ jobs:

- name: Run services in background
run: |
docker compose -f docker-compose.db.yml up -d
- name: Copy .env.example
run: |
cp .env.example .env
docker compose -f compose.yml up -d
- name: Run cargo test
env:
Expand Down
5 changes: 5 additions & 0 deletions crates/core/files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ pub async fn fetch_from_s3(bucket_id: &str, path: &str, nonce: &str) -> Result<V
// we just want the Vec<u8>
}

// File is not encrypted
if nonce.is_empty() {
return Ok(buf);
}

// Recover nonce as bytes
let nonce = &BASE64_STANDARD.decode(nonce).unwrap()[..];
let nonce: &Nonce<typenum::consts::U12> = nonce.into();
Expand Down
12 changes: 12 additions & 0 deletions crates/services/january/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build Stage
FROM ghcr.io/revoltchat/base:latest AS builder

# Bundle Stage
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=builder /home/rust/src/target/release/revolt-january ./
COPY --from=mwader/static-ffmpeg:7.0.2 /ffmpeg /usr/local/bin/
COPY --from=mwader/static-ffmpeg:7.0.2 /ffprobe /usr/local/bin/

EXPOSE 14705
USER nonroot
CMD ["./revolt-january"]

0 comments on commit 5a8c556

Please sign in to comment.