Compare commits

...

14 Commits
v1.1.0 ... main

Author SHA1 Message Date
Renovate Bot 926959fa7e chore(deps): update docker/build-push-action digest to ca877d9
Build image / build (pull_request) Successful in 25m17s Details
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m20s Details
2025-01-24 10:01:17 +00:00
bizcochito 94e3f53d19 Merge pull request 'chore(deps): update docker/build-push-action digest to 67a2d40' (#36) from renovate/docker-build-push-action-digest into main
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m24s Details
Reviewed-on: #36
2025-01-15 19:39:05 +00:00
Renovate Bot e83b20081b chore(deps): update docker/build-push-action digest to 67a2d40
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m24s Details
Build image / build (pull_request) Successful in 25m25s Details
2025-01-15 13:01:02 +00:00
Renovate Bot 3a7a39d170 fix(deps): update rust crate log to v0.4.25
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m31s Details
2025-01-14 12:03:01 +00:00
bizcochito 22e2dd92e6 chore: Uptade renovate.json
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m20s Details
2025-01-12 13:28:20 +00:00
bizcochito cffc5e04e0 Merge pull request 'fix(deps): update rust crate log to v0.4.24' (#34) from renovate/log-0.x into main
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m14s Details
Reviewed-on: #34
2025-01-11 09:09:54 +00:00
Renovate Bot 1a384cfdfe fix(deps): update rust crate log to v0.4.24
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m35s Details
2025-01-10 23:02:55 +00:00
bizcochito 27f0b1bfe6 Merge pull request 'chore(deps): update rust docker tag to v1.84.0' (#33) from renovate/rust-1.x into main
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m30s Details
Reviewed-on: #33
2025-01-10 06:45:31 +00:00
Renovate Bot a2aa2654ff chore(deps): update rust docker tag to v1.84.0
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m40s Details
2025-01-10 01:01:20 +00:00
bizcochito d50c1d7e61 Merge pull request 'chore(deps): update docker/build-push-action digest to b32b51a' (#31) from renovate/docker-build-push-action-digest into main
Unit Tests with docker compose and cargo / unit-test (push) Successful in 1m26s Details
Reviewed-on: #31
2025-01-09 17:57:52 +00:00
bizcochito 9aa7be030a Merge pull request 'fix(deps): update rust crate tokio to v1.43.0' (#32) from renovate/tokio-1.x into main
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m7s Details
Reviewed-on: #32
2025-01-09 16:40:25 +00:00
Renovate Bot f4e463abc1 fix(deps): update rust crate tokio to v1.43.0
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m14s Details
2025-01-08 16:03:26 +00:00
Renovate Bot 5d91a9979e chore(deps): update docker/build-push-action digest to b32b51a
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m42s Details
Build image / build (pull_request) Successful in 23m49s Details
2025-01-08 10:01:37 +00:00
Alie 9b9ddc1d42 cleanup comments
Unit Tests with docker compose and cargo / unit-test (push) Successful in 2m19s Details
2025-01-07 17:16:50 +01:00
6 changed files with 17 additions and 18 deletions

View File

@ -43,7 +43,7 @@ jobs:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }} password: ${{ secrets.DOCKER_PASS }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6 uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
with: with:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
context: . context: .

12
Cargo.lock generated
View File

@ -646,9 +646,9 @@ checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.22" version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]] [[package]]
name = "mastodon-image-uploader-bot" name = "mastodon-image-uploader-bot"
@ -1201,9 +1201,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.42.0" version = "1.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -1217,9 +1217,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.4.0" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -6,9 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
tokio = { version = "=1.42.0", features = ["macros", "rt-multi-thread"] } tokio = { version = "=1.43.0", features = ["macros", "rt-multi-thread"] }
reqwest = { version = "=0.12.12", features = ["json", "multipart", "stream"] } reqwest = { version = "=0.12.12", features = ["json", "multipart", "stream"] }
serde = { version = "=1.0.217", features = ["derive"] } serde = { version = "=1.0.217", features = ["derive"] }
toml = "=0.8.19" toml = "=0.8.19"
log = "=0.4.22" log = "=0.4.25"
stderrlog = "=0.6.0" stderrlog = "=0.6.0"

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM rust:1.83.0-slim-bullseye AS deps FROM rust:1.84.0-slim-bullseye AS deps
RUN apt update && apt install pkg-config ca-certificates openssl libssl-dev -y RUN apt update && apt install pkg-config ca-certificates openssl libssl-dev -y
WORKDIR /app WORKDIR /app
COPY Cargo.toml Cargo.toml COPY Cargo.toml Cargo.toml

View File

@ -1,5 +1,6 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", "helpers:pinGitHubActionDigests"], "extends": ["config:recommended", "helpers:pinGitHubActionDigests"],
"rangeStrategy": "pin" "rangeStrategy": "pin",
"automerge": true
} }

View File

@ -65,7 +65,7 @@ struct Errors {
retry: u8, retry: u8,
} }
#[tokio::main] // requires `features = ["mt"] #[tokio::main]
async fn main() -> DynResult<()> { async fn main() -> DynResult<()> {
stderrlog::new() stderrlog::new()
.module(module_path!()) .module(module_path!())
@ -175,8 +175,8 @@ fn generate_config() -> DynResult<()> {
} }
fn parse_config(filename: &str) -> DynResult<Config> { fn parse_config(filename: &str) -> DynResult<Config> {
let toml_file = std::fs::read_to_string(filename)?; //.expect("No config file, consider getting the original one and modifing it"); let toml_file = std::fs::read_to_string(filename)?;
Ok(toml::from_str(&toml_file)?) //("Malformed config file, check the original one for reference") Ok(toml::from_str(&toml_file)?)
} }
async fn get_next_url(config: &Config) -> DynResult<Option<Image>> { async fn get_next_url(config: &Config) -> DynResult<Option<Image>> {
@ -384,8 +384,8 @@ async fn register(client: &Client, config: &Config) {
} }
fn parse_mastodon_data(filename: &str) -> DynResult<MastodonData> { fn parse_mastodon_data(filename: &str) -> DynResult<MastodonData> {
let toml_file = std::fs::read_to_string(filename)?; //.expect("No config file, consider getting the original one and modifing it"); let toml_file = std::fs::read_to_string(filename)?;
Ok(toml::from_str(&toml_file)?) //("Malformed config file, check the original one for reference") Ok(toml::from_str(&toml_file)?)
} }
#[derive(Deserialize)] #[derive(Deserialize)]
@ -598,7 +598,6 @@ mod tests {
const IMAGE: &str = "https://picsum.photos/id/1"; const IMAGE: &str = "https://picsum.photos/id/1";
let expected = insert_image(&config, IMAGE).await.unwrap(); let expected = insert_image(&config, IMAGE).await.unwrap();
// Get test url
let image = get_next_url(&config).await.unwrap().unwrap(); let image = get_next_url(&config).await.unwrap().unwrap();
assert_eq!(image.url, IMAGE); assert_eq!(image.url, IMAGE);
@ -613,7 +612,6 @@ mod tests {
let image = image.image; let image = image.image;
assert_eq!(image.status, "consumed"); assert_eq!(image.status, "consumed");
// Test that now it does not get it
let image = get_next_url(&config).await.unwrap(); let image = get_next_url(&config).await.unwrap();
assert_eq!(image, None); assert_eq!(image, None);
} }