mirror of
https://github.com/flibusta-apps/batch_downloader.git
synced 2025-12-06 14:25:36 +01:00
Compare commits
13 Commits
09d9f6b961
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f3d042d18 | |||
|
|
e7a6981b9e | ||
| 7473ef5814 | |||
| 1d58813c9f | |||
|
|
8a9fb48ceb | ||
| b21e4ff30d | |||
| 27b1d3b7d3 | |||
|
|
d79a91b8ff | ||
| ece17cea77 | |||
| c2ef4c6044 | |||
| a5f7c3e4db | |||
| 0dd8de8559 | |||
| 951247f92e |
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:
|
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/production.dockerfile
|
file: ./docker/production.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 }}?BATCH_DOWNLOADER_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: '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@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
|
||||||
56
.vscode/launch.json
vendored
56
.vscode/launch.json
vendored
@@ -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
1632
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
47
Cargo.toml
47
Cargo.toml
@@ -3,38 +3,51 @@ name = "batch_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.42.0", features = ["full"] }
|
tokio = { version = "1.44.1", features = ["full"] }
|
||||||
tokio-util = { version = "0.7.13", features = ["compat", "io"] }
|
tokio-util = { version = "0.7.14", features = ["compat", "io"] }
|
||||||
futures-core = "0.3.31"
|
futures-core = "0.3.31"
|
||||||
futures-util = "0.3.31"
|
futures-util = "0.3.31"
|
||||||
|
|
||||||
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.35.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.20.2"
|
once_cell = "1.21.1"
|
||||||
|
|
||||||
axum = { version = "0.8.1", features = ["multipart"] }
|
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 = { version = "1.0.219", features = ["derive"] }
|
||||||
serde_json = "1.0.134"
|
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"] }
|
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"
|
bytes = "1.10.1"
|
||||||
tempfile = "3.15.0"
|
tempfile = "3.19.1"
|
||||||
zip = "2.2.2"
|
zip = "4.6.0"
|
||||||
|
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
|
|
||||||
@@ -42,6 +55,6 @@ async-stream = "0.3.6"
|
|||||||
|
|
||||||
translit = "0.6.0"
|
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
21
LICENSE.md
Normal 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.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM rust:bullseye AS builder
|
FROM rust:bookworm AS builder
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y cmake \
|
&& apt-get install -y cmake \
|
||||||
@@ -11,7 +11,7 @@ COPY . .
|
|||||||
RUN cargo build --release --bin batch_downloader
|
RUN cargo build --release --bin batch_downloader
|
||||||
|
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y openssl ca-certificates curl jq \
|
&& apt-get install -y openssl ca-certificates curl jq \
|
||||||
|
|||||||
Reference in New Issue
Block a user