From f9be48d6ebd70ef601feafeb4b9f9cbbfc8dd757 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 12 Mar 2023 16:15:00 -0600 Subject: [PATCH 1/2] Update site config endpoint --- app/Util/Site/Config.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Util/Site/Config.php b/app/Util/Site/Config.php index c745c2031..84d60b2d5 100644 --- a/app/Util/Site/Config.php +++ b/app/Util/Site/Config.php @@ -7,24 +7,26 @@ use Illuminate\Support\Str; class Config { - const CACHE_KEY = 'api:site:configuration:_v0.6'; + const CACHE_KEY = 'api:site:configuration:_v0.7'; public static function get() { return Cache::remember(self::CACHE_KEY, 900, function() { return [ 'open_registration' => (bool) config_cache('pixelfed.open_registration'), 'uploader' => [ - 'max_photo_size' => config('pixelfed.max_photo_size'), - 'max_caption_length' => config('pixelfed.max_caption_length'), - 'album_limit' => config_cache('pixelfed.max_album_length'), - 'image_quality' => config_cache('pixelfed.image_quality'), + 'max_photo_size' => (int) config('pixelfed.max_photo_size'), + 'max_caption_length' => (int) config('pixelfed.max_caption_length'), + 'max_altext_length' => (int) config('pixelfed.max_altext_length', 150), + 'album_limit' => (int) config_cache('pixelfed.max_album_length'), + 'image_quality' => (int) config_cache('pixelfed.image_quality'), - 'max_collection_length' => config('pixelfed.max_collection_length', 18), + 'max_collection_length' => (int) config('pixelfed.max_collection_length', 18), 'optimize_image' => (bool) config('pixelfed.optimize_image'), 'optimize_video' => (bool) config('pixelfed.optimize_video'), 'media_types' => config_cache('pixelfed.media_types'), + 'mime_types' => config_cache('pixelfed.media_types') ? explode(',', config_cache('pixelfed.media_types')) : [], 'enforce_account_limit' => (bool) config_cache('pixelfed.enforce_account_limit') ], From 05ee7f2cff0e000e4636a9bf5c86ee776382fe15 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 12 Mar 2023 16:15:30 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b1c909b5..6da9094f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -128,6 +128,7 @@ - Update ApiV1Controller, fix home timeline bug ([a8ec8445](https://github.com/pixelfed/pixelfed/commit/a8ec8445)) - Update ApiV1Controller, increase home timeline max limit to 100 to fix compatibility with mastoapi ([5cf9ba78](https://github.com/pixelfed/pixelfed/commit/5cf9ba78)) - Update ApiV1Controller, preserve album order. Fixes #3708 ([deb26971](https://github.com/pixelfed/pixelfed/commit/deb26971)) +- Update site config endpoint ([f9be48d6](https://github.com/pixelfed/pixelfed/commit/f9be48d6)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)