diff --git a/CHANGELOG.md b/CHANGELOG.md index b6d24f61..a93b52ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,9 @@ - Update InboxPipeline, increase timeout from 60s to 300s ([d1b888b5](https://github.com/pixelfed/pixelfed/commit/d1b888b5)) - Update backup config, fixes #3793, #3920, #3931 ([b0c4cc30](https://github.com/pixelfed/pixelfed/commit/b0c4cc30)) - Update FederationController, add two new queues (follow, shared) to prioritize follow request handling ([8ba33864](https://github.com/pixelfed/pixelfed/commit/8ba33864)) +- Dispatch follow accept/reject pipeline jobs to follow queue ([aaed2bf6](https://github.com/pixelfed/pixelfed/commit/aaed2bf6)) +- Update MediaStorageService, improve support for pleroma .blob avatars ([66226658](https://github.com/pixelfed/pixelfed/commit/66226658)) +- Update ApiV1Controller, remove min avatar size limit, fixes #3715 ([2b0db812](https://github.com/pixelfed/pixelfed/commit/2b0db812)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 4af3b7b1..7a0d6376 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -221,7 +221,7 @@ class ApiV1Controller extends Controller abort_if(!$request->user(), 403); $this->validate($request, [ - 'avatar' => 'sometimes|mimetypes:image/jpeg,image/png|min:10|max:' . config('pixelfed.max_avatar_size'), + 'avatar' => 'sometimes|mimetypes:image/jpeg,image/png|max:' . config('pixelfed.max_avatar_size'), 'display_name' => 'nullable|string|max:30', 'note' => 'nullable|string|max:200', 'locked' => 'nullable', diff --git a/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php b/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php index 7ffeb8a4..bc90f9cf 100644 --- a/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php +++ b/app/Jobs/AvatarPipeline/RemoteAvatarFetch.php @@ -38,6 +38,8 @@ class RemoteAvatarFetch implements ShouldQueue * @var int */ public $tries = 1; + public $timeout = 300; + public $maxExceptions = 1; /** * Create a new job instance. diff --git a/app/Jobs/InboxPipeline/DeleteWorker.php b/app/Jobs/InboxPipeline/DeleteWorker.php index 8b9cc256..43783064 100644 --- a/app/Jobs/InboxPipeline/DeleteWorker.php +++ b/app/Jobs/InboxPipeline/DeleteWorker.php @@ -25,8 +25,8 @@ class DeleteWorker implements ShouldQueue protected $headers; protected $payload; - public $timeout = 120; - public $tries = 3; + public $timeout = 300; + public $tries = 1; public $maxExceptions = 1; /** diff --git a/app/Services/MediaStorageService.php b/app/Services/MediaStorageService.php index 016700d0..055afe64 100644 --- a/app/Services/MediaStorageService.php +++ b/app/Services/MediaStorageService.php @@ -203,6 +203,7 @@ class MediaStorageService { } $mimes = [ + 'application/octet-stream', 'image/jpeg', 'image/png', ]; @@ -239,6 +240,15 @@ class MediaStorageService { } file_put_contents($tmpName, $data); + $mimeCheck = Storage::mimeType('remcache/' . $tmpPath); + + if(!$mimeCheck || !in_array($mimeCheck, ['image/png', 'image/jpeg'])) { + $avatar->last_fetched_at = now(); + $avatar->save(); + unlink($tmpName); + return; + } + $disk = Storage::disk($driver); $file = $disk->putFileAs($base, new File($tmpName), $path, 'public'); $permalink = $disk->url($file);