From 166a69c28263d80cced5d8e1e85dfebfcea72969 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 9 Dec 2023 06:13:30 +1100 Subject: [PATCH 1/2] Add fhublocs module/tool to repository (repair damaged or missing hubloc records) --- Code/Module/Fhublocs.php | 119 +++++++++++++++++++++++++++++++++++++++ Code/Nomad/Receiver.php | 2 + 2 files changed, 121 insertions(+) create mode 100644 Code/Module/Fhublocs.php diff --git a/Code/Module/Fhublocs.php b/Code/Module/Fhublocs.php new file mode 100644 index 000000000..54b1b0728 --- /dev/null +++ b/Code/Module/Fhublocs.php @@ -0,0 +1,119 @@ + $rr['channel_guid'], + 'hubloc_guid_sig' => $rr['channel_guid_sig'], + 'hubloc_hash' => $rr['channel_hash'], + 'hubloc_id_url' => Channel::url($rr), + 'hubloc_addr' => Channel::get_webfinger($rr), + 'hubloc_primary' => intval($primary), + 'hubloc_url' => z_root(), + 'hubloc_url_sig' => Libzot::sign(z_root(), $rr['channel_prvkey']), + 'hubloc_site_id' => Libzot::make_xchan_hash(z_root(), $sitekey), + 'hubloc_host' => App::get_hostname(), + 'hubloc_callback' => z_root() . '/nomad', + 'hubloc_sitekey' => $sitekey, + 'hubloc_network' => 'nomad', + 'hubloc_updated' => datetime_convert(), + 'hubloc_connected' => datetime_convert() + ] + ); + + if ($h) { + $output .= 'local hubloc created for ' . $rr['channel_name'] . EOL; + } + else { + $output .= 'DB update failed for ' . $rr['channel_name'] . EOL; + } + } + + return $output; + } + } +} diff --git a/Code/Nomad/Receiver.php b/Code/Nomad/Receiver.php index 81d110526..26a29dcf2 100644 --- a/Code/Nomad/Receiver.php +++ b/Code/Nomad/Receiver.php @@ -50,8 +50,10 @@ class Receiver if (!$this->Valid_Httpsig()) { logger('signature failed'); + logger(print_r($this->sigdata,true)); $this->error = true; $this->response['message'] = 'signature invalid'; + return; } } From 85602a7b91393728d85a9dafcaec7473adca2284 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Fri, 8 Dec 2023 11:20:18 -0800 Subject: [PATCH 2/2] revision --- version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.php b/version.php index ff0a343b8..d4c727256 100644 --- a/version.php +++ b/version.php @@ -1,2 +1,2 @@