mirror of
https://github.com/astro/buzzrelay.git
synced 2024-11-21 19:51:00 +00:00
parent
83f6679209
commit
c7f0335998
3 changed files with 14 additions and 0 deletions
|
@ -11,6 +11,7 @@ pub struct Actor {
|
|||
pub name: Option<String>,
|
||||
pub icon: Option<Media>,
|
||||
pub inbox: String,
|
||||
pub outbox: String,
|
||||
#[serde(rename = "publicKey")]
|
||||
pub public_key: ActorPublicKey,
|
||||
#[serde(rename = "preferredUsername")]
|
||||
|
|
|
@ -56,6 +56,7 @@ impl Actor {
|
|||
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
|
||||
}),
|
||||
inbox: self.uri(),
|
||||
outbox: format!("https://{}/outbox", self.host),
|
||||
public_key: activitypub::ActorPublicKey {
|
||||
id: self.key_id(),
|
||||
owner: Some(self.uri()),
|
||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -248,6 +248,17 @@ async fn post_relay(
|
|||
}
|
||||
}
|
||||
|
||||
/// An empty ActivityStreams outbox just to satisfy the spec
|
||||
async fn outbox() -> Response {
|
||||
Json(json!({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
"summary": "buzzrelay stub outbox",
|
||||
"type": "OrderedCollection",
|
||||
"totalItems": 0,
|
||||
"orderedItems": []
|
||||
})).into_response()
|
||||
}
|
||||
|
||||
async fn nodeinfo(axum::extract::State(state): axum::extract::State<State>) -> Response {
|
||||
let follows_count = state.database.get_follows_count()
|
||||
.await
|
||||
|
@ -339,6 +350,7 @@ async fn main() {
|
|||
let app = Router::new()
|
||||
.route("/tag/:tag", get(get_tag_actor).post(post_tag_relay))
|
||||
.route("/instance/:instance", get(get_instance_actor).post(post_instance_relay))
|
||||
.route("/outbox", get(outbox))
|
||||
.route("/.well-known/webfinger", get(webfinger))
|
||||
.route("/.well-known/nodeinfo", get(nodeinfo))
|
||||
.route("/metrics", get(|| async move {
|
||||
|
|
Loading…
Reference in a new issue