Compare commits

..

No commits in common. "main" and "v1.1.0" have entirely different histories.
main ... v1.1.0

6 changed files with 18 additions and 17 deletions

View File

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

12
Cargo.lock generated
View File

@ -646,9 +646,9 @@ checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]]
name = "log"
version = "0.4.25"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "mastodon-image-uploader-bot"
@ -1201,9 +1201,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.43.0"
version = "1.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
dependencies = [
"backtrace",
"bytes",
@ -1217,9 +1217,9 @@ dependencies = [
[[package]]
name = "tokio-macros"
version = "2.5.0"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"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
[dependencies]
tokio = { version = "=1.43.0", features = ["macros", "rt-multi-thread"] }
tokio = { version = "=1.42.0", features = ["macros", "rt-multi-thread"] }
reqwest = { version = "=0.12.12", features = ["json", "multipart", "stream"] }
serde = { version = "=1.0.217", features = ["derive"] }
toml = "=0.8.19"
log = "=0.4.25"
log = "=0.4.22"
stderrlog = "=0.6.0"

View File

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

View File

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

View File

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