main: add instanceinfo api stub

required by AodeRelay
This commit is contained in:
Astro 2023-10-31 04:01:46 +01:00
parent 70f66cbda3
commit 9cfcf60903

View file

@ -307,6 +307,18 @@ async fn nodeinfo(axum::extract::State(state): axum::extract::State<State>) -> R
})).into_response() })).into_response()
} }
/// Expected by AodeRelay
async fn instanceinfo() -> Response {
Json(json!({
"title": env!("CARGO_PKG_NAME"),
"description": "#FediBuzz Relay",
"version": env!("CARGO_PKG_VERSION"),
"registrations": false,
"default_approval": false,
})).into_response()
}
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
exit_on_panic(); exit_on_panic();
@ -369,6 +381,7 @@ async fn main() {
.route("/instance/:instance/outbox", get(outbox)) .route("/instance/:instance/outbox", get(outbox))
.route("/.well-known/webfinger", get(webfinger)) .route("/.well-known/webfinger", get(webfinger))
.route("/.well-known/nodeinfo", get(nodeinfo)) .route("/.well-known/nodeinfo", get(nodeinfo))
.route("/api/v1/instance", get(instanceinfo))
.route("/metrics", get(|| async move { .route("/metrics", get(|| async move {
recorder.render().into_response() recorder.render().into_response()
})) }))