1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 08:44:02 +00:00

Update site config, fix boolean casting

This commit is contained in:
Daniel Supernault 2021-05-18 17:53:59 -06:00
parent 74261999d3
commit 955696b8a0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 10 additions and 10 deletions

View file

@ -977,7 +977,7 @@ class ApiV1Controller extends Controller
'short_description' => 'Pixelfed - Photo sharing for everyone',
'languages' => ['en'],
'max_toot_chars' => (int) config('pixelfed.max_caption_length'),
'registrations' => config_cache('pixelfed.open_registration'),
'registrations' => (bool) config_cache('pixelfed.open_registration'),
'stats' => [
'user_count' => 0,
'status_count' => 0,
@ -994,7 +994,7 @@ class ApiV1Controller extends Controller
'max_caption_length' => (int) config('pixelfed.max_caption_length'),
'max_bio_length' => (int) config('pixelfed.max_bio_length'),
'max_album_length' => (int) config_cache('pixelfed.max_album_length'),
'mobile_apis' => config_cache('pixelfed.oauth_enabled')
'mobile_apis' => (bool) config_cache('pixelfed.oauth_enabled')
]
];

View file

@ -8,7 +8,7 @@ use Illuminate\Support\Str;
class Config {
public static function get() {
return Cache::remember('api:site:configuration:_v0.2', now()->addMinutes(5), function() {
return Cache::remember('api:site:configuration:_v0.3', now()->addMinutes(5), function() {
return [
'open_registration' => (bool) config_cache('pixelfed.open_registration'),
'uploader' => [
@ -19,15 +19,15 @@ class Config {
'max_collection_length' => config('pixelfed.max_collection_length', 18),
'optimize_image' => config('pixelfed.optimize_image'),
'optimize_video' => config('pixelfed.optimize_video'),
'optimize_image' => (bool) config('pixelfed.optimize_image'),
'optimize_video' => (bool) config('pixelfed.optimize_video'),
'media_types' => config_cache('pixelfed.media_types'),
'enforce_account_limit' => config_cache('pixelfed.enforce_account_limit')
'enforce_account_limit' => (bool) config_cache('pixelfed.enforce_account_limit')
],
'activitypub' => [
'enabled' => config_cache('federation.activitypub.enabled'),
'enabled' => (bool) config_cache('federation.activitypub.enabled'),
'remote_follow' => config('federation.activitypub.remoteFollow')
],
@ -54,9 +54,9 @@ class Config {
],
'features' => [
'mobile_apis' => config_cache('pixelfed.oauth_enabled'),
'mobile_apis' => (bool) config_cache('pixelfed.oauth_enabled'),
'circles' => false,
'stories' => config_cache('instance.stories.enabled'),
'stories' => (bool) config_cache('instance.stories.enabled'),
'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
'import' => [
'instagram' => config_cache('pixelfed.import.instagram.enabled'),
@ -65,7 +65,7 @@ class Config {
],
'label' => [
'covid' => [
'enabled' => config('instance.label.covid.enabled'),
'enabled' => (bool) config('instance.label.covid.enabled'),
'org' => config('instance.label.covid.org'),
'url' => config('instance.label.covid.url'),
]