Просмотр исходного кода

Merge pull request #5319 from pixelfed/staging

Update config, allow Beagle discover service to be disabled
daniel 9 месяцев назад
Родитель
Сommit
49bae1da96
3 измененных файлов с 13 добавлено и 0 удалено
  1. 4 0
      CHANGELOG.md
  2. 8 0
      app/Services/Internal/BeagleService.php
  3. 1 0
      config/instance.php

+ 4 - 0
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)

+ 8 - 0
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) {

+ 1 - 0
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'),