Add nodeinfo

O01eg
Apr 22, 2022, 10:08 AM
HRNW7A472RQGYILOBMGHECL6CIQ5UXYRSII5F5WRQ33XTE7V5JGQC

Dependencies

  • [2] YXH3KDBR Add initial webfinger
  • [*] XS5FAAN4 Add well-known host-meta page
  • [*] 4MZ4VIR7 Initial commit
  • [*] WLWTNO4Y Create form to request game password change link

Change contents

  • edit in src/pages/well_known.rs at line 19
    [4.681]
    [4.681]
    }
    pub async fn nodeinfo() -> HttpResponse {
    HttpResponse::Ok()
    .insert_header((
    "Content-Type",
    "application/json;profile=\"http://nodeinfo.diaspora.software/ns/schema/2.0#\"",
    ))
    .insert_header((
    "Date",
    chrono::Utc::now()
    .format("%a, %d %b %Y %H:%M:%S GMT")
    .to_string(),
    ))
    .body(
    r#"{
    "version": 2.0,
    "software": {
    "name": "freeorion-test-web",
    "version": "0.0.1"
    },
    "protocols": ["activitypub"],
    "services": {"inbound": [], "outbound": []},
    "openRegistrations": false,
    "usage": {
    "users": 0,
    "localPosts": 0
    }
    }"#,
    )
  • edit in src/main.rs at line 180
    [2.1494]
    [6.1998]
    .route("/nodeinfo/2.0", web::get().to(well_known::nodeinfo))