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