|
|
|
@ -71,10 +71,11 @@ class ApiV2Controller extends Controller
|
|
|
|
|
->toArray() : [];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$res = [
|
|
|
|
|
$res = Cache::remember('api:v2:instance-data-response-v2', 1800, function () use($contact, $rules) {
|
|
|
|
|
return [
|
|
|
|
|
'domain' => config('pixelfed.domain.app'),
|
|
|
|
|
'title' => config_cache('app.name'),
|
|
|
|
|
'version' => config('pixelfed.version'),
|
|
|
|
|
'version' => '3.5.3 (compatible; Pixelfed ' . config('pixelfed.version') .')',
|
|
|
|
|
'source_url' => 'https://github.com/pixelfed/pixelfed',
|
|
|
|
|
'description' => config_cache('app.short_description'),
|
|
|
|
|
'usage' => [
|
|
|
|
@ -93,7 +94,7 @@ class ApiV2Controller extends Controller
|
|
|
|
|
'languages' => [config('app.locale')],
|
|
|
|
|
'configuration' => [
|
|
|
|
|
'urls' => [
|
|
|
|
|
'streaming' => 'wss://' . config('pixelfed.domain.app'),
|
|
|
|
|
'streaming' => null,
|
|
|
|
|
'status' => null
|
|
|
|
|
],
|
|
|
|
|
'vapid' => [
|
|
|
|
@ -116,19 +117,20 @@ class ApiV2Controller extends Controller
|
|
|
|
|
'video_matrix_limit' => 3686400
|
|
|
|
|
],
|
|
|
|
|
'polls' => [
|
|
|
|
|
'max_options' => 4,
|
|
|
|
|
'max_characters_per_option' => 50,
|
|
|
|
|
'min_expiration' => 300,
|
|
|
|
|
'max_expiration' => 2629746,
|
|
|
|
|
'max_options' => 0,
|
|
|
|
|
'max_characters_per_option' => 0,
|
|
|
|
|
'min_expiration' => 0,
|
|
|
|
|
'max_expiration' => 0,
|
|
|
|
|
],
|
|
|
|
|
'translation' => [
|
|
|
|
|
'enabled' => false,
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
'registrations' => [
|
|
|
|
|
'enabled' => (bool) config_cache('pixelfed.open_registration'),
|
|
|
|
|
'enabled' => null,
|
|
|
|
|
'approval_required' => false,
|
|
|
|
|
'message' => null
|
|
|
|
|
'message' => null,
|
|
|
|
|
'url' => null,
|
|
|
|
|
],
|
|
|
|
|
'contact' => [
|
|
|
|
|
'email' => config('instance.email'),
|
|
|
|
@ -136,7 +138,9 @@ class ApiV2Controller extends Controller
|
|
|
|
|
],
|
|
|
|
|
'rules' => $rules
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$res['registrations']['enabled'] = (bool) config_cache('pixelfed.open_registration');
|
|
|
|
|
return response()->json($res, 200, [], JSON_UNESCAPED_SLASHES);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|