From 43fbddf016f94f4ba006d82c9a67dca61b5852a1 Mon Sep 17 00:00:00 2001 From: Gab <24553253+gabrix73@users.noreply.github.com> Date: Fri, 14 Aug 2026 20:39:22 +0200 Subject: Complete Nym and YAMN transport integration --- index.php | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 64c47d6..af646a6 100644 --- a/index.php +++ b/index.php @@ -193,12 +193,16 @@ $entryRemailers = getRemailers('entry'); $middleRemailers = getRemailers('middle'); $exitRemailers = getRemailers('exit'); -// If no remailers loaded, try to download them -if (count($entryRemailers) <= 1 && class_exists('SecureRemailerDownloader')) { +// Refresh stale remailer data during a browser reload. The downloader only +// contacts Tor when either local file is missing or older than one day. +if ($_SERVER['REQUEST_METHOD'] === 'GET' && class_exists('SecureRemailerDownloader')) { try { $downloader = new SecureRemailerDownloader(); - $downloader->downloadRemailers(); - // Reload after download + if (!$downloader->downloadRemailers()) { + error_log('Remailer refresh failed; keeping the locally available data.'); + } + + // Reload after a successful refresh, or continue with the local list. $entryRemailers = getRemailers('entry'); $middleRemailers = getRemailers('middle'); $exitRemailers = getRemailers('exit'); @@ -237,24 +241,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { exit; } else { try { - if (isset($_POST['update_remailers'])) { - if (!class_exists('SecureRemailerDownloader')) { - throw new Exception('Remailer list updater is not available.'); - } - - set_time_limit(0); - $downloader = new SecureRemailerDownloader(); - if (!$downloader->forceUpdate()) { - throw new Exception('Remailer list update failed. The previous list was kept where possible.'); - } - - $_SESSION['flash_message'] = 'Remailer list and public keyring updated successfully.'; - $_SESSION['flash_type'] = 'success'; - $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); - header('Location: ' . $_SERVER['PHP_SELF']); - exit; - } - // Get and sanitize form data with additional validation $entryRemailer = isset($_POST['entry_remailer']) ? filter_var($_POST['entry_remailer'], FILTER_SANITIZE_STRING) : ''; $middleRemailer = isset($_POST['middle_remailer']) ? filter_var($_POST['middle_remailer'], FILTER_SANITIZE_STRING) : ''; @@ -319,7 +305,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (function_exists('fastcgi_finish_request')) { $onHandoff = static function () use (&$responseFinished): void { ignore_user_abort(true); - $_SESSION['flash_message'] = 'Message handed to the local Nym transport. The sender is completing delivery in the background; YAMN queues may take several hours, and this confirmation does not mean the message has been published or delivered yet.'; + $_SESSION['flash_message'] = 'Message accepted into the local in-memory Nym queue. Delivery continues in the background; YAMN queues may take several hours, and this confirmation does not mean the message has been published or delivered yet.'; $_SESSION['flash_type'] = 'success'; $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); session_write_close(); @@ -336,7 +322,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!$result['success']) { throw new Exception($result['error'] ?? 'Nym submission failed'); } - $_SESSION['flash_message'] = 'Message accepted by the Nym transport. Delivery through the YAMN queues may take several hours; this confirmation does not mean the message has been published or delivered yet.'; + $_SESSION['flash_message'] = 'Message accepted into the local in-memory Nym queue. Delivery through the YAMN queues may take several hours; this confirmation does not mean the message has been published or delivered yet.'; $_SESSION['flash_type'] = 'success'; $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); header('Location: ' . $_SERVER['PHP_SELF']); @@ -738,7 +724,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {

⚡ YAMN WEB INTERFACE ⚡

-
YAMN composition, local encryption, send-only Nym transport
+
Nym before YAMN: YAMN Web encrypts first, then Nym carries only the opaque envelope
@@ -759,12 +745,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
Remailer data -

The primary statistics source is Victor's YAMN pinger at echolot.virebent.art. Fallback pingers are tried automatically if needed.

-
- - -
- This may take a few minutes because the update uses Tor and tries fallback sources if necessary. +

Remailer statistics and public keys are checked automatically when this page loads. Local data no more than 24 hours old is reused without a network connection.

+ Missing or older data is downloaded through Tor. If a source is unavailable, the existing data remains usable and another download is not attempted until the next daily check.
-- cgit v1.2.3