From ebf3d05620f738aab940b85eb69f1a95be49c903 Mon Sep 17 00:00:00 2001 From: Sascha Nitsch Date: Mon, 22 Jul 2024 17:38:14 +0200 Subject: [PATCH] support for host-meta file --- php/federator/api/wellknown.php | 15 +++++++++++++++ templates/federator/host-meta.xml | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 templates/federator/host-meta.xml diff --git a/php/federator/api/wellknown.php b/php/federator/api/wellknown.php index c2525fa..6b1e76d 100644 --- a/php/federator/api/wellknown.php +++ b/php/federator/api/wellknown.php @@ -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); diff --git a/templates/federator/host-meta.xml b/templates/federator/host-meta.xml new file mode 100644 index 0000000..0b2b948 --- /dev/null +++ b/templates/federator/host-meta.xml @@ -0,0 +1,4 @@ +version="1.0" encoding="UTF-8"?> + + +