Compare commits

...

14 Commits

Author SHA1 Message Date
dependabot[bot]
578ab6f8a3 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 01:05:27 +00:00
5f3d042d18 Merge pull request #9 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:57 +02:00
dependabot[bot]
e7a6981b9e 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 01:06:54 +00:00
7473ef5814 Merge pull request #8 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:04:03 +02:00
1d58813c9f 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 13:52:51 +02:00
dependabot[bot]
8a9fb48ceb 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 01:37:32 +00:00
b21e4ff30d 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:29:11 +02:00
27b1d3b7d3 Merge pull request #7 from flibusta-apps/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-17 23:14:13 +02:00
dependabot[bot]
d79a91b8ff 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 10:03:10 +00:00
ece17cea77 Optimize release build
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-06-28 22:33:53 +02:00
c2ef4c6044 Update deps 2025-06-28 22:10:50 +02:00
a5f7c3e4db Update dependencies and improve Docker image tagging
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 a query
parameter to deployment webhook
2025-06-21 21:57:55 +02:00
0dd8de8559 Add LICENSE
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-03-27 22:40:57 +01:00
951247f92e Update deps
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
2025-03-23 13:25:08 +01:00
7 changed files with 1157 additions and 681 deletions

View File

@@ -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/production.dockerfile
-
name: Invoke deployment hook
- name: Invoke deployment hook
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
url: ${{ secrets.WEBHOOK_URL }}?BATCH_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: '44 5 * * 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

56
.vscode/launch.json vendored
View File

@@ -1,56 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'batch_downloader'",
"cargo": {
"args": [
"build",
"--bin=batch_downloader",
"--package=batch_downloader"
],
"filter": {
"name": "batch_downloader",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}",
"env": {
"API_KEY": "debug",
"MINIO_HOST": "minio.kurbezz.ru:9000",
"MINIO_BUCKET": "book.archives",
"MINIO_ACCESS_KEY": "SAYRdiuaMvc3gjtxGZRm",
"MINIO_SECRET_KEY": "MUwBZs80J8rzKKJvp9Iv4tLBfyxakH7MkrgHiWc1",
"LIBRARY_API_KEY": "v3TGJxquSX8qg42EdeatASJddrSDcPdK",
"LIBRARY_URL": "https://book-library.kurbezz.ru",
"CACHE_API_KEY": "kGaA6feem7Nz5ZuRQDp6L8pdwEdnCAKH",
"CACHE_URL": "https://book-channel-cache.kurbezz.ru",
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'batch_downloader'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=batch_downloader",
"--package=batch_downloader"
],
"filter": {
"name": "batch_downloader",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

1632
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,38 +3,51 @@ name = "batch_downloader"
version = "0.1.0"
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]
tokio = { version = "1.42.0", features = ["full"] }
tokio-util = { version = "0.7.13", features = ["compat", "io"] }
tokio = { version = "1.44.1", features = ["full"] }
tokio-util = { version = "0.7.14", features = ["compat", "io"] }
futures-core = "0.3.31"
futures-util = "0.3.31"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"]}
sentry-tracing = "0.35.0"
sentry-tracing = "0.42.0"
tower-http = { version = "0.6.2", features = ["trace"] }
once_cell = "1.20.2"
once_cell = "1.21.1"
axum = { version = "0.8.1", features = ["multipart"] }
axum-prometheus = "0.8.0"
axum-prometheus = "0.9.0"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
moka = { version = "0.12.9", features = ["future"] }
moka = { version = "0.12.10", features = ["future"] }
md5 = "0.7.0"
md5 = "0.8.0"
smallvec = { version = "1.13.2", features = ["serde"] }
smallvec = { version = "1.14.0", features = ["serde"] }
smartstring = { version = "1.0.1", features = ["serde"] }
reqwest = { version = "0.12.12", features = ["json", "stream", "multipart"] }
reqwest = { version = "0.12.15", features = ["json", "stream", "multipart"] }
bytes = "1.9.0"
tempfile = "3.15.0"
zip = "2.2.2"
bytes = "1.10.1"
tempfile = "3.19.1"
zip = "4.6.0"
base64 = "0.22.1"
@@ -42,6 +55,6 @@ async-stream = "0.3.6"
translit = "0.6.0"
sentry = { version = "0.35.0", features = ["debug-images"] }
sentry = { version = "0.42.0", features = ["debug-images"] }
chrono = "0.4.39"
chrono = "0.4.40"

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 kurbezz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,4 +1,4 @@
FROM rust:bullseye AS builder
FROM rust:bookworm AS builder
RUN apt-get update \
&& apt-get install -y cmake \
@@ -11,7 +11,7 @@ COPY . .
RUN cargo build --release --bin batch_downloader
FROM debian:bullseye-slim
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y openssl ca-certificates curl jq \