1
0

Version updates (#3626)

* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update zip in Labrinth

* Update itertools in Labrinth

* Update validator in labrinth

* Update thiserror in labrinth

* Update rust_decimal, redis, and deadpool-redis in labrinth

* Update totp-rs and spdx in labrinth

* Update maxminddb and tar in labrinth

* Update sentry and sentry-actix in labrinth

* Update image in labrinth

* Update lettre in labrinth

* Update derive-new and rust_iso3166 in labrinth

* Update async-stripe and json-patch in labrinth

* Update clap and iana-time-zone in labrinth

* Update labrinth to Rust 2024

* Cargo fmt

* Just do a full cargo update

* Update daedelus to Rust 2024

* Update daedelus_client to Rust 2024

* Set the formatting edition to 2024

* Fix formatting

IntelliJ messed up my formatting
This commit is contained in:
Josiah Glosson
2025-05-09 07:27:55 -05:00
committed by GitHub
parent 6e46317a37
commit 62de07e4e6
146 changed files with 1942 additions and 2311 deletions

View File

@@ -2,7 +2,7 @@
name = "daedalus_client"
version = "0.2.2"
authors = ["Jai A <jai@modrinth.com>"]
edition = "2021"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -15,25 +15,16 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde-xml-rs = "0.6.0"
lazy_static = "1.4.0"
thiserror = "1.0"
reqwest = { version = "0.12.5", default-features = false, features = [
"stream",
"json",
"rustls-tls-native-roots",
] }
thiserror = "2.0"
reqwest = { version = "0.12.15", default-features = false, features = ["stream", "json", "rustls-tls-native-roots"] }
async_zip = { version = "0.0.17", features = ["full"] }
chrono = { version = "0.4", features = ["serde"] }
bytes = "1.6.0"
rust-s3 = { version = "0.33.0", default-features = false, features = [
"fail-on-err",
"tags",
"tokio-rustls-tls",
"reqwest",
] }
dashmap = "5.5.3"
rust-s3 = { version = "0.35.1", default-features = false, features = ["fail-on-err", "tags", "tokio-rustls-tls"] }
dashmap = "6.1.0"
sha1_smol = { version = "1.0.0", features = ["std"] }
indexmap = { version = "2.2.6", features = ["serde"] }
itertools = "0.13.0"
itertools = "0.14.0"
tracing-error = "0.2.0"
tracing = "0.1"

View File

@@ -12,7 +12,9 @@ pub enum ErrorKind {
SerdeJSON(#[from] serde_json::Error),
#[error("Error while deserializing XML: {0}")]
SerdeXML(#[from] serde_xml_rs::Error),
#[error("Failed to validate file checksum at url {url} with hash {hash} after {tries} tries")]
#[error(
"Failed to validate file checksum at url {url} with hash {hash} after {tries} tries"
)]
ChecksumFailure {
hash: String,
url: String,

View File

@@ -1,6 +1,6 @@
use crate::util::{download_file, fetch_json, format_url};
use crate::{insert_mirrored_artifact, Error, MirrorArtifact, UploadFile};
use daedalus::modded::{Manifest, PartialVersionInfo, DUMMY_REPLACE_STRING};
use crate::{Error, MirrorArtifact, UploadFile, insert_mirrored_artifact};
use daedalus::modded::{DUMMY_REPLACE_STRING, Manifest, PartialVersionInfo};
use dashmap::DashMap;
use serde::Deserialize;
use std::sync::Arc;
@@ -169,10 +169,11 @@ async fn fetch(
insert_mirrored_artifact(
&new_name,
None,
vec![lib
.url
.clone()
.unwrap_or_else(|| maven_url.to_string())],
vec![
lib.url
.clone()
.unwrap_or_else(|| maven_url.to_string()),
],
false,
mirror_artifacts,
)?;

View File

@@ -1,5 +1,5 @@
use crate::util::{download_file, fetch_json, fetch_xml, format_url};
use crate::{insert_mirrored_artifact, Error, MirrorArtifact, UploadFile};
use crate::{Error, MirrorArtifact, UploadFile, insert_mirrored_artifact};
use chrono::{DateTime, Utc};
use daedalus::get_path_from_artifact;
use daedalus::modded::PartialVersionInfo;
@@ -7,8 +7,8 @@ use dashmap::DashMap;
use futures::io::Cursor;
use indexmap::IndexMap;
use itertools::Itertools;
use serde::de::DeserializeOwned;
use serde::Deserialize;
use serde::de::DeserializeOwned;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::Semaphore;
@@ -589,14 +589,16 @@ async fn fetch(
mod_loader: &str,
version: &ForgeVersion,
) -> Result<String, Error> {
let extract_file =
read_file(zip, &value[1..value.len()])
.await?
.ok_or_else(|| {
crate::ErrorKind::InvalidInput(format!(
let extract_file = read_file(
zip,
&value[1..value.len()],
)
.await?
.ok_or_else(|| {
crate::ErrorKind::InvalidInput(format!(
"Unable reading data key {key} at path {value}",
))
})?;
})?;
let file_name = value.split('/').next_back()
.ok_or_else(|| {
@@ -622,10 +624,7 @@ async fn fetch(
let path = format!(
"com.modrinth.daedalus:{}-installer-extracts:{}:{}@{}",
mod_loader,
version.raw,
file_name,
ext
mod_loader, version.raw, file_name, ext
);
upload_files.insert(
@@ -753,7 +752,8 @@ async fn fetch(
.rev()
.chunk_by(|x| x.game_version.clone())
.into_iter()
.map(|(game_version, loaders)| daedalus::modded::Version {
.map(|(game_version, loaders)| {
daedalus::modded::Version {
id: game_version,
stable: true,
loaders: loaders
@@ -766,6 +766,7 @@ async fn fetch(
stable: false,
})
.collect(),
}
})
.collect(),
};

View File

@@ -1,13 +1,13 @@
use crate::util::{
format_url, upload_file_to_bucket, upload_url_to_bucket_mirrors,
REQWEST_CLIENT,
REQWEST_CLIENT, format_url, upload_file_to_bucket,
upload_url_to_bucket_mirrors,
};
use daedalus::get_path_from_artifact;
use dashmap::{DashMap, DashSet};
use std::sync::Arc;
use tokio::sync::Semaphore;
use tracing_error::ErrorLayer;
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
mod error;
mod fabric;

View File

@@ -1,11 +1,11 @@
use crate::util::fetch_json;
use crate::{
util::download_file, util::format_url, util::sha1_async, Error,
MirrorArtifact, UploadFile,
Error, MirrorArtifact, UploadFile, util::download_file, util::format_url,
util::sha1_async,
};
use daedalus::minecraft::{
merge_partial_library, Library, PartialLibrary, VersionInfo,
VersionManifest, VERSION_MANIFEST_URL,
Library, PartialLibrary, VERSION_MANIFEST_URL, VersionInfo,
VersionManifest, merge_partial_library,
};
use dashmap::DashMap;
use serde::Deserialize;

View File

@@ -7,7 +7,7 @@ use std::sync::Arc;
use tokio::sync::Semaphore;
lazy_static::lazy_static! {
static ref BUCKET : Bucket = {
static ref BUCKET: Bucket = {
let region = dotenvy::var("S3_REGION").unwrap();
let b = Bucket::new(
&dotenvy::var("S3_BUCKET_NAME").unwrap(),
@@ -31,9 +31,9 @@ lazy_static::lazy_static! {
).unwrap();
if region == "path-style" {
b.with_path_style()
*b.with_path_style()
} else {
b
*b
}
};
}
@@ -203,7 +203,7 @@ pub async fn download_file(
inner: err,
item: url.to_string(),
}
.into())
.into());
}
}
}