From eabf851ee60d29835d1979f46dcf2b9d82576c1b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 25 Mar 2025 14:02:35 +0300 Subject: [PATCH] revert: Added `TorrentPier instance hash` generation --- README.md | 1 - install/sql/mysql.sql | 3 +-- install/upgrade/legacy-changes.txt | 1 + library/includes/cron/jobs/board_maintenance.php | 5 ----- library/includes/init_bb.php | 5 ----- src/Updater.php | 2 +- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 374dd9a21..8bb82d3db 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ and go from there. The documentation will be translated to english in the near f * High-load capable, heavily configurable announcer * Scrape support * FreeLeech -* [IndexNow](https://www.indexnow.org) support * [TorrServer integration](https://github.com/YouROK/TorrServer) support * BitTorrent v2 support * Event-based invite system diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index c13b460f3..23ed26841 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -600,8 +600,7 @@ VALUES ('allow_autologin', '1'), ('premod', '0'), ('tor_comment', '1'), ('terms', ''), - ('show_board_start_index', '1'), - ('tp_instance_hash', ''); + ('show_board_start_index', '1'); -- ---------------------------- -- Table structure for `bb_cron` diff --git a/install/upgrade/legacy-changes.txt b/install/upgrade/legacy-changes.txt index b7fbc92e0..cb5dfa239 100644 --- a/install/upgrade/legacy-changes.txt +++ b/install/upgrade/legacy-changes.txt @@ -154,3 +154,4 @@ INSERT INTO `bb_config` VALUES ('magnet_links_for_guests', '0'); INSERT INTO `bb_config` VALUES ('tp_instance_hash', ''); // 2.4.5 +DELETE FROM `bb_config` WHERE `config_name` = 'tp_instance_hash'; diff --git a/library/includes/cron/jobs/board_maintenance.php b/library/includes/cron/jobs/board_maintenance.php index 74b28809c..de789f9f8 100644 --- a/library/includes/cron/jobs/board_maintenance.php +++ b/library/includes/cron/jobs/board_maintenance.php @@ -59,10 +59,5 @@ if (IN_DEMO_MODE) { DB()->query("UPDATE " . BB_FORUMS . " SET allow_reg_tracker = 1 WHERE allow_reg_tracker = 0 AND forum_id = 1 LIMIT 1"); } -// Create unique TorrentPier instance hash -if (empty($bb_cfg['tp_instance_hash']) || ($bb_cfg['tp_instance_hash'] !== hash('xxh128', FULL_URL))) { - bb_update_config(['tp_instance_hash' => hash('xxh128', FULL_URL)]); -} - // Check for updates $datastore->update('check_updates'); diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 05d51880c..e9ba19f4b 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -397,11 +397,6 @@ $user = new TorrentPier\Legacy\Common\User(); $userdata =& $user->data; -/** - * Some shared defines - */ -define('TP_INSTANCE_HASH', $bb_cfg['tp_instance_hash']); - /** * Cron */ diff --git a/src/Updater.php b/src/Updater.php index f41277239..5ccba7843 100644 --- a/src/Updater.php +++ b/src/Updater.php @@ -45,7 +45,7 @@ class Updater */ private const STREAM_CONTEXT = [ 'http' => [ - 'header' => 'User-Agent: ' . APP_NAME . '-' . TP_INSTANCE_HASH, + 'header' => 'User-Agent: ' . APP_NAME . '-' . TIMENOW, 'timeout' => 10, 'ignore_errors' => true ]