From 8b6a4c060ee5b3b15c9d75aa421aa38cfbdb198e Mon Sep 17 00:00:00 2001 From: Nutomic Date: Tue, 14 May 2024 04:53:20 +0200 Subject: [PATCH] Make nodeinfo standard compliant, upgrade to nodeinfo 2.1 (fixes #4702) (#4706) * Always set activitypub protocol in nodeinfo response (fixes #4702) * Add mandatory fields --- crates/routes/src/nodeinfo.rs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/crates/routes/src/nodeinfo.rs b/crates/routes/src/nodeinfo.rs index dbb2ef68..66575686 100644 --- a/crates/routes/src/nodeinfo.rs +++ b/crates/routes/src/nodeinfo.rs @@ -43,21 +43,18 @@ async fn node_info(context: web::Data) -> Result) -> Result>, pub usage: Option, pub open_registrations: Option, + /// These fields are required by the spec for no reason + pub services: Option, + pub metadata: Option>, } #[derive(Serialize, Deserialize, Debug, Default)] @@ -99,6 +105,8 @@ pub struct NodeInfo { pub struct NodeInfoSoftware { pub name: Option, pub version: Option, + pub repository: Option, + pub homepage: Option, } #[derive(Serialize, Deserialize, Debug, Default)] @@ -116,3 +124,10 @@ pub struct NodeInfoUsers { pub active_halfyear: Option, pub active_month: Option, } + +#[derive(Serialize, Deserialize, Debug, Default)] +#[serde(rename_all = "camelCase", default)] +pub struct NodeInfoServices { + pub inbound: Option>, + pub outbound: Option>, +}