support for host-meta file
This commit is contained in:
parent
fed5224f46
commit
ebf3d05620
2 changed files with 19 additions and 0 deletions
|
@ -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);
|
||||
|
|
4
templates/federator/host-meta.xml
Normal file
4
templates/federator/host-meta.xml
Normal 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>
|
Loading…
Reference in a new issue