소스 검색

Update Inbox, allow storing Create->Note activities without any local followers, disabled by default

Daniel Supernault 2 년 전
부모
커밋
9fa6b3f7aa
2개의 변경된 파일57개의 추가작업 그리고 53개의 파일을 삭제
  1. 2 1
      app/Util/ActivityPub/Inbox.php
  2. 55 52
      config/federation.php

+ 2 - 1
app/Util/ActivityPub/Inbox.php

@@ -281,7 +281,8 @@ class Inbox
 		}
 
 		if($actor->followers_count == 0) {
-			if(FollowerService::followerCount($actor->id, true) == 0) {
+            if(config('federation.activitypub.ingest.store_notes_without_followers')) {
+            } else if(FollowerService::followerCount($actor->id, true) == 0) {
 				return;
 			}
 		}

+ 55 - 52
config/federation.php

@@ -2,56 +2,59 @@
 
 return [
 
-	/*
-	|--------------------------------------------------------------------------
-	| ActivityPub
-	|--------------------------------------------------------------------------
-	|
-	| ActivityPub configuration
-	|
-	*/
-	'activitypub' => [
-		'enabled' => env('ACTIVITY_PUB', false),
-		'outbox' => env('AP_OUTBOX', true),
-		'inbox' => env('AP_INBOX', true),
-		'sharedInbox' => env('AP_SHAREDINBOX', true),
-
-		'remoteFollow' => env('AP_REMOTE_FOLLOW', true),
-
-		'delivery' => [
-			'timeout' => env('ACTIVITYPUB_DELIVERY_TIMEOUT', 30.0),
-			'concurrency' => env('ACTIVITYPUB_DELIVERY_CONCURRENCY', 10),
-			'logger' => [
-				'enabled' => env('AP_LOGGER_ENABLED', false),
-				'driver' => 'log'
-			]
-		]
-	],
-
-	'atom' => [
-		'enabled' => env('ATOM_FEEDS', true),
-	],
-
-	'avatars' => [
-		'store_local' => env('REMOTE_AVATARS', true),
-	],
-
-	'nodeinfo' => [
-		'enabled' => env('NODEINFO', true),
-	],
-
-	'webfinger' => [
-		'enabled' => env('WEBFINGER', true)
-	],
-
-	'network_timeline' => env('PF_NETWORK_TIMELINE', true),
-	'network_timeline_days_falloff' => env('PF_NETWORK_TIMELINE_DAYS_FALLOFF', 2),
-
-	'custom_emoji' => [
-		'enabled' => env('CUSTOM_EMOJI', false),
-
-		// max size in bytes, default is 2mb
-		'max_size' => env('CUSTOM_EMOJI_MAX_SIZE', 2000000),
-	]
-
+    /*
+    |--------------------------------------------------------------------------
+    | ActivityPub
+    |--------------------------------------------------------------------------
+    |
+    | ActivityPub configuration
+    |
+    */
+    'activitypub' => [
+        'enabled' => env('ACTIVITY_PUB', false),
+        'outbox' => env('AP_OUTBOX', true),
+        'inbox' => env('AP_INBOX', true),
+        'sharedInbox' => env('AP_SHAREDINBOX', true),
+
+        'remoteFollow' => env('AP_REMOTE_FOLLOW', true),
+
+        'delivery' => [
+            'timeout' => env('ACTIVITYPUB_DELIVERY_TIMEOUT', 30.0),
+            'concurrency' => env('ACTIVITYPUB_DELIVERY_CONCURRENCY', 10),
+            'logger' => [
+                'enabled' => env('AP_LOGGER_ENABLED', false),
+                'driver' => 'log'
+            ]
+        ],
+
+        'ingest' => [
+            'store_notes_without_followers' => env('AP_INGEST_STORE_NOTES_WITHOUT_FOLLOWERS', false),
+        ],
+    ],
+
+    'atom' => [
+        'enabled' => env('ATOM_FEEDS', true),
+    ],
+
+    'avatars' => [
+        'store_local' => env('REMOTE_AVATARS', true),
+    ],
+
+    'nodeinfo' => [
+        'enabled' => env('NODEINFO', true),
+    ],
+
+    'webfinger' => [
+        'enabled' => env('WEBFINGER', true)
+    ],
+
+    'network_timeline' => env('PF_NETWORK_TIMELINE', true),
+    'network_timeline_days_falloff' => env('PF_NETWORK_TIMELINE_DAYS_FALLOFF', 2),
+
+    'custom_emoji' => [
+        'enabled' => env('CUSTOM_EMOJI', false),
+
+        // max size in bytes, default is 2mb
+        'max_size' => env('CUSTOM_EMOJI_MAX_SIZE', 2000000),
+    ],
 ];