Update apub library to 0.4.4 (#3258)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
4f2fb68d6b
commit
ffce66abb8
4 changed files with 19 additions and 81 deletions
71
Cargo.lock
generated
71
Cargo.lock
generated
|
@ -14,15 +14,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "activitypub_federation"
|
name = "activitypub_federation"
|
||||||
version = "0.4.1"
|
version = "0.4.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f85cab86a72489b908adfeec61a4f104124b01784b9a5bb721c988727c363dad"
|
checksum = "27540f6c4b72c91176610ed5279061a021387f972c7c6f42c41032b78a808267"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitystreams-kinds",
|
"activitystreams-kinds",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"background-jobs",
|
|
||||||
"base64 0.21.2",
|
"base64 0.21.2",
|
||||||
"bytes",
|
"bytes",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
@ -46,6 +45,7 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
@ -418,15 +418,6 @@ dependencies = [
|
||||||
"syn 1.0.103",
|
"syn 1.0.103",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-mutex"
|
|
||||||
version = "1.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e"
|
|
||||||
dependencies = [
|
|
||||||
"event-listener",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-stream"
|
name = "async-stream"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
|
@ -602,56 +593,6 @@ dependencies = [
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "background-jobs"
|
|
||||||
version = "0.13.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "793a813f9145c5f3a27b8dcd834c0927de68bbd60d53a369e5894f3cc5759020"
|
|
||||||
dependencies = [
|
|
||||||
"background-jobs-actix",
|
|
||||||
"background-jobs-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "background-jobs-actix"
|
|
||||||
version = "0.13.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8660626a2d8781b50cbe0e3b63d8e2a7e08a90e80fa2bca8e8cc19deff72ebf4"
|
|
||||||
dependencies = [
|
|
||||||
"actix-rt",
|
|
||||||
"anyhow",
|
|
||||||
"async-mutex",
|
|
||||||
"async-trait",
|
|
||||||
"background-jobs-core",
|
|
||||||
"num_cpus",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"thiserror",
|
|
||||||
"tokio",
|
|
||||||
"tracing",
|
|
||||||
"tracing-futures",
|
|
||||||
"uuid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "background-jobs-core"
|
|
||||||
version = "0.13.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "48e78e842fe2ae461319e3d1843c12e301630e65650332b02032ac70b0dfc66f"
|
|
||||||
dependencies = [
|
|
||||||
"actix-rt",
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"event-listener",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"thiserror",
|
|
||||||
"time 0.3.15",
|
|
||||||
"tracing",
|
|
||||||
"tracing-futures",
|
|
||||||
"uuid",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "backtrace"
|
name = "backtrace"
|
||||||
version = "0.3.67"
|
version = "0.3.67"
|
||||||
|
@ -1762,12 +1703,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "event-listener"
|
|
||||||
version = "2.5.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "eyre"
|
name = "eyre"
|
||||||
version = "0.6.8"
|
version = "0.6.8"
|
||||||
|
|
|
@ -59,7 +59,7 @@ lemmy_routes = { version = "=0.18.0-rc.5", path = "./crates/routes" }
|
||||||
lemmy_db_views = { version = "=0.18.0-rc.5", path = "./crates/db_views" }
|
lemmy_db_views = { version = "=0.18.0-rc.5", path = "./crates/db_views" }
|
||||||
lemmy_db_views_actor = { version = "=0.18.0-rc.5", path = "./crates/db_views_actor" }
|
lemmy_db_views_actor = { version = "=0.18.0-rc.5", path = "./crates/db_views_actor" }
|
||||||
lemmy_db_views_moderator = { version = "=0.18.0-rc.5", path = "./crates/db_views_moderator" }
|
lemmy_db_views_moderator = { version = "=0.18.0-rc.5", path = "./crates/db_views_moderator" }
|
||||||
activitypub_federation = { version = "0.4.1", default-features = false, features = ["actix-web"] }
|
activitypub_federation = { version = "0.4.4", default-features = false, features = ["actix-web"] }
|
||||||
diesel = "2.1.0"
|
diesel = "2.1.0"
|
||||||
diesel_migrations = "2.1.0"
|
diesel_migrations = "2.1.0"
|
||||||
diesel-async = "0.3.1"
|
diesel-async = "0.3.1"
|
||||||
|
|
|
@ -106,6 +106,7 @@ pub(crate) mod tests {
|
||||||
.domain("example.com")
|
.domain("example.com")
|
||||||
.app_data(context)
|
.app_data(context)
|
||||||
.build()
|
.build()
|
||||||
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
config.to_request_data()
|
config.to_request_data()
|
||||||
}
|
}
|
||||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -139,22 +139,24 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Http server with websocket support
|
|
||||||
let settings_bind = settings.clone();
|
|
||||||
HttpServer::new(move || {
|
|
||||||
let context = context.clone();
|
|
||||||
let federation_config = FederationConfig::builder()
|
let federation_config = FederationConfig::builder()
|
||||||
.domain(settings.hostname.clone())
|
.domain(settings.hostname.clone())
|
||||||
.app_data(context.clone())
|
.app_data(context.clone())
|
||||||
.client(client.clone())
|
.client(client.clone())
|
||||||
.http_fetch_limit(FEDERATION_HTTP_FETCH_LIMIT)
|
.http_fetch_limit(FEDERATION_HTTP_FETCH_LIMIT)
|
||||||
.worker_count(local_site.federation_worker_count as u64)
|
.worker_count(local_site.federation_worker_count as usize)
|
||||||
.debug(cfg!(debug_assertions))
|
.debug(cfg!(debug_assertions))
|
||||||
.http_signature_compat(true)
|
.http_signature_compat(true)
|
||||||
.url_verifier(Box::new(VerifyUrlData(context.pool().clone())))
|
.url_verifier(Box::new(VerifyUrlData(context.pool().clone())))
|
||||||
.build()
|
.build()
|
||||||
|
.await
|
||||||
.expect("configure federation");
|
.expect("configure federation");
|
||||||
|
|
||||||
|
// Create Http server with websocket support
|
||||||
|
let settings_bind = settings.clone();
|
||||||
|
HttpServer::new(move || {
|
||||||
|
let context = context.clone();
|
||||||
|
|
||||||
let cors_config = if cfg!(debug_assertions) {
|
let cors_config = if cfg!(debug_assertions) {
|
||||||
Cors::permissive()
|
Cors::permissive()
|
||||||
} else {
|
} else {
|
||||||
|
@ -173,7 +175,7 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
||||||
.wrap(TracingLogger::<QuieterRootSpanBuilder>::new())
|
.wrap(TracingLogger::<QuieterRootSpanBuilder>::new())
|
||||||
.app_data(Data::new(context))
|
.app_data(Data::new(context))
|
||||||
.app_data(Data::new(rate_limit_cell.clone()))
|
.app_data(Data::new(rate_limit_cell.clone()))
|
||||||
.wrap(FederationMiddleware::new(federation_config))
|
.wrap(FederationMiddleware::new(federation_config.clone()))
|
||||||
// The routes
|
// The routes
|
||||||
.configure(|cfg| api_routes_http::config(cfg, rate_limit_cell))
|
.configure(|cfg| api_routes_http::config(cfg, rate_limit_cell))
|
||||||
.configure(|cfg| {
|
.configure(|cfg| {
|
||||||
|
|
Loading…
Reference in a new issue