Skip to content

Commit

Permalink
Update site config endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Mar 12, 2023
1 parent feeaedd commit f9be48d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/Util/Site/Config.php
Expand Up @@ -7,24 +7,26 @@

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')
],

Expand Down

0 comments on commit f9be48d

Please sign in to comment.