From 2713c1f73a39d4106936d4c52bf8f18d810d7f3c Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 13 Dec 2024 23:53:23 +0000 Subject: add instance information --- routes/nodeinfo.php | 19 +++++++++++++++---- routes/webfinger.php | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'routes') diff --git a/routes/nodeinfo.php b/routes/nodeinfo.php index c29ac0a..93f103c 100644 --- a/routes/nodeinfo.php +++ b/routes/nodeinfo.php @@ -37,10 +37,21 @@ Router::getInstance()->mount('/nodeinfo/2.1', function (array $args) { 'pawpub' => [ 'extensions' => [ // 'https://whatever.example/ext/meow', - ], - // 'pushEndpoint' => path_to_uri('/push'), - // 'authEndpoint' => path_to_uri('/auth') - ], + ] + ] ] ], 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.1#"'); +}); + +Router::getInstance()->mount('/.well-known/pawpub-instance', function (array $args) { + json_response([ + 'name' => 'A Digitigrade server', + 'description' => 'metadata is hardcoded for now', + 'softwareName' => 'Digitigrade', + 'softwareVersion' => '0.1.0', + 'softwareDescription' => 'An experimental PawPub server', + 'endpoints' => [ + + ] + ]); }); \ No newline at end of file diff --git a/routes/webfinger.php b/routes/webfinger.php index cfccb22..541fb06 100644 --- a/routes/webfinger.php +++ b/routes/webfinger.php @@ -4,6 +4,7 @@ use Digitigrade\GlobalConfig; use Digitigrade\HttpResponseStatus\BadRequest; use Digitigrade\HttpResponseStatus\NotFound; use Digitigrade\Model\Actor; +use Digitigrade\Model\ActorWebfinger; use Digitigrade\Router; Router::getInstance()->mount('/.well-known/webfinger', function (array $args) { @@ -27,7 +28,7 @@ Router::getInstance()->mount('/.well-known/webfinger', function (array $args) { 'subject' => "acct:$actor->handle@$remotePart", 'links' => [ [ - 'rel' => Actor::REL_URI, + 'rel' => ActorWebfinger::REL_URI, 'href' => path_to_uri("/user/$actor->handle"), 'type' => 'application/json' ] -- cgit v1.3