Compare commits

...

17 Commits

Author SHA1 Message Date
dependabot[bot]
27ffb3cfa1 Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [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/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 07:05:00 +00:00
3e0fe9849c Merge pull request #36 from flibusta-apps/dependabot/github_actions/github/codeql-action-4
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 github/codeql-action from 3 to 4
2025-10-14 18:01:18 +02:00
f8d9a50a66 Remove unnecessary lifetime param and simplify error handling 2025-10-14 18:01:00 +02:00
dependabot[bot]
d83c63e25a 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 07:04:38 +00:00
6fa0f491fa Merge pull request #34 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:07:24 +02:00
61e502c02b 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:04:46 +02:00
dependabot[bot]
aacfcf2eae 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-18 10:47:39 +00:00
becd419ddb Create rust-clippy.yml
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-17 23:37:38 +02:00
8dd9f9cf99 Merge pull request #32 from flibusta-apps/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-17 23:18:37 +02:00
3afa22945b Merge pull request #33 from flibusta-apps/dependabot/cargo/slab-0.4.11
Bump slab from 0.4.10 to 0.4.11
2025-08-17 23:14:42 +02:00
dependabot[bot]
f1125531dc 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-13 04:37:24 +00:00
dependabot[bot]
1d5935186d 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 14:14:03 +00:00
c24fc6a1db Optimize release build
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-06-28 22:35:27 +02:00
eb0c3a8b4e Update deps 2025-06-28 22:13:21 +02:00
7208f6cca9 Update dependencies and improve Docker image build workflow
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
- Update Rust dependencies in Cargo.lock to latest versions - Tag Docker
images with both :latest and commit SHA - Pass commit SHA as
BOOK_DOWNLOADER_TAG to deployment webhook - Minor YAML formatting
improvements in GitHub Actions workflow
2025-06-21 22:18:40 +02:00
c6576eca32 Merge pull request #31 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:54:37 +02:00
dependabot[bot]
b2ef2e843b 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:09:45 +00:00
6 changed files with 928 additions and 609 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@v6
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_DOWNLOADER_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: '42 0 * * 6'
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

1430
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,17 +3,30 @@ name = "books_downloader"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[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]
tokio = { version = "1.44.1", features = ["full"] } tokio = { version = "1.44.2", features = ["full"] }
tokio-util = { version = "0.7.14", features = ["compat"] } tokio-util = { version = "0.7.14", features = ["compat"] }
futures = "0.3.31" futures = "0.3.31"
reqwest = { version = "0.12.15", features = ["json", "stream", "multipart"] } reqwest = { version = "0.12.15", features = ["json", "stream", "multipart"] }
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"] }
once_cell = "1.21.1" once_cell = "1.21.1"
@@ -22,11 +35,11 @@ serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140" serde_json = "1.0.140"
axum = "0.8.1" axum = "0.8.1"
translit = "0.6.0" translit = "0.6.0"
zip = "2.4.2" zip = "4.2.0"
tempfile = "3.19.1" tempfile = "3.19.1"
bytes = "1.10.1" bytes = "1.10.1"
axum-prometheus = "0.8.0" axum-prometheus = "0.9.0"
base64 = "0.22.1" base64 = "0.22.1"
sentry = { version = "0.36.0", features = ["debug-images"] } sentry = { version = "0.42.0", features = ["debug-images"] }
dotenvy = "0.15.7" dotenvy = "0.15.7"

View File

@@ -74,7 +74,7 @@ pub async fn download<'a>(
Some((response, is_zip)) Some((response, is_zip))
} }
pub async fn download_chain<'a>( pub async fn download_chain(
book: BookWithRemote, book: BookWithRemote,
file_type: String, file_type: String,
source_config: config::SourceConfig, source_config: config::SourceConfig,

View File

@@ -20,7 +20,7 @@ pub struct DownloadResult {
pub fn get_response_async_read(it: Response) -> impl AsyncRead { pub fn get_response_async_read(it: Response) -> impl AsyncRead {
it.bytes_stream() it.bytes_stream()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)) .map_err(std::io::Error::other)
.into_async_read() .into_async_read()
.compat() .compat()
} }