mirror of
https://github.com/astro/buzzrelay.git
synced 2024-11-24 21:11: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 name: Option<String>,
|
||||||
pub icon: Option<Media>,
|
pub icon: Option<Media>,
|
||||||
pub inbox: String,
|
pub inbox: String,
|
||||||
|
pub outbox: String,
|
||||||
#[serde(rename = "publicKey")]
|
#[serde(rename = "publicKey")]
|
||||||
pub public_key: ActorPublicKey,
|
pub public_key: ActorPublicKey,
|
||||||
#[serde(rename = "preferredUsername")]
|
#[serde(rename = "preferredUsername")]
|
||||||
|
|
|
@ -56,6 +56,7 @@ impl Actor {
|
||||||
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
|
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
|
||||||
}),
|
}),
|
||||||
inbox: self.uri(),
|
inbox: self.uri(),
|
||||||
|
outbox: format!("https://{}/outbox", self.host),
|
||||||
public_key: activitypub::ActorPublicKey {
|
public_key: activitypub::ActorPublicKey {
|
||||||
id: self.key_id(),
|
id: self.key_id(),
|
||||||
owner: Some(self.uri()),
|
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 {
|
async fn nodeinfo(axum::extract::State(state): axum::extract::State<State>) -> Response {
|
||||||
let follows_count = state.database.get_follows_count()
|
let follows_count = state.database.get_follows_count()
|
||||||
.await
|
.await
|
||||||
|
@ -339,6 +350,7 @@ async fn main() {
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/tag/:tag", get(get_tag_actor).post(post_tag_relay))
|
.route("/tag/:tag", get(get_tag_actor).post(post_tag_relay))
|
||||||
.route("/instance/:instance", get(get_instance_actor).post(post_instance_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/webfinger", get(webfinger))
|
||||||
.route("/.well-known/nodeinfo", get(nodeinfo))
|
.route("/.well-known/nodeinfo", get(nodeinfo))
|
||||||
.route("/metrics", get(|| async move {
|
.route("/metrics", get(|| async move {
|
||||||
|
|
Loading…
Reference in a new issue