Merge pull request #5319 from pixelfed/staging

Update config, allow Beagle discover service to be disabled
This commit is contained in:
daniel 2024-10-05 23:10:56 -06:00 committed by GitHub
commit 49bae1da96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,10 @@
- Update UserAccountDelete command, increase sharedInbox ttl from 12h to 14d ([be02f48a](https://github.com/pixelfed/pixelfed/commit/be02f48a)) - 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 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 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/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.12.3 (2024-07-01)](https://github.com/pixelfed/pixelfed/compare/v0.12.2...v0.12.3) ## [v0.12.3 (2024-07-01)](https://github.com/pixelfed/pixelfed/compare/v0.12.2...v0.12.3)

View file

@ -55,6 +55,10 @@ class BeagleService
return []; return [];
} }
if ((bool) config('instance.discover.beagle_api') == false) {
return [];
}
return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () { return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () {
try { try {
$res = Http::withOptions(['allow_redirects' => false]) $res = Http::withOptions(['allow_redirects' => false])
@ -92,6 +96,10 @@ class BeagleService
return []; return [];
} }
if ((bool) config('instance.discover.beagle_api') == false) {
return [];
}
return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () { return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () {
$posts = collect(self::getDiscover()) $posts = collect(self::getDiscover())
->filter(function ($post) { ->filter(function ($post) {

View file

@ -18,6 +18,7 @@ return [
'tags' => [ 'tags' => [
'is_public' => env('INSTANCE_PUBLIC_HASHTAGS', false), 'is_public' => env('INSTANCE_PUBLIC_HASHTAGS', false),
], ],
'beagle_api' => env('PF_INSTANCE_USE_BEAGLE_API', true),
], ],
'email' => env('INSTANCE_CONTACT_EMAIL'), 'email' => env('INSTANCE_CONTACT_EMAIL'),