mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Merge pull request #3895 from pixelfed/staging
Update FederationController, add instance actor profile to webfinger
This commit is contained in:
commit
30ac2dbb53
2 changed files with 25 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
||||||
- Update AvatarStorage, improve overview calculations ([733b9fd0](https://github.com/pixelfed/pixelfed/commit/733b9fd0))
|
- 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 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 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/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
||||||
|
|
|
@ -56,12 +56,35 @@ class FederationController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = $request->input('resource');
|
$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);
|
$hash = hash('sha256', $resource);
|
||||||
$key = 'federation:webfinger:sha256:' . $hash;
|
$key = 'federation:webfinger:sha256:' . $hash;
|
||||||
if($cached = Cache::get($key)) {
|
if($cached = Cache::get($key)) {
|
||||||
return response()->json($cached, 200, [], JSON_UNESCAPED_SLASHES);
|
return response()->json($cached, 200, [], JSON_UNESCAPED_SLASHES);
|
||||||
}
|
}
|
||||||
$domain = config('pixelfed.domain.app');
|
|
||||||
if(strpos($resource, $domain) == false) {
|
if(strpos($resource, $domain) == false) {
|
||||||
return response('', 400);
|
return response('', 400);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue