From b57066d15d3453493576c578ad237a1f47913bde Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 4 Aug 2022 03:41:54 -0600 Subject: [PATCH 1/3] Fix email verification requests filtering to gracefully handle deleted accounts and accounts already verified --- app/Http/Controllers/Admin/AdminReportController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/AdminReportController.php b/app/Http/Controllers/Admin/AdminReportController.php index 2ee3dd0f..575342d6 100644 --- a/app/Http/Controllers/Admin/AdminReportController.php +++ b/app/Http/Controllers/Admin/AdminReportController.php @@ -560,10 +560,10 @@ trait AdminReportController }) ->map(function($id) { $user = User::whereProfileId($id)->first(); - if(!$user) { + if(!$user || $user->email_verified_at) { return []; } - $account = AccountService::get($id); + $account = AccountService::get($id, true); if(!$account) { return []; } From 2fb18b7dff79ccd13d72b1fa133fc0bc2daf6d70 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 5 Aug 2022 22:01:30 -0600 Subject: [PATCH 2/3] Add configuration to v1/instance endpoint. Fixes #3605 --- app/Http/Controllers/Api/ApiV1Controller.php | 25 ++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index c339e4dd..b324c9d7 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1305,7 +1305,7 @@ class ApiV1Controller extends Controller */ public function instance(Request $request) { - $res = Cache::remember('api:v1:instance-data-response-v0', 1800, function () { + $res = Cache::remember('api:v1:instance-data-response-v1', 1800, function () { $contact = Cache::remember('api:v1:instance-data:contact', 604800, function () { $admin = User::whereIsAdmin(true)->first(); return $admin && isset($admin->profile_id) ? @@ -1350,7 +1350,28 @@ class ApiV1Controller extends Controller 'registrations' => (bool) config_cache('pixelfed.open_registration'), 'approval_required' => false, 'contact_account' => $contact, - 'rules' => $rules + 'rules' => $rules, + 'configuration' => [ + 'media_attachments' => [ + 'image_matrix_limit' => 16777216, + 'image_size_limit' => config('pixelfed.max_photo_size') * 1024, + 'supported_mime_types' => explode(',', config('pixelfed.media_types')), + 'video_frame_rate_limit' => 120, + 'video_matrix_limit' => 2304000, + 'video_size_limit' => config('pixelfed.max_photo_size') * 1024, + ], + 'polls' => [ + 'max_characters_per_option' => 50, + 'max_expiration' => 2629746, + 'max_options' => 4, + 'min_expiration' => 300 + ], + 'statuses' => [ + 'characters_reserved_per_url' => 23, + 'max_characters' => (int) config('pixelfed.max_caption_length'), + 'max_media_attachments' => (int) config('pixelfed.max_album_length') + ] + ] ]; }); From a91c4392733b4aa03a28ab13c84b587fa5c147fc Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 5 Aug 2022 22:01:53 -0600 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c597837d..91bbcfcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ - Improve cache invalidation after processing VideoThumbnail to eliminate "No Preview Available" on grid feeds ([47571887](https://github.com/pixelfed/pixelfed/commit/47571887)) - Use poster in VideoPresenter component ([a3cc90b0](https://github.com/pixelfed/pixelfed/commit/a3cc90b0)) - Fix mastoapi notification type casting to include comment and share (mention and reblog) notifications ([eba84530](https://github.com/pixelfed/pixelfed/commit/eba84530)) +- Fix email verification requests filtering to gracefully handle deleted accounts and accounts already verified ([b57066d1](https://github.com/pixelfed/pixelfed/commit/b57066d1)) +- Add configuration to v1/instance endpoint. Fixes #3605 ([2fb18b7d](https://github.com/pixelfed/pixelfed/commit/2fb18b7d)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3)