From a6503128582c5fc00466d03171d7df7f2c3a70d5 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Mon, 8 Mar 2021 09:23:50 -0600 Subject: [PATCH 1/4] revert Compose file version from 3.3 to 2.2 --- ansible/templates/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index 0ce715c69..7e81e8039 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.3' +version: '2.2' services: lemmy: From fc74bfeb23e18b28a4e0248a214c2295d455e537 Mon Sep 17 00:00:00 2001 From: nutomic Date: Wed, 10 Mar 2021 18:38:00 +0000 Subject: [PATCH 2/4] Add memory limit for pictrs --- ansible/templates/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index 0ce715c69..c6e3d626a 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -45,6 +45,7 @@ services: volumes: - ./volumes/pictrs:/mnt restart: always + mem_limit: 200m iframely: image: dogbin/iframely:latest From 0a7271a185abf8a6c60bdac5bc144da368e0846c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 12 Mar 2021 10:13:20 -0500 Subject: [PATCH 3/4] Upgrading pictrs. --- ansible/templates/docker-compose.yml | 2 +- docker/dev/docker-compose.yml | 2 +- docker/federation/docker-compose.yml | 2 +- docker/prod/docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/templates/docker-compose.yml b/ansible/templates/docker-compose.yml index 0ce715c69..ba84198fd 100644 --- a/ansible/templates/docker-compose.yml +++ b/ansible/templates/docker-compose.yml @@ -38,7 +38,7 @@ services: restart: always pictrs: - image: asonix/pictrs:v0.2.5-r0 + image: asonix/pictrs:v0.2.6-r1 user: 991:991 ports: - "127.0.0.1:8537:8080" diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index a23f1e0ed..b8dcac91e 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -42,7 +42,7 @@ services: restart: always pictrs: - image: asonix/pictrs:v0.2.5-r0 + image: asonix/pictrs:v0.2.6-r1 ports: - "8537:8080" user: 991:991 diff --git a/docker/federation/docker-compose.yml b/docker/federation/docker-compose.yml index c40de9022..03355aa49 100644 --- a/docker/federation/docker-compose.yml +++ b/docker/federation/docker-compose.yml @@ -23,7 +23,7 @@ services: pictrs: restart: always - image: asonix/pictrs:v0.2.5-r0 + image: asonix/pictrs:v0.2.6-r1 user: 991:991 volumes: - ./volumes/pictrs_alpha:/mnt diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml index e219bdef8..a508269a5 100644 --- a/docker/prod/docker-compose.yml +++ b/docker/prod/docker-compose.yml @@ -38,7 +38,7 @@ services: - lemmy pictrs: - image: asonix/pictrs:v0.2.5-r0 + image: asonix/pictrs:v0.2.6-r1 ports: - "127.0.0.1:8537:8080" user: 991:991 From 621355b6ef3c83ddc2f334da30ebc4a8487c9d57 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 15 Mar 2021 13:58:54 +0100 Subject: [PATCH 4/4] Insert announced activities into DB for fetching (fixes #1494) --- crates/apub/src/activities/send/community.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/apub/src/activities/send/community.rs b/crates/apub/src/activities/send/community.rs index 3e77248f8..185f4b57f 100644 --- a/crates/apub/src/activities/send/community.rs +++ b/crates/apub/src/activities/send/community.rs @@ -4,6 +4,7 @@ use crate::{ check_is_apub_id_valid, extensions::context::lemmy_context, fetcher::user::get_or_fetch_and_upsert_user, + insert_activity, ActorType, }; use activitystreams::{ @@ -27,7 +28,7 @@ use lemmy_api_structs::blocking; use lemmy_db_queries::DbPool; use lemmy_db_schema::source::community::Community; use lemmy_db_views_actor::community_follower_view::CommunityFollowerView; -use lemmy_utils::{location_info, LemmyError}; +use lemmy_utils::{location_info, settings::structs::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use url::Url; @@ -164,11 +165,20 @@ impl ActorType for Community { /// Wraps an activity sent to the community in an announce, and then sends the announce to all /// community followers. + /// + /// If we are announcing a local activity, it hasn't been stored in the database yet, and we need + /// to do it here, so that it can be fetched by ID. Remote activities are inserted into DB in the + /// inbox. async fn send_announce( &self, activity: AnyBase, context: &LemmyContext, ) -> Result<(), LemmyError> { + let inner_id = activity.id().context(location_info!())?; + if inner_id.domain() == Some(&Settings::get().get_hostname_without_port()?) { + insert_activity(inner_id, activity.clone(), true, false, context.pool()).await?; + } + let mut announce = Announce::new(self.actor_id.to_owned().into_inner(), activity); announce .set_many_contexts(lemmy_context()?)