Merge branch 'staging' of https://github.com/pixelfed/pixelfed into translation-coverage-extension

This commit is contained in:
dedicated user for pixelfed 2024-08-17 00:52:19 +00:00
commit 04da6074e8
9 changed files with 70 additions and 10 deletions

View file

@ -4,6 +4,7 @@
### Added ### Added
- Implement Admin Domain Blocks API (Mastodon API Compatible) [ThisIsMissEm](https://github.com/ThisIsMissEm) ([#5021](https://github.com/pixelfed/pixelfed/pull/5021)) - Implement Admin Domain Blocks API (Mastodon API Compatible) [ThisIsMissEm](https://github.com/ThisIsMissEm) ([#5021](https://github.com/pixelfed/pixelfed/pull/5021))
- Authorize Interaction support (for handling remote interactions) ([4ca7c6c3](https://github.com/pixelfed/pixelfed/commit/4ca7c6c3))
### Updates ### Updates
- Update ApiV1Controller, add support for notification filter types ([f61159a1](https://github.com/pixelfed/pixelfed/commit/f61159a1)) - Update ApiV1Controller, add support for notification filter types ([f61159a1](https://github.com/pixelfed/pixelfed/commit/f61159a1))
@ -14,7 +15,7 @@
- Update instance config, update network cache feed max_hours_old falloff to 90 days instead of 6 hours to allow for less active instances to have more results ([c042d135](https://github.com/pixelfed/pixelfed/commit/c042d135)) - Update instance config, update network cache feed max_hours_old falloff to 90 days instead of 6 hours to allow for less active instances to have more results ([c042d135](https://github.com/pixelfed/pixelfed/commit/c042d135))
- Update ApiV1Dot1Controller, add new single media status create endpoint ([b03f5cec](https://github.com/pixelfed/pixelfed/commit/b03f5cec)) - Update ApiV1Dot1Controller, add new single media status create endpoint ([b03f5cec](https://github.com/pixelfed/pixelfed/commit/b03f5cec))
- Update AdminSettings component, add link to Custom CSS settings ([958daac4](https://github.com/pixelfed/pixelfed/commit/958daac4)) - Update AdminSettings component, add link to Custom CSS settings ([958daac4](https://github.com/pixelfed/pixelfed/commit/958daac4))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - Update ApiV1Controller, fix v1/instance stats, force cast to int ([dcd95d68](https://github.com/pixelfed/pixelfed/commit/dcd95d68))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.12.3 (2024-07-01)](https://github.com/pixelfed/pixelfed/compare/v0.12.2...v0.12.3) ## [v0.12.3 (2024-07-01)](https://github.com/pixelfed/pixelfed/compare/v0.12.2...v0.12.3)

View file

@ -43,3 +43,10 @@ We would like to extend our thanks to the following sponsors for funding Pixelfe
- [NLnet Foundation](https://nlnet.nl) and [NGI0 - [NLnet Foundation](https://nlnet.nl) and [NGI0
Discovery](https://nlnet.nl/discovery/), part of the [Next Generation Discovery](https://nlnet.nl/discovery/), part of the [Next Generation
Internet](https://ngi.eu) initiative. Internet](https://ngi.eu) initiative.
<p>This project is supported by:</p>
<p>
<a href="https://www.digitalocean.com/?utm_medium=opensource&utm_source=pixelfed">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
</a>
</p>

View file

@ -1663,9 +1663,9 @@ class ApiV1Controller extends Controller
$stats = Cache::remember('api:v1:instance-data:stats', 43200, function () { $stats = Cache::remember('api:v1:instance-data:stats', 43200, function () {
return [ return [
'user_count' => User::count(), 'user_count' => (int) User::count(),
'status_count' => StatusService::totalLocalStatuses(), 'status_count' => (int) StatusService::totalLocalStatuses(),
'domain_count' => Instance::count(), 'domain_count' => (int) Instance::count(),
]; ];
}); });

View file

@ -0,0 +1,37 @@
<?php
namespace App\Http\Controllers;
use App\Util\ActivityPub\Helpers;
use Illuminate\Http\Request;
class AuthorizeInteractionController extends Controller
{
public function get(Request $request)
{
$request->validate([
'uri' => 'required|url',
]);
abort_unless((bool) config_cache('federation.activitypub.enabled'), 404);
$uri = Helpers::validateUrl($request->input('uri'), true);
abort_unless($uri, 404);
if (! $request->user()) {
return redirect('/login?next='.urlencode($uri));
}
$status = Helpers::statusFetch($uri);
if ($status && isset($status['id'])) {
return redirect('/i/web/post/'.$status['id']);
}
$profile = Helpers::profileFetch($uri);
if ($profile && isset($profile['id'])) {
return redirect('/i/web/profile/'.$profile['id']);
}
return redirect('/i/web');
}
}

View file

@ -66,6 +66,10 @@ class FederationController extends Controller
'type' => 'application/activity+json', 'type' => 'application/activity+json',
'href' => 'https://'.$domain.'/i/actor', 'href' => 'https://'.$domain.'/i/actor',
], ],
[
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => 'https://'.$domain.'/authorize_interaction?uri={uri}',
],
], ],
]; ];

View file

@ -83,6 +83,9 @@ class RestrictedNames
'admin', 'admin',
'administrator', 'administrator',
// Federation
'authorize_interaction',
// Static Assets // Static Assets
'assets', 'assets',
'public', 'public',

View file

@ -5,8 +5,11 @@ namespace App\Util\Webfinger;
class Webfinger class Webfinger
{ {
protected $user; protected $user;
protected $subject; protected $subject;
protected $aliases; protected $aliases;
protected $links; protected $links;
public function __construct($user) public function __construct($user)
@ -49,6 +52,10 @@ class Webfinger
'type' => $avatarType, 'type' => $avatarType,
'href' => $avatar, 'href' => $avatar,
], ],
[
'rel' => 'http://ostatus.org/schema/1.0/subscribe',
'template' => 'https://'.config_cache('pixelfed.domain.app').'/authorize_interaction?uri={uri}',
],
]; ];
} }

View file

@ -29,7 +29,7 @@
type="password" type="password"
class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}"
name="password" name="password"
autocomplete="new-password" autocomplete="current-password"
placeholder="{{__('Password')}}" placeholder="{{__('Password')}}"
required> required>

View file

@ -5,6 +5,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::redirect('/home', '/')->name('home'); Route::redirect('/home', '/')->name('home');
Route::get('web/directory', 'LandingController@directoryRedirect'); Route::get('web/directory', 'LandingController@directoryRedirect');
Route::get('web/explore', 'LandingController@exploreRedirect'); Route::get('web/explore', 'LandingController@exploreRedirect');
Route::get('authorize_interaction', 'AuthorizeInteractionController@get');
Auth::routes(); Auth::routes();
Route::get('auth/raw/mastodon/start', 'RemoteAuthController@startRedirect'); Route::get('auth/raw/mastodon/start', 'RemoteAuthController@startRedirect');
@ -67,7 +68,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::get('lang/{locale}', 'SiteController@changeLocale'); Route::get('lang/{locale}', 'SiteController@changeLocale');
Route::get('restored', 'AccountController@accountRestored'); Route::get('restored', 'AccountController@accountRestored');
Route::get('verify-email', 'AccountController@verifyEmail'); Route::get('verify-email', 'AccountController@verifyEmail')->name('account.verify_email');
Route::post('verify-email', 'AccountController@sendVerifyEmail'); Route::post('verify-email', 'AccountController@sendVerifyEmail');
Route::get('verify-email/request', 'InternalApiController@requestEmailVerification'); Route::get('verify-email/request', 'InternalApiController@requestEmailVerification');
Route::post('verify-email/request', 'InternalApiController@requestEmailVerificationStore'); Route::post('verify-email/request', 'InternalApiController@requestEmailVerificationStore');