support for host-meta file

develop
Sascha Nitsch 2024-07-22 17:38:14 +02:00
parent fed5224f46
commit ebf3d05620
2 changed files with 19 additions and 0 deletions

View File

@ -37,6 +37,19 @@ class WellKnown implements APIInterface
$this->main = $main;
}
/**
* return host-meta information
*
* @return true
*/
private function hostMeta()
{
$data = [
'fqdn' => $_SERVER['SERVER_NAME']
];
$this->response = $this->main->renderTemplate('host-meta.xml', $data);
return true;
}
/**
* run given url path
*
@ -56,6 +69,8 @@ class WellKnown implements APIInterface
return $ni->exec($paths);
}
switch ($paths[1]) {
case 'host-meta':
return $this->hostMeta();
case 'nodeinfo':
$ni = new WellKnown\NodeInfo($this, $this->main);
return $ni->exec($paths);

View File

@ -0,0 +1,4 @@
version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" template="https://{$fqdn}/.well-known/webfinger?resource={ldelim}uri{rdelim}"/>
</XRD>