3 * @file mod/hostxrd.php
6 use Friendica\Core\Config;
7 use Friendica\Core\System;
8 use Friendica\Protocol\Salmon;
9 use Friendica\Util\Crypto;
11 function hostxrd_init(App $a)
13 header('Access-Control-Allow-Origin: *');
14 header("Content-type: text/xml");
15 $pubkey = Config::get('system', 'site_pubkey');
18 $res = Crypto::newKeypair(1024);
20 Config::set('system','site_prvkey', $res['prvkey']);
21 Config::set('system','site_pubkey', $res['pubkey']);
24 $tpl = get_markup_template('xrd_host.tpl');
25 echo replace_macros($tpl, [
26 '$zhost' => $a->get_hostname(),
27 '$zroot' => System::baseUrl(),
28 '$domain' => System::baseUrl(),
29 '$bigkey' => Salmon::salmonKey(Config::get('system', 'site_pubkey'))]