Skip to content

Commit 62de07e

Browse files
authored
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
1 parent 6e46317 commit 62de07e

File tree

146 files changed

+1935
-2304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1935
-2304
lines changed

Cargo.lock

Lines changed: 1375 additions & 1834 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ uuid = { version = "1.1", features = ["serde", "v4"] }
3939
tracing = "0.1.37"
4040
tracing-error = "0.2.0"
4141

42-
dashmap = "6.0.1"
42+
dashmap = "6.1.0"
4343
paste = "1.0.15"
4444
enumset = { version = "1.1", features = ["serde"] }
4545

apps/daedalus_client/Cargo.toml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "daedalus_client"
33
version = "0.2.2"
44
authors = ["Jai A <jai@modrinth.com>"]
5-
edition = "2021"
5+
edition = "2024"
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

@@ -15,25 +15,16 @@ serde = { version = "1.0", features = ["derive"] }
1515
serde_json = "1.0"
1616
serde-xml-rs = "0.6.0"
1717
lazy_static = "1.4.0"
18-
thiserror = "1.0"
19-
reqwest = { version = "0.12.5", default-features = false, features = [
20-
"stream",
21-
"json",
22-
"rustls-tls-native-roots",
23-
] }
18+
thiserror = "2.0"
19+
reqwest = { version = "0.12.15", default-features = false, features = ["stream", "json", "rustls-tls-native-roots"] }
2420
async_zip = { version = "0.0.17", features = ["full"] }
2521
chrono = { version = "0.4", features = ["serde"] }
2622
bytes = "1.6.0"
27-
rust-s3 = { version = "0.33.0", default-features = false, features = [
28-
"fail-on-err",
29-
"tags",
30-
"tokio-rustls-tls",
31-
"reqwest",
32-
] }
33-
dashmap = "5.5.3"
23+
rust-s3 = { version = "0.35.1", default-features = false, features = ["fail-on-err", "tags", "tokio-rustls-tls"] }
24+
dashmap = "6.1.0"
3425
sha1_smol = { version = "1.0.0", features = ["std"] }
3526
indexmap = { version = "2.2.6", features = ["serde"] }
36-
itertools = "0.13.0"
27+
itertools = "0.14.0"
3728
tracing-error = "0.2.0"
3829

3930
tracing = "0.1"

apps/daedalus_client/src/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ pub enum ErrorKind {
1212
SerdeJSON(#[from] serde_json::Error),
1313
#[error("Error while deserializing XML: {0}")]
1414
SerdeXML(#[from] serde_xml_rs::Error),
15-
#[error("Failed to validate file checksum at url {url} with hash {hash} after {tries} tries")]
15+
#[error(
16+
"Failed to validate file checksum at url {url} with hash {hash} after {tries} tries"
17+
)]
1618
ChecksumFailure {
1719
hash: String,
1820
url: String,

apps/daedalus_client/src/fabric.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::util::{download_file, fetch_json, format_url};
2-
use crate::{insert_mirrored_artifact, Error, MirrorArtifact, UploadFile};
3-
use daedalus::modded::{Manifest, PartialVersionInfo, DUMMY_REPLACE_STRING};
2+
use crate::{Error, MirrorArtifact, UploadFile, insert_mirrored_artifact};
3+
use daedalus::modded::{DUMMY_REPLACE_STRING, Manifest, PartialVersionInfo};
44
use dashmap::DashMap;
55
use serde::Deserialize;
66
use std::sync::Arc;
@@ -169,10 +169,11 @@ async fn fetch(
169169
insert_mirrored_artifact(
170170
&new_name,
171171
None,
172-
vec![lib
173-
.url
174-
.clone()
175-
.unwrap_or_else(|| maven_url.to_string())],
172+
vec![
173+
lib.url
174+
.clone()
175+
.unwrap_or_else(|| maven_url.to_string()),
176+
],
176177
false,
177178
mirror_artifacts,
178179
)?;

apps/daedalus_client/src/forge.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use crate::util::{download_file, fetch_json, fetch_xml, format_url};
2-
use crate::{insert_mirrored_artifact, Error, MirrorArtifact, UploadFile};
2+
use crate::{Error, MirrorArtifact, UploadFile, insert_mirrored_artifact};
33
use chrono::{DateTime, Utc};
44
use daedalus::get_path_from_artifact;
55
use daedalus::modded::PartialVersionInfo;
66
use dashmap::DashMap;
77
use futures::io::Cursor;
88
use indexmap::IndexMap;
99
use itertools::Itertools;
10-
use serde::de::DeserializeOwned;
1110
use serde::Deserialize;
11+
use serde::de::DeserializeOwned;
1212
use std::collections::HashMap;
1313
use std::sync::Arc;
1414
use tokio::sync::Semaphore;
@@ -589,14 +589,16 @@ async fn fetch(
589589
mod_loader: &str,
590590
version: &ForgeVersion,
591591
) -> Result<String, Error> {
592-
let extract_file =
593-
read_file(zip, &value[1..value.len()])
594-
.await?
595-
.ok_or_else(|| {
596-
crate::ErrorKind::InvalidInput(format!(
592+
let extract_file = read_file(
593+
zip,
594+
&value[1..value.len()],
595+
)
596+
.await?
597+
.ok_or_else(|| {
598+
crate::ErrorKind::InvalidInput(format!(
597599
"Unable reading data key {key} at path {value}",
598600
))
599-
})?;
601+
})?;
600602

601603
let file_name = value.split('/').next_back()
602604
.ok_or_else(|| {
@@ -622,10 +624,7 @@ async fn fetch(
622624

623625
let path = format!(
624626
"com.modrinth.daedalus:{}-installer-extracts:{}:{}@{}",
625-
mod_loader,
626-
version.raw,
627-
file_name,
628-
ext
627+
mod_loader, version.raw, file_name, ext
629628
);
630629

631630
upload_files.insert(
@@ -753,7 +752,8 @@ async fn fetch(
753752
.rev()
754753
.chunk_by(|x| x.game_version.clone())
755754
.into_iter()
756-
.map(|(game_version, loaders)| daedalus::modded::Version {
755+
.map(|(game_version, loaders)| {
756+
daedalus::modded::Version {
757757
id: game_version,
758758
stable: true,
759759
loaders: loaders
@@ -766,6 +766,7 @@ async fn fetch(
766766
stable: false,
767767
})
768768
.collect(),
769+
}
769770
})
770771
.collect(),
771772
};

apps/daedalus_client/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use crate::util::{
2-
format_url, upload_file_to_bucket, upload_url_to_bucket_mirrors,
3-
REQWEST_CLIENT,
2+
REQWEST_CLIENT, format_url, upload_file_to_bucket,
3+
upload_url_to_bucket_mirrors,
44
};
55
use daedalus::get_path_from_artifact;
66
use dashmap::{DashMap, DashSet};
77
use std::sync::Arc;
88
use tokio::sync::Semaphore;
99
use tracing_error::ErrorLayer;
10-
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
10+
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
1111

1212
mod error;
1313
mod fabric;

apps/daedalus_client/src/minecraft.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::util::fetch_json;
22
use crate::{
3-
util::download_file, util::format_url, util::sha1_async, Error,
4-
MirrorArtifact, UploadFile,
3+
Error, MirrorArtifact, UploadFile, util::download_file, util::format_url,
4+
util::sha1_async,
55
};
66
use daedalus::minecraft::{
7-
merge_partial_library, Library, PartialLibrary, VersionInfo,
8-
VersionManifest, VERSION_MANIFEST_URL,
7+
Library, PartialLibrary, VERSION_MANIFEST_URL, VersionInfo,
8+
VersionManifest, merge_partial_library,
99
};
1010
use dashmap::DashMap;
1111
use serde::Deserialize;

apps/daedalus_client/src/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use tokio::sync::Semaphore;
88

99
lazy_static::lazy_static! {
10-
static ref BUCKET : Bucket = {
10+
static ref BUCKET: Bucket = {
1111
let region = dotenvy::var("S3_REGION").unwrap();
1212
let b = Bucket::new(
1313
&dotenvy::var("S3_BUCKET_NAME").unwrap(),
@@ -31,9 +31,9 @@ lazy_static::lazy_static! {
3131
).unwrap();
3232

3333
if region == "path-style" {
34-
b.with_path_style()
34+
*b.with_path_style()
3535
} else {
36-
b
36+
*b
3737
}
3838
};
3939
}
@@ -203,7 +203,7 @@ pub async fn download_file(
203203
inner: err,
204204
item: url.to_string(),
205205
}
206-
.into())
206+
.into());
207207
}
208208
}
209209
}

apps/labrinth/Cargo.toml

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "labrinth"
33
version = "2.7.0"
44
authors = ["geometrically <jai@modrinth.com>"]
5-
edition = "2018"
5+
edition = "2024"
66
license = "AGPL-3.0"
77

88
# This seems redundant, but it's necessary for Docker to work
@@ -11,17 +11,17 @@ name = "labrinth"
1111
path = "src/main.rs"
1212

1313
[dependencies]
14-
actix-web = "4.4.1"
14+
actix-web = "4.10.2"
1515
actix-rt = "2.9.0"
16-
actix-multipart = "0.6.1"
17-
actix-cors = "0.7.0"
16+
actix-multipart = "0.7.2"
17+
actix-cors = "0.7.1"
1818
actix-ws = "0.3.0"
1919
actix-files = "0.6.5"
20-
prometheus = "0.13.4"
20+
prometheus = "0.13.4" # Locked on 0.13 until actix updates to 0.14
2121
actix-web-prom = { version = "0.9.0", features = ["process"] }
2222

2323
tracing = "0.1.41"
24-
tracing-actix-web = "0.7.16"
24+
tracing-actix-web = "0.7.18"
2525
console-subscriber = "0.4.1"
2626

2727
tokio = { version = "1.35.1", features = ["sync", "rt-multi-thread"] }
@@ -30,14 +30,15 @@ tokio-stream = "0.1.14"
3030
futures = "0.3.30"
3131
futures-util = "0.3.30"
3232
async-trait = "0.1.70"
33-
dashmap = "5.4.0"
33+
dashmap = "6.1.0"
3434
lazy_static = "1.4.0"
3535

36-
meilisearch-sdk = "0.27.1"
37-
rust-s3 = "0.33.0"
38-
reqwest = { version = "0.11.18", features = ["json", "multipart"] }
39-
hyper = { version = "0.14", features = ["full"] }
40-
hyper-tls = "0.5.0"
36+
meilisearch-sdk = "0.28.0"
37+
rust-s3 = { version = "0.35.1", default-features = false, features = ["fail-on-err", "tags", "tokio-rustls-tls"] }
38+
reqwest = { version = "0.12.15", features = ["json", "multipart"] }
39+
hyper = { version = "1.6", features = ["full"] }
40+
hyper-tls = "0.6.0"
41+
hyper-util = "0.1.11"
4142

4243
serde = { version = "1.0", features = ["derive"] }
4344
serde_json = "1.0"
@@ -46,34 +47,34 @@ chrono = { version = "0.4.26", features = ["serde"] }
4647
yaserde = "0.12.0"
4748
yaserde_derive = "0.12.0"
4849

49-
rand = "0.8.5"
50-
rand_chacha = "0.3.1"
50+
rand = "0.8.5" # Locked on 0.8 until argon2 updates to 0.9
51+
rand_chacha = "0.3.1" # Locked on 0.3 until we can update rand to 0.9
5152
bytes = "1.4.0"
52-
base64 = "0.21.7"
53-
sha1 = { version = "0.6.1", features = ["std"] }
54-
sha2 = "0.9.9"
55-
hmac = "0.11.0"
53+
base64 = "0.22.1"
54+
sha1 = { version = "0.10.6", features = ["std"] }
55+
sha2 = "0.10.9"
56+
hmac = "0.12.1"
5657
argon2 = { version = "0.5.0", features = ["std"] }
5758
murmur2 = "0.1.0"
5859
bitflags = "2.4.0"
5960
hex = "0.4.3"
60-
zxcvbn = "2.2.2"
61+
zxcvbn = "3.1.0"
6162
totp-rs = { version = "5.0.2", features = ["gen_secret"] }
6263

6364
url = "2.4.0"
6465
urlencoding = "2.1.2"
6566

66-
zip = "0.6.6"
67+
zip = "2.6.1"
6768

68-
itertools = "0.12.0"
69+
itertools = "0.14.0"
6970

70-
validator = { version = "0.16.1", features = ["derive", "phone"] }
71+
validator = { version = "0.20.0", features = ["derive"] }
7172
regex = "1.10.2"
7273
censor = "0.3.0"
7374
spdx = { version = "0.10.3", features = ["text"] }
7475

7576
dotenvy = "0.15.7"
76-
thiserror = "1.0.56"
77+
thiserror = "2.0.12"
7778
either = "1.13"
7879

7980
sqlx = { version = "0.8.2", features = [
@@ -89,39 +90,32 @@ rust_decimal = { version = "1.33.1", features = [
8990
"serde-with-float",
9091
"serde-with-str",
9192
] }
92-
redis = { version = "0.27.5", features = ["tokio-comp", "ahash", "r2d2"] }
93-
deadpool-redis = "0.18.0"
94-
clickhouse = { version = "0.11.2", features = ["uuid", "time"] }
93+
redis = { version = "0.29.5", features = ["tokio-comp", "ahash", "r2d2"] } # Locked on 0.29 until deadpool-redis updates to 0.30
94+
deadpool-redis = "0.20.0"
95+
clickhouse = { version = "0.13.2", features = ["uuid", "time"] }
9596
uuid = { version = "1.2.2", features = ["v4", "fast-rng", "serde"] }
9697

97-
maxminddb = "0.24.0"
98+
maxminddb = "0.26.0"
9899
flate2 = "1.0.25"
99100
tar = "0.4.38"
100101

101-
sentry = { version = "0.34.0", default-features = false, features = [
102-
"backtrace",
103-
"contexts",
104-
"debug-images",
105-
"panic",
106-
"rustls",
107-
"reqwest",
108-
] }
109-
sentry-actix = "0.34.0"
102+
sentry = { version = "0.37.0", default-features = false, features = ["backtrace", "contexts", "debug-images", "panic", "rustls", "reqwest"] }
103+
sentry-actix = "0.37.0"
110104

111-
image = "0.24.6"
105+
image = "0.25.6"
112106
color-thief = "0.2.2"
113107
webp = "0.3.0"
114108

115109
woothee = "0.13.0"
116110

117111
lettre = "0.11.3"
118112

119-
derive-new = "0.6.0"
113+
derive-new = "0.7.0"
120114
rust_iso3166 = "0.1.11"
121115

122-
async-stripe = { version = "0.39.1", features = ["runtime-tokio-hyper-rustls"] }
116+
async-stripe = { version = "0.41.0", features = ["runtime-tokio-hyper-rustls"] }
123117
rusty-money = "0.4.1"
124-
json-patch = "*"
118+
json-patch = "4.0.0"
125119

126120
ariadne = { path = "../../packages/ariadne" }
127121

apps/labrinth/src/auth/checks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::database;
2+
use crate::database::models::Collection;
23
use crate::database::models::project_item::QueryProject;
34
use crate::database::models::version_item::QueryVersion;
4-
use crate::database::models::Collection;
55
use crate::database::redis::RedisPool;
6-
use crate::database::{models, Project, Version};
6+
use crate::database::{Project, Version, models};
77
use crate::models::users::User;
88
use crate::routes::ApiError;
99
use itertools::Itertools;

apps/labrinth/src/auth/email/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use lettre::message::header::ContentType;
21
use lettre::message::Mailbox;
2+
use lettre::message::header::ContentType;
33
use lettre::transport::smtp::authentication::Credentials;
44
use lettre::transport::smtp::client::{Tls, TlsParameters};
55
use lettre::{Address, Message, SmtpTransport, Transport};

apps/labrinth/src/auth/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub use validate::{check_is_moderator_from_headers, get_user_from_headers};
1515

1616
use crate::file_hosting::FileHostingError;
1717
use crate::models::error::ApiError;
18-
use actix_web::http::StatusCode;
1918
use actix_web::HttpResponse;
19+
use actix_web::http::StatusCode;
2020
use thiserror::Error;
2121

2222
#[derive(Error, Debug)]

0 commit comments

Comments
 (0)