From 6e3c8097f13bdca8268393f97095bec18c50a8a9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 4 Dec 2022 19:26:27 -0700 Subject: [PATCH 1/2] Update FederationController, add instance actor profile to webfinger --- app/Http/Controllers/FederationController.php | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/FederationController.php b/app/Http/Controllers/FederationController.php index 87a393545..d5189081c 100644 --- a/app/Http/Controllers/FederationController.php +++ b/app/Http/Controllers/FederationController.php @@ -56,12 +56,35 @@ class FederationController extends Controller } $resource = $request->input('resource'); + $domain = config('pixelfed.domain.app'); + + if(config('federation.activitypub.sharedInbox') && + $resource == 'acct:' . $domain . '@' . $domain) { + $res = [ + 'subject' => 'acct:' . $domain . '@' . $domain, + 'aliases' => [ + 'https://' . $domain . '/i/actor' + ], + 'links' => [ + [ + 'rel' => 'http://webfinger.net/rel/profile-page', + 'type' => 'text/html', + 'href' => 'https://' . $domain . '/site/kb/instance-actor' + ], + [ + 'rel' => 'self', + 'type' => 'application/activity+json', + 'href' => 'https://' . $domain . '/i/actor' + ] + ] + ]; + return response()->json($res, 200, [], JSON_UNESCAPED_SLASHES); + } $hash = hash('sha256', $resource); $key = 'federation:webfinger:sha256:' . $hash; if($cached = Cache::get($key)) { return response()->json($cached, 200, [], JSON_UNESCAPED_SLASHES); } - $domain = config('pixelfed.domain.app'); if(strpos($resource, $domain) == false) { return response('', 400); } From 7621baf7c8ee92f5128b4d88fcf48bc43929f773 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 4 Dec 2022 19:26:54 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a944328..60874362f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Update AvatarStorage, improve overview calculations ([733b9fd0](https://github.com/pixelfed/pixelfed/commit/733b9fd0)) - Update filesystem config, fix DO Spaces root default ([720b6eb3](https://github.com/pixelfed/pixelfed/commit/720b6eb3)) - Update Avatar pipeline, fix cloud storage media_path ([02edd19d](https://github.com/pixelfed/pixelfed/commit/02edd19d)) +- Update FederationController, add instance actor profile to webfinger ([6e3c8097](https://github.com/pixelfed/pixelfed/commit/6e3c8097)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)