Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Jul 12, 2024
1 parent d694cae commit 91b89eb
Show file tree
Hide file tree
Showing 39 changed files with 440 additions and 323 deletions.
550 changes: 332 additions & 218 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resolver = "2"
askama = { version = "0.12.1", default-features = false, features = [
"with-axum",
] }
clap = { version = "4.5.7", features = ["derive", "wrap_help"] }
clap = { version = "4.5.9", features = ["derive", "wrap_help"] }
diesel = { version = "2.2.1", default-features = false, features = [
"32-column-tables",
"with-deprecated",
Expand All @@ -97,17 +97,17 @@ fred = { version = "9.0.3", features = [
"i-scripts",
"sha-1",
] }
garde = { version = "0.19.2", features = [
garde = { version = "0.20.0", features = [
"derive",
"email",
"email-idna",
"regex",
"serde",
] }
itertools = { version = "0.13.0", default-features = false }
moka = { version = "0.12.7", features = ["sync"] }
moka = { version = ">= 0.12.7", features = ["sync"] }
simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
sonic-rs = "0.3.7"
sonic-rs = "0.3.8"
triomphe = { version = "0.1.13", default-features = false, features = [
"unsize",
] }
Expand Down Expand Up @@ -213,8 +213,11 @@ diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "3b
scraper = { git = "https://github.com/causal-agent/scraper.git", rev = "d67111f5cc0b7da6e6ff10e4549d87cf09ba3e5b" }
tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", rev = "b16c1bc0f5d4f91324174fd1bd839d743a70f86a" }

# Patch potential unsoundness. Scary...
async-stream = { git = "https://github.com/tokio-rs/async-stream.git", rev = "40a8deb7d41d3ac0e563f9a0fd7f600c23189987" }

# SIMD runtime detection and generic I/O wrapper
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "317ff37a8ab88e653ee01bbc00a974d41f3b151a" }
sonic-rs = { git = "https://github.com/aumetra/sonic-rs.git", rev = "7e3bd236d82c5ccf85b3506f5a8cd2794e53451a" }

# TCP nodelay for `axum::serve`
axum = { git = "https://github.com/tokio-rs/axum.git", rev = "8d0c5c05eb75eb779591c8000705e785123868a0" }
Expand Down
8 changes: 4 additions & 4 deletions crates/kitsune-activitypub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version.workspace = true
license.workspace = true

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
base64-simd = "0.8.0"
diesel = { workspace = true }
diesel-async = { workspace = true }
Expand All @@ -30,8 +30,8 @@ kitsune-url = { workspace = true }
kitsune-util = { workspace = true }
kitsune-wasm-mrf = { workspace = true }
mime = "0.3.17"
mime_guess = { version = "2.0.4", default-features = false }
serde = "1.0.203"
mime_guess = { version = "2.0.5", default-features = false }
serde = "1.0.204"
sha2 = "0.10.8"
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
Expand All @@ -45,7 +45,7 @@ sha2 = { version = "0.10.8", features = ["asm"] }

[dev-dependencies]
http-body-util = "0.1.2"
hyper = "1.3.1"
hyper = "1.4.1"
kitsune-config = { workspace = true }
kitsune-test = { workspace = true }
kitsune-webfinger = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
fred = { workspace = true }
kitsune-error = { workspace = true }
moka = { workspace = true }
serde = "1.0.203"
serde = "1.0.204"
sonic-rs = { workspace = true }
tracing = "0.1.40"
triomphe = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-captcha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum_dispatch = "0.3.13"
http = "1.1.0"
kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
serde_urlencoded = "0.7.1"
sonic-rs = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license.workspace = true
eyre = "0.6.12"
human-size = { version = "0.4.3", features = ["serde"] }
isolang = { version = "2.4.0", features = ["serde"] }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
smol_str = { version = "0.2.2", features = ["serde"] }
tokio = { version = "1.38.0", features = ["fs"] }
toml = { version = "0.8.14", default-features = false, features = ["parse"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/kitsune-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ license.workspace = true
build = "build.rs"

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
const_format = "0.2.32"
kitsune-db = { workspace = true }
kitsune-error = { workspace = true }
paste = "1.0.15"
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
triomphe = { workspace = true }
typed-builder = "0.18.2"
unsize = "1.1.0"

[build-dependencies]
vergen = { version = "8.3.1", features = ["build", "git", "gitcl"] }
vergen-gitcl = { version = "1.0.0", features = ["build"] }

[lints]
workspace = true
12 changes: 7 additions & 5 deletions crates/kitsune-core/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::env;
use vergen::EmitBuilder;
use vergen_gitcl::{Emitter, GitclBuilder};

const PRIMARY_PACKAGE_KEY: &str = "CARGO_PRIMARY_PACKAGE";
const PRIMARY_PACKAGE_FALLBACK_VALUE: &str = "kitsune";
Expand All @@ -9,9 +9,11 @@ fn main() {
println!("cargo:rustc-env={PRIMARY_PACKAGE_KEY}={PRIMARY_PACKAGE_FALLBACK_VALUE}");
}

EmitBuilder::builder()
.all_git()
.git_sha(true)
.emit_and_set()
let gitcl = GitclBuilder::default().sha(true).build().unwrap();

Emitter::new()
.add_instructions(&gitcl)
.unwrap()
.emit()
.unwrap();
}
6 changes: 3 additions & 3 deletions crates/kitsune-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ kitsune-language = { workspace = true }
kitsune-type = { workspace = true }
num-derive = "0.4.2"
num-traits = "0.2.19"
rustls = { version = "0.23.10", default-features = false, features = [
rustls = { version = "0.23.11", default-features = false, features = [
"logging",
"ring",
"std",
"tls12",
] }
rustls-native-certs = "0.7.0"
serde = { version = "1.0.203", features = ["derive"] }
rustls-native-certs = "0.7.1"
serde = { version = "1.0.204", features = ["derive"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true, features = ["diesel"] }
tokio = { version = "1.38.0", features = ["rt"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-derive/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = { version = "2.0.68", features = ["full"] }
syn = { version = "2.0.71", features = ["full"] }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/kitsune-email/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lettre = { version = "0.11.7", default-features = false, features = [
"tokio1-rustls-tls",
"tracing",
] }
mrml = { version = "4.0.0", default-features = false, features = [
mrml = { version = "4.0.1", default-features = false, features = [
"parse",
"render",
] }
Expand Down
7 changes: 3 additions & 4 deletions crates/kitsune-http-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ edition.workspace = true
license.workspace = true

[dependencies]
async-stream = "0.3.5"
bytes = "1.6.0"
futures-util = { version = "0.3.30", default-features = false, features = [
"alloc",
] }
http-body = "1.0.0"
http-body-util = "0.1.2"
http-signatures = { workspace = true }
hyper = "1.3.1"
hyper-util = { version = "0.1.5", features = [
hyper = "1.4.1"
hyper-util = { version = "0.1.6", features = [
"client-legacy",
"http1",
"http2",
Expand All @@ -31,7 +30,7 @@ hyper-rustls = { version = "0.27.2", default-features = false, features = [
] }
kitsune-type = { workspace = true }
pin-project = "1.1.5"
serde = "1.0.203"
serde = "1.0.204"
simdutf8 = { workspace = true }
sonic-rs = { workspace = true }
tower = { version = "0.4.13", features = ["util"] }
Expand Down
32 changes: 15 additions & 17 deletions crates/kitsune-http-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
#![deny(missing_docs)]

use self::util::BoxCloneService;
use async_stream::try_stream;
use bytes::Buf;
use futures_util::Stream;
use http_body::Body as HttpBody;
use http_body_util::{BodyExt, BodyStream, Limited};
use http_body_util::{BodyStream, Limited};
use hyper::{
body::Bytes,
header::{HeaderName, USER_AGENT},
Expand Down Expand Up @@ -171,7 +168,7 @@ impl ClientBuilder {
S: Service<Request<Body>, Response = HyperResponse<B>> + Clone + Send + Sync + 'static,
S::Error: StdError + Send + Sync + 'static,
S::Future: Send,
B: HttpBody + Default + Send + Sync + 'static,
B: http_body::Body + Default + Send + Sync + 'static,
B::Data: Send + Sync,
B::Error: StdError + Send + Sync + 'static,
{
Expand Down Expand Up @@ -319,6 +316,8 @@ impl Response {
///
/// Reading the body from the remote failed
pub async fn bytes(self) -> Result<Bytes> {
use http_body_util::BodyExt;

Ok(self.inner.collect().await.map_err(Error::new)?.to_bytes())
}

Expand Down Expand Up @@ -406,19 +405,18 @@ impl Response {

/// Stream the body
pub fn stream(self) -> impl Stream<Item = Result<Bytes>> {
let body_stream = BodyStream::new(self.inner.into_body());

try_stream! {
for await frame in body_stream {
match frame.map_err(Error::new)?.into_data() {
Ok(val) if val.has_remaining() => yield val,
Ok(..) | Err(..) => {
// There was either no remaining data or the frame was no data frame.
// Therefore we just discard it.
}
use futures_util::TryStreamExt;

BodyStream::new(self.inner.into_body())
.map_err(Error::new)
.map_ok(|value| match value.into_data() {
Ok(val) => val,
Err(..) => {
// There was either no remaining data or the frame was no data frame.
// Therefore we just discard it.
Bytes::new()
}
}
}
})
}

/// Get the HTTP version the client used
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-jobs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kitsune-core = { workspace = true }
kitsune-db = { workspace = true }
kitsune-email = { workspace = true }
kitsune-error = { workspace = true }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
speedy-uuid = { workspace = true }
tracing = "0.1.40"
typed-builder = "0.18.2"
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-mastodon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kitsune-type = { workspace = true }
kitsune-url = { workspace = true }
kitsune-util = { workspace = true }
mime = "0.3.17"
serde = "1.0.203"
serde = "1.0.204"
smol_str = "0.2.2"
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/kitsune-observability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ version.workspace = true
license.workspace = true

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
eyre = "0.6.12"
http-body-util = "0.1.2"
hyper = { version = "1.3.1", default-features = false }
hyper = { version = "1.4.1", default-features = false }
kitsune-config = { workspace = true }
kitsune-http-client = { workspace = true }
opentelemetry = { version = "0.23.0", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-oidc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ openidconnect = { version = "4.0.0-alpha.2", default-features = false, features
"accept-rfc3339-timestamps",
"accept-string-booleans",
] }
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true }
url = "2.5.2"
Expand Down
4 changes: 2 additions & 2 deletions crates/kitsune-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ futures-util = { version = "0.3.30", default-features = false }
http = "1.1.0"
kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
quick-xml = { version = "0.34.0", features = ["serialize"] }
quick-xml = { version = "0.36.0", features = ["serialize"] }
rusty-s3 = "0.5.0"
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
typed-builder = "0.18.2"

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions crates/kitsune-search/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version.workspace = true
license.workspace = true

[dependencies]
async-trait = "0.1.80"
async-trait = "0.1.81"
bytes = "1.6.0"
diesel = { workspace = true }
diesel-async = { workspace = true }
Expand All @@ -21,9 +21,9 @@ kitsune-derive = { workspace = true }
kitsune-error = { workspace = true }
kitsune-http-client = { workspace = true }
kitsune-language = { workspace = true }
meilisearch-sdk = { version = "0.26.1", default-features = false }
meilisearch-sdk = { version = "0.27.0", default-features = false }
pin-project-lite = "0.2.14"
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
serde_urlencoded = "0.7.1"
speedy-uuid = { workspace = true }
strum = { version = "0.26.3", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/kitsune-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ post-process = { workspace = true }
rand = "0.8.5"
rsa = "0.9.6"
rusty-s3 = { version = "0.5.0", default-features = false }
serde = "1.0.203"
serde = "1.0.204"
smol_str = "0.2.2"
speedy-uuid = { workspace = true }
tokio = { version = "1.38.0", features = ["macros", "sync"] }
Expand All @@ -58,7 +58,7 @@ zxcvbn = { version = "3.0.1", default-features = false }
[dev-dependencies]
hex-simd = "0.8.0"
http-body-util = "0.1.2"
hyper = "1.3.1"
hyper = "1.4.1"
kitsune-activitypub = { workspace = true }
kitsune-config = { workspace = true }
kitsune-federation-filter = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions crates/kitsune-service/src/post/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,11 @@ impl PostService {
Ok::<_, Error>(post)
};

try_stream! {
let permission_check = PermissionCheck::builder()
.fetching_account_id(fetching_account_id)
.build();
let permission_check = PermissionCheck::builder()
.fetching_account_id(fetching_account_id)
.build();

try_stream! {
let descendant_stream = load_post(id, permission_check).await?;
for await descendant in descendant_stream {
let descendant = descendant?;
Expand Down
2 changes: 1 addition & 1 deletion crates/kitsune-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rusty-s3 = { version = "0.5.0", default-features = false }
tokio = { version = "1.38.0", features = ["time"] }
triomphe = { workspace = true }
url = "2.5.2"
uuid = { version = "1.9.1", features = ["fast-rng", "v4"] }
uuid = { version = "1.10.0", features = ["fast-rng", "v4"] }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion crates/kitsune-type/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true

[dependencies]
iso8601-timestamp = "0.2.17"
serde = { version = "1.0.203", features = ["derive"] }
serde = { version = "1.0.204", features = ["derive"] }
smol_str = { version = "0.2.2", features = ["serde"] }
sonic-rs = { workspace = true }
speedy-uuid = { workspace = true, features = ["diesel"] }
Expand Down
Loading

0 comments on commit 91b89eb

Please sign in to comment.