summaryrefslogtreecommitdiffstats
path: root/download_remailers.php
diff options
context:
space:
mode:
authorGab <24553253+gabrix73@users.noreply.github.com>2026-08-13 14:04:30 +0200
committerGab <24553253+gabrix73@users.noreply.github.com>2026-08-13 14:04:30 +0200
commit994071243fc80990cf09e820b671006e9bd31c76 (patch)
treeb65e02724b98033240aa6f9d153acea021abc456 /download_remailers.php
parent47d903de3bca4165e96d6ec8830eafbacf524cd2 (diff)
downloadyamnweb-994071243fc80990cf09e820b671006e9bd31c76.tar.gz
yamnweb-994071243fc80990cf09e820b671006e9bd31c76.tar.xz
yamnweb-994071243fc80990cf09e820b671006e9bd31c76.zip
Separate active YAMN code from Katzenpost PoC
Diffstat (limited to 'download_remailers.php')
-rw-r--r--download_remailers.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/download_remailers.php b/download_remailers.php
index 3b40607..d601ac6 100644
--- a/download_remailers.php
+++ b/download_remailers.php
@@ -61,9 +61,9 @@ class SecureRemailerDownloader {
/**
* Download remailer stats (mlist.txt)
*/
- private function downloadStats() {
+ private function downloadStats(bool $force = false) {
// Check if update is needed (with randomized interval)
- if (!$this->needsUpdate($this->remailersFile)) {
+ if (!$force && !$this->needsUpdate($this->remailersFile)) {
$this->log("Stats update not needed yet");
return true;
}
@@ -109,9 +109,9 @@ class SecureRemailerDownloader {
/**
* Download public keyring (pubring.mix)
*/
- private function downloadKeyring() {
+ private function downloadKeyring(bool $force = false) {
// Check if update is needed (with randomized interval)
- if (!$this->needsUpdate($this->pubringFile)) {
+ if (!$force && !$this->needsUpdate($this->pubringFile)) {
$this->log("Keyring update not needed yet");
return true;
}
@@ -538,8 +538,8 @@ class SecureRemailerDownloader {
* Force update of both stats and keyring
*/
public function forceUpdate() {
- $statsResult = $this->downloadStats();
- $keyringResult = $this->downloadKeyring();
+ $statsResult = $this->downloadStats(true);
+ $keyringResult = $this->downloadKeyring(true);
return $statsResult && $keyringResult;
}
@@ -572,12 +572,4 @@ class SecureRemailerDownloader {
}
}
-// Usage
-try {
- $downloader = new SecureRemailerDownloader();
- $downloader->downloadRemailers();
-} catch (Exception $e) {
- error_log("Remailer download failed: " . $e->getMessage());
-}
?>
-