mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 07:05:36 +01:00
Compare commits
16 Commits
684f4e3e52
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0b169a105 | ||
| c39a39a889 | |||
| b1c9f2ccf8 | |||
|
|
b4b0a10ce7 | ||
| 8e4c3303f2 | |||
| 56487b36b6 | |||
|
|
534bcda47b | ||
| 353e142d4d | |||
| 42596ac3e6 | |||
|
|
a40f92a666 | ||
| e837436077 | |||
|
|
6484b622ff | ||
| dc16bc7eb4 | |||
| 5b24d28ef0 | |||
| d9bbcc947f | |||
| 0642f14d4e |
23
.github/workflows/build_docker_image.yml
vendored
23
.github/workflows/build_docker_image.yml
vendored
@@ -3,18 +3,16 @@ name: Build docker image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
Build-Docker-Image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- id: repository_name
|
||||
@@ -22,16 +20,14 @@ jobs:
|
||||
with:
|
||||
string: ${{ github.repository }}
|
||||
|
||||
-
|
||||
name: Login to ghcr.io
|
||||
- name: Login to ghcr.io
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
-
|
||||
name: Build and push
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v6
|
||||
env:
|
||||
@@ -39,12 +35,11 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: ghcr.io/${{ env.IMAGE }}:latest
|
||||
tags: ghcr.io/${{ env.IMAGE }}:latest,ghcr.io/${{ env.IMAGE }}:${{ github.sha }}
|
||||
context: .
|
||||
file: ./docker/build.dockerfile
|
||||
|
||||
-
|
||||
name: Invoke deployment hook
|
||||
- name: Invoke deployment hook
|
||||
uses: joelwmale/webhook-action@master
|
||||
with:
|
||||
url: ${{ secrets.WEBHOOK_URL }}
|
||||
url: ${{ secrets.WEBHOOK_URL }}?BOOK_SERVER_TAG=${{ github.sha }}
|
||||
|
||||
55
.github/workflows/rust-clippy.yml
vendored
Normal file
55
.github/workflows/rust-clippy.yml
vendored
Normal 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@v6
|
||||
|
||||
- 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
1553
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
22
Cargo.toml
22
Cargo.toml
@@ -4,6 +4,20 @@ version = "0.1.0"
|
||||
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]
|
||||
once_cell = "1.21.1"
|
||||
|
||||
@@ -11,18 +25,18 @@ tokio = { version = "1.44.2", features = ["full"] }
|
||||
|
||||
tracing = "0.1.41"
|
||||
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"] }
|
||||
|
||||
axum = { version = "0.8.1", features = ["json"] }
|
||||
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_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"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde::de::DeserializeOwned;
|
||||
|
||||
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
|
||||
T: DeserializeOwned + GetId + 'static + Send + Sync,
|
||||
{
|
||||
@@ -15,7 +15,7 @@ where
|
||||
.await
|
||||
.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
|
||||
.search()
|
||||
|
||||
Reference in New Issue
Block a user