From de4ce3c83f9691219eb72a91fb407db282c0c25e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 5 Oct 2024 23:09:33 -0600 Subject: [PATCH 1/2] Update config, allow Beagle discover service to be disabled --- app/Services/Internal/BeagleService.php | 8 ++++++++ config/instance.php | 1 + 2 files changed, 9 insertions(+) diff --git a/app/Services/Internal/BeagleService.php b/app/Services/Internal/BeagleService.php index 2dcc32a4c..0f284e93c 100644 --- a/app/Services/Internal/BeagleService.php +++ b/app/Services/Internal/BeagleService.php @@ -55,6 +55,10 @@ class BeagleService return []; } + if ((bool) config('instance.discover.beagle_api') == false) { + return []; + } + return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () { try { $res = Http::withOptions(['allow_redirects' => false]) @@ -92,6 +96,10 @@ class BeagleService return []; } + if ((bool) config('instance.discover.beagle_api') == false) { + return []; + } + return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () { $posts = collect(self::getDiscover()) ->filter(function ($post) { diff --git a/config/instance.php b/config/instance.php index 3538fbf6d..18d887873 100644 --- a/config/instance.php +++ b/config/instance.php @@ -18,6 +18,7 @@ return [ 'tags' => [ 'is_public' => env('INSTANCE_PUBLIC_HASHTAGS', false), ], + 'beagle_api' => env('PF_INSTANCE_USE_BEAGLE_API', true), ], 'email' => env('INSTANCE_CONTACT_EMAIL'), From 89b42036e52a5941284dd216c8ea11f0228aa95f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 5 Oct 2024 23:10:38 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 010f5ce8f..e5f135e11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ - Update UserAccountDelete command, increase sharedInbox ttl from 12h to 14d ([be02f48a](https://github.com/pixelfed/pixelfed/commit/be02f48a)) - Update HttpSignature, add signRaw method and improve error checking ([d4cf9181](https://github.com/pixelfed/pixelfed/commit/d4cf9181)) - Update AP helpers, add forceBanCheck param to validateUrl method ([42424028](https://github.com/pixelfed/pixelfed/commit/42424028)) +- Update layout, add og:logo ([4cc576e1](https://github.com/pixelfed/pixelfed/commit/4cc576e1)) +- Update ReblogService, fix cache sync issues ([3de8ceca](https://github.com/pixelfed/pixelfed/commit/3de8ceca)) +- Update config, allow Beagle discover service to be disabled ([de4ce3c8](https://github.com/pixelfed/pixelfed/commit/de4ce3c8)) +- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.12.3 (2024-07-01)](https://github.com/pixelfed/pixelfed/compare/v0.12.2...v0.12.3)