--- /dev/null
+#!/bin/bash
+set -e
+
+TAG="federation-test"
+
+sudo docker build ../../ --file Dockerfile -t "dessalines/lemmy:$TAG"
+sudo docker save "dessalines/lemmy:$TAG" -o "$TAG.tar"
+sudo chown "$(id -u):$(id -g)" "$TAG.tar"
+
+scp "$TAG.tar" enterprise.lemmy.ml:
+rm "$TAG.tar"
+ssh lemmy-test "cat $TAG.tar | docker load"
+ssh lemmy-test "rm $TAG.tar"
+ssh lemmy-test "cd /lemmy/enterprise.lemmy.ml && docker-compose up -d"
\ No newline at end of file
.set_total_items(len as u64);
Ok(create_apub_response(&collection))
}
+
+pub async fn get_apub_community_inbox(
+ info: web::Path<CommunityQuery>,
+ context: web::Data<LemmyContext>,
+) -> Result<HttpResponse<Body>, LemmyError> {
+ let community = blocking(context.pool(), move |conn| {
+ Community::read_from_name(&conn, &info.community_name)
+ })
+ .await??;
+
+ let mut collection = OrderedCollection::new();
+ collection
+ .set_id(format!("{}/inbox", community.actor_id).parse()?)
+ .set_many_contexts(lemmy_context()?);
+ Ok(create_apub_response(&collection))
+}
.set_total_items(0_u64);
Ok(create_apub_response(&collection))
}
+
+pub async fn get_apub_user_inbox(
+ info: web::Path<UserQuery>,
+ context: web::Data<LemmyContext>,
+) -> Result<HttpResponse<Body>, LemmyError> {
+ let user = blocking(context.pool(), move |conn| {
+ User_::read_from_name(&conn, &info.user_name)
+ })
+ .await??;
+
+ let mut collection = OrderedCollection::new();
+ collection
+ .set_id(format!("{}/inbox", user.actor_id).parse()?)
+ .set_many_contexts(lemmy_context()?);
+ Ok(create_apub_response(&collection))
+}
use lemmy_apub::{
http::{
comment::get_apub_comment,
- community::{get_apub_community_followers, get_apub_community_http, get_apub_community_outbox},
+ community::{
+ get_apub_community_followers,
+ get_apub_community_http,
+ get_apub_community_inbox,
+ get_apub_community_outbox,
+ },
get_activity,
post::get_apub_post,
- user::{get_apub_user_http, get_apub_user_outbox},
+ user::{get_apub_user_http, get_apub_user_inbox, get_apub_user_outbox},
},
inbox::{community_inbox::community_inbox, shared_inbox::shared_inbox, user_inbox::user_inbox},
APUB_JSON_CONTENT_TYPE,
"/c/{community_name}/outbox",
web::get().to(get_apub_community_outbox),
)
+ .route(
+ "/c/{community_name}/inbox",
+ web::get().to(get_apub_community_inbox),
+ )
.route("/u/{user_name}", web::get().to(get_apub_user_http))
.route("/u/{user_name}/outbox", web::get().to(get_apub_user_outbox))
+ .route("/u/{user_name}/inbox", web::get().to(get_apub_user_inbox))
.route("/post/{post_id}", web::get().to(get_apub_post))
.route("/comment/{comment_id}", web::get().to(get_apub_comment))
.route("/activities/{type_}/{id}", web::get().to(get_activity)),