1
0
Fork 0

Merge pull request #3938 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-12-13 00:01:15 -07:00 committed by GitHub
commit 17758865dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

View File

@ -49,6 +49,9 @@
- Update InboxPipeline, increase timeout from 60s to 300s ([d1b888b5](https://github.com/pixelfed/pixelfed/commit/d1b888b5)) - 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 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)) - 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/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)

View File

@ -221,7 +221,7 @@ class ApiV1Controller extends Controller
abort_if(!$request->user(), 403); abort_if(!$request->user(), 403);
$this->validate($request, [ $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', 'display_name' => 'nullable|string|max:30',
'note' => 'nullable|string|max:200', 'note' => 'nullable|string|max:200',
'locked' => 'nullable', 'locked' => 'nullable',

View File

@ -38,6 +38,8 @@ class RemoteAvatarFetch implements ShouldQueue
* @var int * @var int
*/ */
public $tries = 1; public $tries = 1;
public $timeout = 300;
public $maxExceptions = 1;
/** /**
* Create a new job instance. * Create a new job instance.

View File

@ -25,8 +25,8 @@ class DeleteWorker implements ShouldQueue
protected $headers; protected $headers;
protected $payload; protected $payload;
public $timeout = 120; public $timeout = 300;
public $tries = 3; public $tries = 1;
public $maxExceptions = 1; public $maxExceptions = 1;
/** /**

View File

@ -203,6 +203,7 @@ class MediaStorageService {
} }
$mimes = [ $mimes = [
'application/octet-stream',
'image/jpeg', 'image/jpeg',
'image/png', 'image/png',
]; ];
@ -239,6 +240,15 @@ class MediaStorageService {
} }
file_put_contents($tmpName, $data); 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); $disk = Storage::disk($driver);
$file = $disk->putFileAs($base, new File($tmpName), $path, 'public'); $file = $disk->putFileAs($base, new File($tmpName), $path, 'public');
$permalink = $disk->url($file); $permalink = $disk->url($file);