19 Commits

Author SHA1 Message Date
c39a39a889 Remove unnecessary lifetime param and use new RNG API
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
2025-10-14 17:58:03 +02:00
b1c9f2ccf8 Merge pull request #45 from flibusta-apps/dependabot/github_actions/github/codeql-action-4
Bump github/codeql-action from 3 to 4
2025-10-14 17:57:50 +02:00
dependabot[bot]
b4b0a10ce7 Bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-08 08:04:11 +00:00
8e4c3303f2 Merge pull request #43 from flibusta-apps/dependabot/github_actions/actions/checkout-5
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
Bump actions/checkout from 4 to 5
2025-09-10 17:06:17 +02:00
56487b36b6 Update deps
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
2025-08-31 14:01:41 +02:00
dependabot[bot]
534bcda47b Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-19 16:56:57 +00:00
353e142d4d Create rust-clippy.yml
Some checks failed
rust-clippy analyze / Run rust-clippy analyzing (push) Has been cancelled
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-08-17 23:27:30 +02:00
42596ac3e6 Merge pull request #42 from flibusta-apps/dependabot/cargo/slab-0.4.11
Bump slab from 0.4.10 to 0.4.11
2025-08-17 23:17:30 +02:00
dependabot[bot]
a40f92a666 Bump slab from 0.4.10 to 0.4.11
Bumps [slab](https://github.com/tokio-rs/slab) from 0.4.10 to 0.4.11.
- [Release notes](https://github.com/tokio-rs/slab/releases)
- [Changelog](https://github.com/tokio-rs/slab/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/slab/compare/v0.4.10...v0.4.11)

---
updated-dependencies:
- dependency-name: slab
  dependency-version: 0.4.11
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-17 21:13:45 +00:00
e837436077 Merge pull request #41 from flibusta-apps/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-17 23:12:42 +02:00
dependabot[bot]
6484b622ff Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 15:19:09 +00:00
dc16bc7eb4 Optimize release build
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-06-28 22:35:03 +02:00
5b24d28ef0 Update deps 2025-06-28 22:12:02 +02:00
d9bbcc947f Update webhook URL parameter to BOOK_SERVER_TAG
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-06-21 23:08:39 +02:00
0642f14d4e Update dependencies and Docker workflow for latest compatibility
- Update many Rust dependencies in Cargo.lock to latest versions -
  Update Docker workflow: - Add image tag with commit SHA - Pass commit
  SHA as a query param to deployment webhook - Minor YAML formatting
  improvements
2025-06-21 22:11:01 +02:00
684f4e3e52 Merge pull request #40 from flibusta-apps/dependabot/cargo/tokio-1.44.2
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
Bump tokio from 1.44.1 to 1.44.2
2025-04-08 15:56:16 +02:00
dependabot[bot]
64f77d0f15 Bump tokio from 1.44.1 to 1.44.2
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.1 to 1.44.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 02:11:04 +00:00
6bf09ce429 Merge pull request #39 from flibusta-apps/dependabot/cargo/openssl-0.10.72
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
Bump openssl from 0.10.70 to 0.10.72
2025-04-04 23:57:54 +02:00
dependabot[bot]
e3410ef6dd Bump openssl from 0.10.70 to 0.10.72
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.70 to 0.10.72.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.70...openssl-v0.10.72)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.72
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-04 20:54:01 +00:00
5 changed files with 1043 additions and 616 deletions

View File

@@ -3,18 +3,16 @@ name: Build docker image
on: on:
push: push:
branches: branches:
- 'main' - "main"
jobs: jobs:
Build-Docker-Image: Build-Docker-Image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout uses: actions/checkout@v5
uses: actions/checkout@v4
- - name: Set up Docker Buildx
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- id: repository_name - id: repository_name
@@ -22,16 +20,14 @@ jobs:
with: with:
string: ${{ github.repository }} string: ${{ github.repository }}
- - name: Login to ghcr.io
name: Login to ghcr.io
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build and push
name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
env: env:
@@ -39,12 +35,11 @@ jobs:
with: with:
push: true push: true
platforms: linux/amd64 platforms: linux/amd64
tags: ghcr.io/${{ env.IMAGE }}:latest tags: ghcr.io/${{ env.IMAGE }}:latest,ghcr.io/${{ env.IMAGE }}:${{ github.sha }}
context: . context: .
file: ./docker/build.dockerfile file: ./docker/build.dockerfile
- - name: Invoke deployment hook
name: Invoke deployment hook
uses: joelwmale/webhook-action@master uses: joelwmale/webhook-action@master
with: with:
url: ${{ secrets.WEBHOOK_URL }} url: ${{ secrets.WEBHOOK_URL }}?BOOK_SERVER_TAG=${{ github.sha }}

55
.github/workflows/rust-clippy.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# rust-clippy is a tool that runs a bunch of lints to catch common
# mistakes in your Rust code and help improve your Rust code.
# More details at https://github.com/rust-lang/rust-clippy
# and https://rust-lang.github.io/rust-clippy/
name: rust-clippy analyze
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '15 21 * * 5'
jobs:
rust-clippy-analyze:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: stable
components: clippy
override: true
- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt
- name: Run rust-clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

1553
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,25 +4,39 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[profile.release]
opt-level = 3
debug = false
strip = true
lto = true
codegen-units = 1
panic = 'abort'
[profile.profiling]
inherits = "release"
debug = true
strip = false
[dependencies] [dependencies]
once_cell = "1.21.1" once_cell = "1.21.1"
tokio = { version = "1.44.1", features = ["full"] } tokio = { version = "1.44.2", features = ["full"] }
tracing = "0.1.41" tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"]} tracing-subscriber = { version = "0.3.19", features = ["env-filter"]}
sentry-tracing = "0.36.0" sentry-tracing = "0.42.0"
tower-http = { version = "0.6.2", features = ["trace"] } tower-http = { version = "0.6.2", features = ["trace"] }
axum = { version = "0.8.1", features = ["json"] } axum = { version = "0.8.1", features = ["json"] }
axum-extra = { version ="0.10.0", features = ["query"] } axum-extra = { version ="0.10.0", features = ["query"] }
axum-prometheus = "0.8.0" axum-prometheus = "0.9.0"
serde = { version = "1.0.219", features = ["derive"] } serde = { version = "1.0.219", features = ["derive"] }
serde_json = { version = "1.0.140", features = ["raw_value"] } serde_json = { version = "1.0.140", features = ["raw_value"] }
sentry = { version = "0.36.0", features = ["debug-images"] } sentry = { version = "0.42.0", features = ["debug-images"] }
meilisearch-sdk = "0.28.0" meilisearch-sdk = "0.29.1"
rand = "0.9.0" rand = "0.9.0"

View File

@@ -4,7 +4,7 @@ use serde::de::DeserializeOwned;
use crate::meilisearch::GetId; use crate::meilisearch::GetId;
pub async fn get_random_item<'a, T>(index: Index, filter: String) -> i32 pub async fn get_random_item<T>(index: Index, filter: String) -> i32
where where
T: DeserializeOwned + GetId + 'static + Send + Sync, T: DeserializeOwned + GetId + 'static + Send + Sync,
{ {
@@ -15,7 +15,7 @@ where
.await .await
.unwrap(); .unwrap();
let offset: usize = rand::thread_rng().gen_range(0..result.estimated_total_hits.unwrap()); let offset: usize = rand::rng().random_range(0..result.estimated_total_hits.unwrap());
let result = index let result = index
.search() .search()