From ea2a9eb42ae6e3f60e1b8cb4f6d4111bb5e26659 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 1 Aug 2024 21:47:04 -0600 Subject: [PATCH] Add Authorized Fetch --- app/Http/Controllers/Admin/AdminSettingsController.php | 2 ++ app/Services/AdminSettingsService.php | 1 + app/Services/ConfigCacheService.php | 1 + config/federation.php | 2 ++ 4 files changed, 6 insertions(+) diff --git a/app/Http/Controllers/Admin/AdminSettingsController.php b/app/Http/Controllers/Admin/AdminSettingsController.php index 98e16bbc..f1c2ca3a 100644 --- a/app/Http/Controllers/Admin/AdminSettingsController.php +++ b/app/Http/Controllers/Admin/AdminSettingsController.php @@ -531,6 +531,7 @@ trait AdminSettingsController 'registration_status' => 'required|in:open,filtered,closed', 'cloud_storage' => 'required', 'activitypub_enabled' => 'required', + 'authorized_fetch' => 'required', 'account_migration' => 'required', 'mobile_apis' => 'required', 'stories' => 'required', @@ -555,6 +556,7 @@ trait AdminSettingsController } } } + ConfigCacheService::put('federation.activitypub.authorized_fetch', $request->boolean('authorized_fetch')); ConfigCacheService::put('federation.activitypub.enabled', $request->boolean('activitypub_enabled')); ConfigCacheService::put('federation.migration', $request->boolean('account_migration')); ConfigCacheService::put('pixelfed.oauth_enabled', $request->boolean('mobile_apis')); diff --git a/app/Services/AdminSettingsService.php b/app/Services/AdminSettingsService.php index 57fb6e96..6a261f5a 100644 --- a/app/Services/AdminSettingsService.php +++ b/app/Services/AdminSettingsService.php @@ -37,6 +37,7 @@ class AdminSettingsService 'registration_status' => $regState, 'cloud_storage' => $cloud_ready && $cloud_storage, 'activitypub_enabled' => (bool) config_cache('federation.activitypub.enabled'), + 'authorized_fetch' => (bool) config_cache('federation.activitypub.authorized_fetch'), 'account_migration' => (bool) config_cache('federation.migration'), 'mobile_apis' => (bool) config_cache('pixelfed.oauth_enabled'), 'stories' => (bool) config_cache('instance.stories.enabled'), diff --git a/app/Services/ConfigCacheService.php b/app/Services/ConfigCacheService.php index 4f2b006c..527c8602 100644 --- a/app/Services/ConfigCacheService.php +++ b/app/Services/ConfigCacheService.php @@ -46,6 +46,7 @@ class ConfigCacheService 'pixelfed.oauth_enabled', 'pixelfed.import.instagram.enabled', 'pixelfed.bouncer.enabled', + 'federation.activitypub.authorized_fetch', 'pixelfed.enforce_email_verification', 'pixelfed.max_account_size', diff --git a/config/federation.php b/config/federation.php index 3d7a7bb3..124935ec 100644 --- a/config/federation.php +++ b/config/federation.php @@ -30,6 +30,8 @@ return [ 'ingest' => [ 'store_notes_without_followers' => env('AP_INGEST_STORE_NOTES_WITHOUT_FOLLOWERS', false), ], + + 'authorized_fetch' => env('AUTHORIZED_FETCH', false), ], 'atom' => [