mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update FederationController
Prevent outbox from returning an actor object so other federation software does not attempt to send inbox requests until the inbox is fully supported.
This commit is contained in:
parent
4b9dd1e312
commit
51aa17052f
3 changed files with 9 additions and 2 deletions
|
@ -123,8 +123,11 @@ class FederationController extends Controller
|
||||||
|
|
||||||
public function userOutbox(Request $request, $username)
|
public function userOutbox(Request $request, $username)
|
||||||
{
|
{
|
||||||
|
if(config('pixelfed.activitypub_enabled') == false) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
|
|
||||||
$user = Profile::whereNull('remote_url')->whereUsername($username)->firstOrFail();
|
$user = Profile::whereNull('remote_url')->whereUsername($username)->firstOrFail();
|
||||||
|
|
||||||
$timeline = $user->statuses()->orderBy('created_at','desc')->paginate(10);
|
$timeline = $user->statuses()->orderBy('created_at','desc')->paginate(10);
|
||||||
$fractal = new Fractal\Manager();
|
$fractal = new Fractal\Manager();
|
||||||
$resource = new Fractal\Resource\Item($user, new ProfileOutbox);
|
$resource = new Fractal\Resource\Item($user, new ProfileOutbox);
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ProfileController extends Controller
|
||||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
||||||
];
|
];
|
||||||
|
|
||||||
if(in_array($request->header('accept'), $mimes)) {
|
if(in_array($request->header('accept'), $mimes) && config('pixelfed.activitypub_enabled')) {
|
||||||
return $this->showActivityPub($request, $user);
|
return $this->showActivityPub($request, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,5 +71,9 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'open_registration' => env('OPEN_REGISTRATION', true),
|
'open_registration' => env('OPEN_REGISTRATION', true),
|
||||||
|
|
||||||
|
'remote_follow_enabled' => env('REMOTE_FOLLOW', false),
|
||||||
|
|
||||||
|
'activitypub_enabled' => env('ACTIVITY_PUB', false),
|
||||||
|
|
||||||
];
|
];
|
Loading…
Reference in a new issue