1
0
Fork 0

Merge pull request #4943 from pixelfed/staging

Staging
This commit is contained in:
daniel 2024-02-18 22:19:21 -07:00 committed by GitHub
commit 6c0c61e45a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 74 additions and 61 deletions

7
.gitattributes vendored
View File

@ -3,3 +3,10 @@
*.scss linguist-vendored *.scss linguist-vendored
*.js linguist-vendored *.js linguist-vendored
CHANGELOG.md export-ignore CHANGELOG.md export-ignore
# Collapse diffs for generated files:
public/**/*.js text -diff
public/**/*.json text -diff
public/**/*.css text -diff
public/img/* binary -diff
public/fonts/* binary -diff

View File

@ -7,6 +7,8 @@
- Update Inbox, cast live filters to lowercase ([d835e0ad](https://github.com/pixelfed/pixelfed/commit/d835e0ad)) - Update Inbox, cast live filters to lowercase ([d835e0ad](https://github.com/pixelfed/pixelfed/commit/d835e0ad))
- Update federation config, increase default timeline days falloff to 90 days from 2 days. Fixes #4905 ([011834f4](https://github.com/pixelfed/pixelfed/commit/011834f4)) - Update federation config, increase default timeline days falloff to 90 days from 2 days. Fixes #4905 ([011834f4](https://github.com/pixelfed/pixelfed/commit/011834f4))
- Update cache config, use predis as default redis driver client ([ea6b1623](https://github.com/pixelfed/pixelfed/commit/ea6b1623)) - Update cache config, use predis as default redis driver client ([ea6b1623](https://github.com/pixelfed/pixelfed/commit/ea6b1623))
- Update .gitattributes to collapse diffs on generated files ([ThisIsMissEm](https://github.com/pixelfed/pixelfed/commit/9978b2b9))
- Update api v1/v2 instance endpoints, bump mastoapi version from 2.7.2 to 3.5.3 ([545f7d5e](https://github.com/pixelfed/pixelfed/commit/545f7d5e))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.12 (2024-02-16)](https://github.com/pixelfed/pixelfed/compare/v0.11.11...v0.11.12) ## [v0.11.12 (2024-02-16)](https://github.com/pixelfed/pixelfed/compare/v0.11.11...v0.11.12)

View File

@ -1612,7 +1612,7 @@ class ApiV1Controller extends Controller
'short_description' => config_cache('app.short_description'), 'short_description' => config_cache('app.short_description'),
'description' => config_cache('app.description'), 'description' => config_cache('app.description'),
'email' => config('instance.email'), 'email' => config('instance.email'),
'version' => '2.7.2 (compatible; Pixelfed ' . config('pixelfed.version') .')', 'version' => '3.5.3 (compatible; Pixelfed ' . config('pixelfed.version') .')',
'urls' => [ 'urls' => [
'streaming_api' => 'wss://' . config('pixelfed.domain.app') 'streaming_api' => 'wss://' . config('pixelfed.domain.app')
], ],

View File

@ -71,72 +71,76 @@ class ApiV2Controller extends Controller
->toArray() : []; ->toArray() : [];
}); });
$res = [ $res = Cache::remember('api:v2:instance-data-response-v2', 1800, function () use($contact, $rules) {
'domain' => config('pixelfed.domain.app'), return [
'title' => config_cache('app.name'), 'domain' => config('pixelfed.domain.app'),
'version' => config('pixelfed.version'), 'title' => config_cache('app.name'),
'source_url' => 'https://github.com/pixelfed/pixelfed', 'version' => '3.5.3 (compatible; Pixelfed ' . config('pixelfed.version') .')',
'description' => config_cache('app.short_description'), 'source_url' => 'https://github.com/pixelfed/pixelfed',
'usage' => [ 'description' => config_cache('app.short_description'),
'users' => [ 'usage' => [
'active_month' => (int) Nodeinfo::activeUsersMonthly() 'users' => [
] 'active_month' => (int) Nodeinfo::activeUsersMonthly()
], ]
'thumbnail' => [
'url' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg')),
'blurhash' => InstanceService::headerBlurhash(),
'versions' => [
'@1x' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg')),
'@2x' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg'))
]
],
'languages' => [config('app.locale')],
'configuration' => [
'urls' => [
'streaming' => 'wss://' . config('pixelfed.domain.app'),
'status' => null
], ],
'vapid' => [ 'thumbnail' => [
'public_key' => config('webpush.vapid.public_key'), 'url' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg')),
'blurhash' => InstanceService::headerBlurhash(),
'versions' => [
'@1x' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg')),
'@2x' => config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg'))
]
], ],
'accounts' => [ 'languages' => [config('app.locale')],
'max_featured_tags' => 0, 'configuration' => [
'urls' => [
'streaming' => null,
'status' => null
],
'vapid' => [
'public_key' => config('webpush.vapid.public_key'),
],
'accounts' => [
'max_featured_tags' => 0,
],
'statuses' => [
'max_characters' => (int) config('pixelfed.max_caption_length'),
'max_media_attachments' => (int) config_cache('pixelfed.max_album_length'),
'characters_reserved_per_url' => 23
],
'media_attachments' => [
'supported_mime_types' => explode(',', config_cache('pixelfed.media_types')),
'image_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'image_matrix_limit' => 3686400,
'video_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'video_frame_rate_limit' => 240,
'video_matrix_limit' => 3686400
],
'polls' => [
'max_options' => 0,
'max_characters_per_option' => 0,
'min_expiration' => 0,
'max_expiration' => 0,
],
'translation' => [
'enabled' => false,
],
], ],
'statuses' => [ 'registrations' => [
'max_characters' => (int) config('pixelfed.max_caption_length'), 'enabled' => null,
'max_media_attachments' => (int) config_cache('pixelfed.max_album_length'), 'approval_required' => false,
'characters_reserved_per_url' => 23 'message' => null,
'url' => null,
], ],
'media_attachments' => [ 'contact' => [
'supported_mime_types' => explode(',', config_cache('pixelfed.media_types')), 'email' => config('instance.email'),
'image_size_limit' => config_cache('pixelfed.max_photo_size') * 1024, 'account' => $contact
'image_matrix_limit' => 3686400,
'video_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'video_frame_rate_limit' => 240,
'video_matrix_limit' => 3686400
], ],
'polls' => [ 'rules' => $rules
'max_options' => 4, ];
'max_characters_per_option' => 50, });
'min_expiration' => 300,
'max_expiration' => 2629746,
],
'translation' => [
'enabled' => false,
],
],
'registrations' => [
'enabled' => (bool) config_cache('pixelfed.open_registration'),
'approval_required' => false,
'message' => null
],
'contact' => [
'email' => config('instance.email'),
'account' => $contact
],
'rules' => $rules
];
$res['registrations']['enabled'] = (bool) config_cache('pixelfed.open_registration');
return response()->json($res, 200, [], JSON_UNESCAPED_SLASHES); return response()->json($res, 200, [], JSON_UNESCAPED_SLASHES);
} }