From d413c717188c9bd906f715e7137955dc9a42a003 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 26 Jan 2025 12:38:47 +0300 Subject: [PATCH 001/238] =?UTF-8?q?feat(captcha):=20Added=20some=20new=20s?= =?UTF-8?q?ervices=20=F0=9F=A4=96=20(#1771)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(captcha): Added some new services * Updated * Updated * Update GoogleCaptchaV2.php * Updated * Updated * Create HCaptcha.php * Update HCaptcha.php * Update HCaptcha.php * Create YandexSmartCaptcha.php * Update YandexSmartCaptcha.php * Create CloudflareTurnstileCaptcha.php * Update CloudflareTurnstileCaptcha.php * Update config.php * Update functions.php * Update functions.php * Update functions.php * Update GoogleCaptchaV3.php * Update GoogleCaptchaV3.php * Update HCaptcha.php * Update YandexSmartCaptcha.php * Update CloudflareTurnstileCaptcha.php * Updated * Updated * Update functions.php * Updated * Updated * Update HCaptcha.php * Updated * Updated * Updated * Update functions.php * Update main.php * Updated * Update HCaptcha.php * Update HCaptcha.php * Update GoogleCaptchaV3.php * Update GoogleCaptchaV3.php * Updated * Updated * Update GoogleCaptchaV2.php * Update GoogleCaptchaV2.php --- library/config.php | 4 +- library/includes/functions.php | 74 +++++++++---------- library/language/source/main.php | 2 +- src/Captcha/CaptchaInterface.php | 38 ++++++++++ src/Captcha/CloudflareTurnstileCaptcha.php | 75 +++++++++++++++++++ src/Captcha/GoogleCaptchaV2.php | 69 ++++++++++++++++++ src/Captcha/GoogleCaptchaV3.php | 70 ++++++++++++++++++ src/Captcha/HCaptcha.php | 76 ++++++++++++++++++++ src/Captcha/YandexSmartCaptcha.php | 84 ++++++++++++++++++++++ 9 files changed, 449 insertions(+), 43 deletions(-) create mode 100644 src/Captcha/CaptchaInterface.php create mode 100644 src/Captcha/CloudflareTurnstileCaptcha.php create mode 100644 src/Captcha/GoogleCaptchaV2.php create mode 100644 src/Captcha/GoogleCaptchaV3.php create mode 100644 src/Captcha/HCaptcha.php create mode 100644 src/Captcha/YandexSmartCaptcha.php diff --git a/library/config.php b/library/config.php index 0390e3905..d9aabae98 100644 --- a/library/config.php +++ b/library/config.php @@ -670,12 +670,12 @@ $bb_cfg['group_avatars'] = [ ]; // Captcha -// Get a Google reCAPTCHA API Key: https://www.google.com/recaptcha/admin $bb_cfg['captcha'] = [ 'disabled' => true, + 'service' => 'googleV3', // Available services: googleV2, googleV3, hCaptcha, yandex, cloudflare 'public_key' => '', 'secret_key' => '', - 'theme' => 'light', // theming (available: light, dark) + 'theme' => 'light', // theming (available: light, dark) (working only if supported by captcha service) ]; // Atom feed diff --git a/library/includes/functions.php b/library/includes/functions.php index 2fc92f90a..edb43d26f 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -2044,56 +2044,50 @@ function hash_search($hash) } /** - * Функция для получения и проверки правильности ответа от Google ReCaptcha. - * - * @param $mode - * @param string $callback + * Function for checking captcha answer * + * @param string $mode * @return bool|string */ -function bb_captcha($mode, $callback = '') +function bb_captcha(string $mode): bool|string { global $bb_cfg, $lang; - $secret = $bb_cfg['captcha']['secret_key']; - $public = $bb_cfg['captcha']['public_key']; - $cp_theme = $bb_cfg['captcha']['theme'] ?? 'light'; + $settings = $bb_cfg['captcha']; + $settings['language'] = $bb_cfg['default_lang']; - if (!$bb_cfg['captcha']['disabled'] && (!$public || !$secret)) { - bb_die($lang['CAPTCHA_SETTINGS']); + // Checking captcha settings + if (!$settings['disabled']) { + if (empty($settings['public_key']) || empty($settings['secret_key'])) { + bb_die($lang['CAPTCHA_SETTINGS']); + } } - $reCaptcha = new \ReCaptcha\ReCaptcha($secret); - - switch ($mode) { - case 'get': - return " - -
- "; - break; - - case 'check': - $resp = $reCaptcha->verify( - request_var('g-recaptcha-response', ''), - $_SERVER["REMOTE_ADDR"] - ); - if ($resp->isSuccess()) { - return true; - } - break; - - default: - bb_simple_die(__FUNCTION__ . ": invalid mode '$mode'"); + // Selecting captcha service + $captchaClasses = [ + 'googleV2' => \TorrentPier\Captcha\GoogleCaptchaV2::class, + 'googleV3' => \TorrentPier\Captcha\GoogleCaptchaV3::class, + 'hCaptcha' => \TorrentPier\Captcha\HCaptcha::class, + 'yandex' => \TorrentPier\Captcha\YandexSmartCaptcha::class, + 'cloudflare' => \TorrentPier\Captcha\CloudflareTurnstileCaptcha::class, + ]; + if (!isset($captchaClasses[$settings['service']])) { + bb_die(sprintf('Captcha service (%s) not supported', $settings['service'])); } + $captchaClass = $captchaClasses[$settings['service']]; + $captcha = new $captchaClass($settings); + + // Selection mode + if (isset($captcha)) { + switch ($mode) { + case 'get': + case 'check': + return $captcha->$mode(); + default: + bb_die(sprintf('Invalid mode: %s', $mode)); + } + } + return false; } diff --git a/library/language/source/main.php b/library/language/source/main.php index 490968965..cd72aba40 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -3080,7 +3080,7 @@ $lang['UPLOAD_ERRORS'] = [ // Captcha $lang['CAPTCHA'] = 'Check that you are not a robot'; $lang['CAPTCHA_WRONG'] = 'You could not confirm that you are not a robot'; -$lang['CAPTCHA_SETTINGS'] = '

ReCaptcha not being fully configured

If you haven\'t already generated the keys, you can do it on https://www.google.com/recaptcha/admin.
After you generate the keys, you need to put them at the file library/config.php.

'; +$lang['CAPTCHA_SETTINGS'] = '

Captcha is not fully configured

Generate the keys using the dashboard of your captcha service, after you need to put them at the file library/config.php.

'; // Sending email $lang['REPLY_TO'] = 'Reply to'; diff --git a/src/Captcha/CaptchaInterface.php b/src/Captcha/CaptchaInterface.php new file mode 100644 index 000000000..21a749182 --- /dev/null +++ b/src/Captcha/CaptchaInterface.php @@ -0,0 +1,38 @@ +settings = $settings; + } + + /** + * Returns captcha widget + * + * @return string + */ + public function get(): string + { + return " + +
+ "; + } + + /** + * Checking captcha answer + * + * @return bool + */ + public function check(): bool + { + $turnstileResponse = $_POST['cf-turnstile-response'] ?? ''; + $postFields = "secret={$this->settings['secret_key']}&response=$turnstileResponse"; + + $ch = curl_init($this->verifyEndpoint); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); + $response = curl_exec($ch); + curl_close($ch); + + $responseData = json_decode($response); + return $responseData->success; + } +} diff --git a/src/Captcha/GoogleCaptchaV2.php b/src/Captcha/GoogleCaptchaV2.php new file mode 100644 index 000000000..a9e01f6ba --- /dev/null +++ b/src/Captcha/GoogleCaptchaV2.php @@ -0,0 +1,69 @@ +settings = $settings; + } + + /** + * Returns captcha widget + * + * @return string + */ + public function get(): string + { + return " + +
+ "; + } + + /** + * Checking captcha answer + * + * @return bool + */ + public function check(): bool + { + $reCaptcha = new ReCaptcha($this->settings['secret_key']); + $resp = $reCaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); + + return $resp->isSuccess(); + } +} diff --git a/src/Captcha/GoogleCaptchaV3.php b/src/Captcha/GoogleCaptchaV3.php new file mode 100644 index 000000000..4a8aed893 --- /dev/null +++ b/src/Captcha/GoogleCaptchaV3.php @@ -0,0 +1,70 @@ +settings = $settings; + } + + /** + * Returns captcha widget + * + * @return string + */ + public function get(): string + { + return " + + + "; + } + + /** + * Checking captcha answer + * + * @return bool + */ + public function check(): bool + { + $reCaptcha = new ReCaptcha($this->settings['secret_key']); + $resp = $reCaptcha + ->setScoreThreshold(0.5) + ->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); + + return $resp->isSuccess(); + } +} diff --git a/src/Captcha/HCaptcha.php b/src/Captcha/HCaptcha.php new file mode 100644 index 000000000..7484a77ff --- /dev/null +++ b/src/Captcha/HCaptcha.php @@ -0,0 +1,76 @@ +settings = $settings; + } + + /** + * Returns captcha widget + * + * @return string + */ + public function get(): string + { + return " +
+ "; + } + + /** + * Checking captcha answer + * + * @return bool + */ + public function check(): bool + { + $data = [ + 'secret' => $this->settings['secret_key'], + 'response' => $_POST['h-captcha-response'] ?? null, + ]; + + $verify = curl_init(); + curl_setopt($verify, CURLOPT_URL, $this->verifyEndpoint); + curl_setopt($verify, CURLOPT_POST, true); + curl_setopt($verify, CURLOPT_POSTFIELDS, http_build_query($data)); + curl_setopt($verify, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($verify); + + $responseData = json_decode($response); + return $responseData->success; + } +} diff --git a/src/Captcha/YandexSmartCaptcha.php b/src/Captcha/YandexSmartCaptcha.php new file mode 100644 index 000000000..e5c77fb5a --- /dev/null +++ b/src/Captcha/YandexSmartCaptcha.php @@ -0,0 +1,84 @@ +settings = $settings; + } + + /** + * Returns captcha widget + * + * @return string + */ + public function get(): string + { + return " + +
"; + } + + /** + * Checking captcha answer + * + * @return bool + */ + public function check(): bool + { + $ch = curl_init($this->verifyEndpoint); + $args = [ + 'secret' => $this->settings['secret_key'], + 'token' => $_POST['smart-token'] ?? null, + 'ip' => $_SERVER['REMOTE_ADDR'], + ]; + + curl_setopt($ch, CURLOPT_TIMEOUT, 1); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($args)); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + $serverOutput = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + if ($httpCode !== 200) { + return true; + } + + $resp = json_decode($serverOutput); + return ($resp->status === 'ok'); + } +} From 6d0bea64d301b6725dc02bd3929e840b229bffd3 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 26 Jan 2025 09:39:02 +0000 Subject: [PATCH 002/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18c102f55..cf425d48e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - *(announcer)* Block `User-Agent` strings that are too long ([#1763](https://github.com/torrentpier/torrentpier/pull/1763)) - ([a98f8f1](https://github.com/torrentpier/torrentpier/commit/a98f8f102a8253b0b22c80ef444fed1ec29177f3)) - *(announcer)* Blocking all ports lower then `1024` ([#1762](https://github.com/torrentpier/torrentpier/pull/1762)) - ([1bc7e09](https://github.com/torrentpier/torrentpier/commit/1bc7e09ddbeaf680b86095eed9a80b8ebf6169b3)) - *(cache)* Checking if extensions are installed ([#1759](https://github.com/torrentpier/torrentpier/pull/1759)) - ([7f31022](https://github.com/torrentpier/torrentpier/commit/7f31022cfca2acb28a5cba06961eeaf8d2c9de51)) +- *(captcha)* Added some new services 🤖 ([#1771](https://github.com/torrentpier/torrentpier/pull/1771)) - ([d413c71](https://github.com/torrentpier/torrentpier/commit/d413c717188c9bd906f715e7137955dc9a42a003)) - *(installer)* Fully show non-installed extensions ([#1761](https://github.com/torrentpier/torrentpier/pull/1761)) - ([8fcc62d](https://github.com/torrentpier/torrentpier/commit/8fcc62d2a2fd41927b2f5dae215fe5bbf95f2c96)) - *(installer)* More explanations ([#1758](https://github.com/torrentpier/torrentpier/pull/1758)) - ([48ab52a](https://github.com/torrentpier/torrentpier/commit/48ab52ac8674afcb607c8e49134316a3e117236a)) - *(installer)* Check `Composer` dependencies after installing ([#1756](https://github.com/torrentpier/torrentpier/pull/1756)) - ([262b887](https://github.com/torrentpier/torrentpier/commit/262b8872a5b14068eb73d745adea6203c557e192)) From 53ebfef32c0e9016257e03b96ef96349e22d3e9b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 26 Jan 2025 16:07:41 +0300 Subject: [PATCH 003/238] misc(issue template): Improved `Bug report` template (#1773) --- .github/ISSUE_TEMPLATE/bug_report.md | 35 --------------- .github/ISSUE_TEMPLATE/bug_report.yml | 62 +++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 35 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index b73537336..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..59a363c2b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,62 @@ +name: Bug Report +description: File a bug report +title: "[Bug]" +labels: Bug,Fund +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + The more detailed this bug report is, the faster it can be reviewed and fixed. + - type: input + id: version-torrentpier + attributes: + label: TorrentPier Version + description: TorrentPier version your using? + placeholder: 2.4.0 + validations: + required: true + - type: input + id: version-php-os + attributes: + label: PHP & Platform + description: Exact PHP and Platform (OS) versions your using. + placeholder: 8.1.2 - Ubuntu 22.04 x64 + validations: + required: true + - type: checkboxes + id: requirements + attributes: + label: Have you done this? + options: + - label: I am willing to share my stack trace and logs + required: true + - label: I can suggest a fix as a Pull Request + required: false + - type: textarea + id: expectation + attributes: + label: Expectation + description: Write what you expect to (correctly) happen. + placeholder: When I do this, I expect to this to happen. + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: Write what (incorrectly) happens instead. + placeholder: Instead, when I do this, I receive that. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Stack trace & logs + description: | + If you have a stack trace, you can copy it here. You may hide sensitive information. + Including a stack trace when reporting an error 500 is required. + placeholder: This is automatically formatted into code, no need for backticks. + render: shell + validations: + required: false From 42435f5dd900c775446944d755d967b9833ae589 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 26 Jan 2025 13:08:01 +0000 Subject: [PATCH 004/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf425d48e..704fd8d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - *(cliff)* Fixed typo ([#1747](https://github.com/torrentpier/torrentpier/pull/1747)) - ([4936af7](https://github.com/torrentpier/torrentpier/commit/4936af7d3d10f553d8586a14de249c32e50f3494)) - *(cliff)* Notice about previous changelog file ([#1746](https://github.com/torrentpier/torrentpier/pull/1746)) - ([85395be](https://github.com/torrentpier/torrentpier/commit/85395be5e7c6a891c79ec72cf215894af097f819)) - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) +- *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) - Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8)) - Enabled `$bb_cfg['integrity_check']` by defaul ([#1742](https://github.com/torrentpier/torrentpier/pull/1742)) - ([7e3601e](https://github.com/torrentpier/torrentpier/commit/7e3601e63aff73be1428969ca37dda3da2537d9b)) From 268f79d7259de67aa8877fcf7130ff0069469ab2 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 26 Jan 2025 16:17:30 +0300 Subject: [PATCH 005/238] misc(issue template): Improved `Feature request` template (#1774) * misc(issue template): Improved `Feature request` template * Update bug_report.yml * Update feature---enhancement-request.md --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .../feature---enhancement-request.md | 7 +++++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 ----------------- 3 files changed, 8 insertions(+), 18 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/feature---enhancement-request.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 59a363c2b..799818d98 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,7 @@ name: Bug Report description: File a bug report title: "[Bug]" -labels: Bug,Fund +labels: Bug body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature---enhancement-request.md b/.github/ISSUE_TEMPLATE/feature---enhancement-request.md new file mode 100644 index 000000000..dafdbd2ec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature---enhancement-request.md @@ -0,0 +1,7 @@ +--- +name: Feature / Enhancement request +about: Suggest an idea for TorrentPier +title: "[Feature]" +labels: Feature, Enhancement +assignees: '' +--- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 066b2d920..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. From d284b88a5c2408431a78e09280454abc6b260fa5 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 26 Jan 2025 13:17:47 +0000 Subject: [PATCH 006/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 704fd8d57..b464463b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - *(cliff)* Fixed typo ([#1747](https://github.com/torrentpier/torrentpier/pull/1747)) - ([4936af7](https://github.com/torrentpier/torrentpier/commit/4936af7d3d10f553d8586a14de249c32e50f3494)) - *(cliff)* Notice about previous changelog file ([#1746](https://github.com/torrentpier/torrentpier/pull/1746)) - ([85395be](https://github.com/torrentpier/torrentpier/commit/85395be5e7c6a891c79ec72cf215894af097f819)) - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) +- *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) - Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8)) From cd2786bb69c74cec88a447f66750d014fc4d3612 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 26 Jan 2025 16:45:22 +0300 Subject: [PATCH 007/238] removed(environment): Extra `DB_CONNECTION` variable (#1775) --- .env.example | 1 - library/language/source/main.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.env.example b/.env.example index d9aa2df2a..5da8c024d 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,6 @@ APP_CRON_ENABLED=true APP_DEMO_MODE=false # Database credentials -DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=torrentpier diff --git a/library/language/source/main.php b/library/language/source/main.php index cd72aba40..54eaa82d6 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1604,7 +1604,7 @@ $lang['ONLY_FOR_SUPER_ADMIN'] = 'This option only for super admins'; $lang['LOGS'] = 'Topic history'; $lang['FORUM_LOGS'] = 'History Forum'; -$lang['AUTOCLEAN'] = 'Autoclean:'; +$lang['AUTOCLEAN'] = 'Autoclean'; $lang['DESIGNER'] = 'Designer'; $lang['LAST_IP'] = 'Last IP:'; From 3f8107cedbf240779a294c0588af1846aba376c6 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 26 Jan 2025 13:45:40 +0000 Subject: [PATCH 008/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b464463b9..781618a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ ### 🗑️ Removed +- *(environment)* Extra `DB_CONNECTION` variable ([#1775](https://github.com/torrentpier/torrentpier/pull/1775)) - ([cd2786b](https://github.com/torrentpier/torrentpier/commit/cd2786bb69c74cec88a447f66750d014fc4d3612)) - Some unused tracker config variables ([#1769](https://github.com/torrentpier/torrentpier/pull/1769)) - ([7f9df35](https://github.com/torrentpier/torrentpier/commit/7f9df35d3bd0e9d23284b8bd9c36a0f52158f5d7)) ### 📚 Documentation From 970a0282e3631c403029c959ffd46b21c5cad0cd Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 27 Jan 2025 19:21:50 +0300 Subject: [PATCH 009/238] misc(readme): Added Caddy webserver (#1778) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06db7091d..926740fa5 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ and go from there. The documentation will be translated into english in the near ## 🔧 Requirements -* Apache / nginx +* Apache, nginx, caddy * MySQL 5.5.3 or above / MariaDB 10.0 or above / Percona * PHP: 8.1 / 8.2 / 8.3 * PHP Extensions: mbstring, gd, bcmath, intl, tidy (optional), xml, xmlwriter From 92344bb8de5261b561d20f24697860967075c3c3 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 27 Jan 2025 16:22:07 +0000 Subject: [PATCH 010/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 781618a8f..5e7847951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) +- *(readme)* Added Caddy webserver ([#1778](https://github.com/torrentpier/torrentpier/pull/1778)) - ([970a028](https://github.com/torrentpier/torrentpier/commit/970a0282e3631c403029c959ffd46b21c5cad0cd)) - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) - Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8)) - Enabled `$bb_cfg['integrity_check']` by defaul ([#1742](https://github.com/torrentpier/torrentpier/pull/1742)) - ([7e3601e](https://github.com/torrentpier/torrentpier/commit/7e3601e63aff73be1428969ca37dda3da2537d9b)) From a71609ba67a89480fabb7b62de450d9be09373fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:22:33 +0300 Subject: [PATCH 011/238] Composer(deps): Bump filp/whoops from 2.16.0 to 2.17.0 (#1777) Bumps [filp/whoops](https://github.com/filp/whoops) from 2.16.0 to 2.17.0. - [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md) - [Commits](https://github.com/filp/whoops/compare/2.16.0...2.17.0) --- updated-dependencies: - dependency-name: filp/whoops dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 04f5fd99c..3322ee866 100644 --- a/composer.lock +++ b/composer.lock @@ -738,16 +738,16 @@ }, { "name": "filp/whoops", - "version": "2.16.0", + "version": "2.17.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" + "reference": "075bc0c26631110584175de6523ab3f1652eb28e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", - "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", + "url": "https://api.github.com/repos/filp/whoops/zipball/075bc0c26631110584175de6523ab3f1652eb28e", + "reference": "075bc0c26631110584175de6523ab3f1652eb28e", "shasum": "" }, "require": { @@ -797,7 +797,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.16.0" + "source": "https://github.com/filp/whoops/tree/2.17.0" }, "funding": [ { @@ -805,7 +805,7 @@ "type": "github" } ], - "time": "2024-09-25T12:00:00+00:00" + "time": "2025-01-25T12:00:00+00:00" }, { "name": "gemorroj/m3u-parser", From 420c92c0addf4dee91f3ae872517cb3224827a1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:22:51 +0300 Subject: [PATCH 012/238] Composer(deps): Bump jacklul/monolog-telegram from 3.1.0 to 3.2.0 (#1776) Bumps [jacklul/monolog-telegram](https://github.com/jacklul/monolog-telegram) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/jacklul/monolog-telegram/releases) - [Commits](https://github.com/jacklul/monolog-telegram/compare/3.1.0...3.2.0) --- updated-dependencies: - dependency-name: jacklul/monolog-telegram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 3322ee866..8380b703b 100644 --- a/composer.lock +++ b/composer.lock @@ -1353,16 +1353,16 @@ }, { "name": "jacklul/monolog-telegram", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/jacklul/monolog-telegram.git", - "reference": "ec8674fbd280bbb369b5f48447259e44a92f39c8" + "reference": "1f2069f5556b1c8d6eb2d8b8ac29ff376675cf46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jacklul/monolog-telegram/zipball/ec8674fbd280bbb369b5f48447259e44a92f39c8", - "reference": "ec8674fbd280bbb369b5f48447259e44a92f39c8", + "url": "https://api.github.com/repos/jacklul/monolog-telegram/zipball/1f2069f5556b1c8d6eb2d8b8ac29ff376675cf46", + "reference": "1f2069f5556b1c8d6eb2d8b8ac29ff376675cf46", "shasum": "" }, "require": { @@ -1410,7 +1410,7 @@ "issues": "https://github.com/jacklul/monolog-telegram/issues", "source": "https://github.com/jacklul/monolog-telegram" }, - "time": "2023-11-21T18:26:36+00:00" + "time": "2025-01-24T18:07:58+00:00" }, { "name": "josantonius/cookie", From 08aa18fdfbde87adfa83a537e0e16dcb1b300a2d Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 27 Jan 2025 16:23:15 +0000 Subject: [PATCH 013/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7847951..e5ada58f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ ### 📦 Dependencies +- *(deps)* Bump jacklul/monolog-telegram from 3.1.0 to 3.2.0 ([#1776](https://github.com/torrentpier/torrentpier/pull/1776)) - ([420c92c](https://github.com/torrentpier/torrentpier/commit/420c92c0addf4dee91f3ae872517cb3224827a1f)) +- *(deps)* Bump filp/whoops from 2.16.0 to 2.17.0 ([#1777](https://github.com/torrentpier/torrentpier/pull/1777)) - ([a71609b](https://github.com/torrentpier/torrentpier/commit/a71609ba67a89480fabb7b62de450d9be09373fa)) - *(deps)* Bump php-curl-class/php-curl-class from 11.0.0 to 11.0.1 ([#1753](https://github.com/torrentpier/torrentpier/pull/1753)) - ([ce32031](https://github.com/torrentpier/torrentpier/commit/ce32031a0fb14cdf6c3f4ba379b530cbb52b0fea)) - *(deps)* Bump bugsnag/bugsnag from 3.29.1 to 3.29.2 ([#1752](https://github.com/torrentpier/torrentpier/pull/1752)) - ([f63d15c](https://github.com/torrentpier/torrentpier/commit/f63d15c49e3992837413b2c7a0160d599b44f2ef)) From 5b0ed020890a8f938df912f9215cccbda42b0317 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 27 Jan 2025 19:24:32 +0300 Subject: [PATCH 014/238] misc(readme): Minor improvements (#1779) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 926740fa5..3ea4bca09 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ and go from there. The documentation will be translated into english in the near ## 🔧 Requirements -* Apache, nginx, caddy +* Apache / nginx / caddy * MySQL 5.5.3 or above / MariaDB 10.0 or above / Percona * PHP: 8.1 / 8.2 / 8.3 * PHP Extensions: mbstring, gd, bcmath, intl, tidy (optional), xml, xmlwriter From e4242fc6de7fb9ed5b77b7e4a1fa2f6a1a806efa Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 27 Jan 2025 16:24:50 +0000 Subject: [PATCH 015/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ada58f3..4a3fb6df0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) +- *(readme)* Minor improvements ([#1779](https://github.com/torrentpier/torrentpier/pull/1779)) - ([5b0ed02](https://github.com/torrentpier/torrentpier/commit/5b0ed020890a8f938df912f9215cccbda42b0317)) - *(readme)* Added Caddy webserver ([#1778](https://github.com/torrentpier/torrentpier/pull/1778)) - ([970a028](https://github.com/torrentpier/torrentpier/commit/970a0282e3631c403029c959ffd46b21c5cad0cd)) - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) - Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8)) From e51e09159333382a77b809b5f1da5e152a713143 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 27 Jan 2025 19:48:27 +0300 Subject: [PATCH 016/238] feat(environment): Make configurable `TP_HOST` and `TP_PORT` (#1780) --- .env.example | 2 ++ library/config.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 5da8c024d..c0776eda9 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,6 @@ # Common params +TP_HOST=example.com +TP_PORT=80 APP_ENV=production APP_CRON_ENABLED=true APP_DEMO_MODE=false diff --git a/library/config.php b/library/config.php index d9aabae98..7cf586bf1 100644 --- a/library/config.php +++ b/library/config.php @@ -12,8 +12,8 @@ if (!defined('BB_ROOT')) { } // Server settings -$reserved_name = 'example.com'; -$reserved_port = 80; +$reserved_name = env('TP_HOST', 'example.com'); +$reserved_port = env('TP_PORT', 80); $bb_cfg = []; From c96f2807e6e64b95dcad3fa8a6661d63dc5a4f5b Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 27 Jan 2025 16:48:47 +0000 Subject: [PATCH 017/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a3fb6df0..bbeef6d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - *(announcer)* Blocking all ports lower then `1024` ([#1762](https://github.com/torrentpier/torrentpier/pull/1762)) - ([1bc7e09](https://github.com/torrentpier/torrentpier/commit/1bc7e09ddbeaf680b86095eed9a80b8ebf6169b3)) - *(cache)* Checking if extensions are installed ([#1759](https://github.com/torrentpier/torrentpier/pull/1759)) - ([7f31022](https://github.com/torrentpier/torrentpier/commit/7f31022cfca2acb28a5cba06961eeaf8d2c9de51)) - *(captcha)* Added some new services 🤖 ([#1771](https://github.com/torrentpier/torrentpier/pull/1771)) - ([d413c71](https://github.com/torrentpier/torrentpier/commit/d413c717188c9bd906f715e7137955dc9a42a003)) +- *(environment)* Make configurable `TP_HOST` and `TP_PORT` ([#1780](https://github.com/torrentpier/torrentpier/pull/1780)) - ([e51e091](https://github.com/torrentpier/torrentpier/commit/e51e09159333382a77b809b5f1da5e152a713143)) - *(installer)* Fully show non-installed extensions ([#1761](https://github.com/torrentpier/torrentpier/pull/1761)) - ([8fcc62d](https://github.com/torrentpier/torrentpier/commit/8fcc62d2a2fd41927b2f5dae215fe5bbf95f2c96)) - *(installer)* More explanations ([#1758](https://github.com/torrentpier/torrentpier/pull/1758)) - ([48ab52a](https://github.com/torrentpier/torrentpier/commit/48ab52ac8674afcb607c8e49134316a3e117236a)) - *(installer)* Check `Composer` dependencies after installing ([#1756](https://github.com/torrentpier/torrentpier/pull/1756)) - ([262b887](https://github.com/torrentpier/torrentpier/commit/262b8872a5b14068eb73d745adea6203c557e192)) From e579b816b4dc346b3242cb3d9db292ad05596c1f Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 27 Jan 2025 20:23:04 +0300 Subject: [PATCH 018/238] misc(readme): Improved installation guide (#1781) * misc(readme): Improved installation guide * Update README.md * Update README.md * Update README.md * Update README.md --- README.md | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3ea4bca09..59cdc8af9 100644 --- a/README.md +++ b/README.md @@ -74,17 +74,32 @@ Check out our [autoinstall](https://github.com/torrentpier/autoinstall) reposito ### Quick (For web-panels) ☕️ -1. Select the folder where you want to install TorrentPier (`cd /path/to/public_html`) -2. Download latest version of TorrentPier (`sudo git clone https://github.com/torrentpier/torrentpier.git .`) -3. After, run `php install.php` and follow the given steps +1. Select the folder where you want to install TorrentPier + ```shell + cd /path/to/public_html + ``` +2. Download latest version of TorrentPier + ```shell + sudo git clone https://github.com/torrentpier/torrentpier.git . + ``` +3. After, run command below and follow the given steps + ```shell + php install.php + ``` 4. Voila! ✨ ### Manual 🔩 1. Install [Composer](https://getcomposer.org/) -2. Run `composer create-project torrentpier/torrentpier` +2. Run command below to create TorrentPier project + ```shell + composer create-project torrentpier/torrentpier + ``` 3. [Check our system requirements](#-requirements) -4. After, run `composer install` on the project directory +4. After, run command below on the project directory, to install Composer dependencies + ```shell + composer install + ``` 5. Create database and import dump located at `install/sql/mysql.sql` 6. Edit database configuration settings in the environment (`.env.example`), after, rename to `.env` 7. Provide write permissions to the specified folders: @@ -98,11 +113,10 @@ Check out our [autoinstall](https://github.com/torrentpier/autoinstall) reposito ### Additional steps 👣 -1. Edit domain name and domain port in the configuration file or a local copy (`$reserved_name` and `$reserved_port`) -2. Edit this files: +1. Edit this files: * `favicon.png` (change on your own) * `robots.txt` (change the addresses in lines `Host` and `Sitemap` on your own) -3. Log in to the forum with **admin/admin** login/password and finish setting up via admin panel +2. Log in to the forum with **admin/admin** login/password and finish setting up via admin panel ## 🔐 Security vulnerabilities @@ -134,12 +148,18 @@ Support this project by becoming a sponsor or a backer.
Monero - 42zJE3FDvN8foP9QYgDrBjgtd7h2FipGCGmAcmG5VFQuRkJBGMbCvoLSmivepmAMEgik2E8MPWUzKaoYsGCtmhvL7ZN73jh + +``` +42zJE3FDvN8foP9QYgDrBjgtd7h2FipGCGmAcmG5VFQuRkJBGMbCvoLSmivepmAMEgik2E8MPWUzKaoYsGCtmhvL7ZN73jh +```
YooMoney - 4100118022415720 + +``` +4100118022415720 +```
## 📦 Versioning From d461b39e18e9e956ae02ec8f629bccb7f6f5f79c Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 27 Jan 2025 17:23:23 +0000 Subject: [PATCH 019/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbeef6d7c..b286f4ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) +- *(readme)* Improved installation guide ([#1781](https://github.com/torrentpier/torrentpier/pull/1781)) - ([e579b81](https://github.com/torrentpier/torrentpier/commit/e579b816b4dc346b3242cb3d9db292ad05596c1f)) - *(readme)* Minor improvements ([#1779](https://github.com/torrentpier/torrentpier/pull/1779)) - ([5b0ed02](https://github.com/torrentpier/torrentpier/commit/5b0ed020890a8f938df912f9215cccbda42b0317)) - *(readme)* Added Caddy webserver ([#1778](https://github.com/torrentpier/torrentpier/pull/1778)) - ([970a028](https://github.com/torrentpier/torrentpier/commit/970a0282e3631c403029c959ffd46b21c5cad0cd)) - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) From 314c592affbef4b8db48d562b9633aad27059a76 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 30 Jan 2025 19:08:00 +0300 Subject: [PATCH 020/238] feat(torrent): Bring back old torrent file naming (#1783) * feat(torrent): Bring back old torrent file naming * Update displaying_torrent.php * Update Torrent.php --- library/attach_mod/displaying_torrent.php | 8 ++++++-- library/config.php | 3 ++- src/Legacy/Torrent.php | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index 604c5bf2e..373b6b863 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -79,7 +79,7 @@ $tor_auth_del = ($tor_auth && $tor_reged); $tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO']; $download_link = DL_URL . $attach_id; -$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name); +$description = ($comment) ?: preg_replace("#" . "." . TORRENT_EXT . "$#i", '', $display_name); if ($tor_auth_reg || $tor_auth_del) { $reg_tor_url = '' . $lang['BT_REG_ON_TRACKER'] . ''; @@ -88,7 +88,11 @@ if ($tor_auth_reg || $tor_auth_del) { $tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url; } -$display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT; +if ($bb_cfg['tracker']['use_old_torrent_name_format']) { + $display_name = '[' . $bb_cfg['server_name'] . '].t' . $bt_topic_id . '.' . TORRENT_EXT; +} else { + $display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT; +} if (!$tor_reged) { $template->assign_block_vars('postrow.attach.tor_not_reged', [ diff --git a/library/config.php b/library/config.php index 7cf586bf1..3f60765c0 100644 --- a/library/config.php +++ b/library/config.php @@ -736,7 +736,8 @@ $bb_cfg['tracker'] = [ 'gold_silver_enabled' => true, // golden / silver days mode (If enabled, then disable "freeleech") 'hybrid_stat_protocol' => 1, // For hybrid torrents there are two identical requests sent by clients, for counting stats we gotta choose one, you can change this to '2' in future, when v1 protocol is outdated 'disabled_v1_torrents' => false, // disallow registration of v1-only torrents, for future implementations where client will use v2 only and there won't be need for v1, thus relieving tracker - 'disabled_v2_torrents' => false // disallow registration of v2-only torrents + 'disabled_v2_torrents' => false, // disallow registration of v2-only torrents + 'use_old_torrent_name_format' => false, // when enabled, the names of torrent files will have the classic format: [yoursite.com].txxx.torrent ]; // Ratio settings diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index 7489b10ac..791ff30bd 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -644,7 +644,11 @@ class Torrent // Send torrent $output = Bencode::encode($tor); - $dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT; + if ($bb_cfg['tracker']['use_old_torrent_name_format']) { + $dl_fname = '[' . $bb_cfg['server_name'] . '].t' . $topic_id . '.' . TORRENT_EXT; + } else { + $dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT; + } if (!empty($_COOKIE['explain'])) { $out = "attach path: $filename

"; From b51b226bde8888b7466886116bdfdb1efa9a8816 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Thu, 30 Jan 2025 16:08:18 +0000 Subject: [PATCH 021/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b286f4ee6..6b78645d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - *(installer)* Check `Composer` dependencies after installing ([#1756](https://github.com/torrentpier/torrentpier/pull/1756)) - ([262b887](https://github.com/torrentpier/torrentpier/commit/262b8872a5b14068eb73d745adea6203c557e192)) - *(installer)* More explanations ([#1754](https://github.com/torrentpier/torrentpier/pull/1754)) - ([fd6f1f8](https://github.com/torrentpier/torrentpier/commit/fd6f1f86a5e9216469cd648601ecb9ba875f9eb6)) - *(installer)* Create `config.local.php` on local environment ([#1745](https://github.com/torrentpier/torrentpier/pull/1745)) - ([0d93b2c](https://github.com/torrentpier/torrentpier/commit/0d93b2c768c2965c12ac62e2f3b2886dc1ef31c2)) +- *(torrent)* Bring back old torrent file naming ([#1783](https://github.com/torrentpier/torrentpier/pull/1783)) - ([314c592](https://github.com/torrentpier/torrentpier/commit/314c592affbef4b8db48d562b9633aad27059a76)) - Used `TORRENT_MIMETYPE` constant instead of hardcoded string ([#1757](https://github.com/torrentpier/torrentpier/pull/1757)) - ([4b0d270](https://github.com/torrentpier/torrentpier/commit/4b0d270c89ec06abed590504f6a0cb70076a9e59)) ### 🐛 Bug Fixes From b06e327cbb285a676814699eb5fb1fbc0e1f22e8 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 30 Jan 2025 19:17:38 +0300 Subject: [PATCH 022/238] fix(announcer): Null `event` exception (#1784) --- bt/announce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bt/announce.php b/bt/announce.php index 5c8961fb0..6f4d900de 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -99,7 +99,7 @@ if (!isset($info_hash)) { * * @see https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/c64275f0b5dcb3c4c845d5204871adfe24f359d6/app/Http/Controllers/AnnounceController.php#L275 */ -$event = strtolower($event); +$event = strtolower((string)$event); if (!in_array($event, ['started', 'completed', 'stopped', 'paused', ''])) { msg_die('Invalid event: ' . $event); } From 0a423834a78ae75aa04aa59fdedc560f238606ac Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Thu, 30 Jan 2025 16:17:54 +0000 Subject: [PATCH 023/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b78645d7..20174ae44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ ### 🐛 Bug Fixes +- *(announcer)* Null `event` exception ([#1784](https://github.com/torrentpier/torrentpier/pull/1784)) - ([b06e327](https://github.com/torrentpier/torrentpier/commit/b06e327cbb285a676814699eb5fb1fbc0e1f22e8)) - *(bb_die)* HTML characters converting ([#1744](https://github.com/torrentpier/torrentpier/pull/1744)) - ([4f1c7e4](https://github.com/torrentpier/torrentpier/commit/4f1c7e40d82e52f81eba44ead501e1f01058cc4f)) - *(debug)* Disabled `Bugsnag` reporting on local environment ([#1751](https://github.com/torrentpier/torrentpier/pull/1751)) - ([1f3b629](https://github.com/torrentpier/torrentpier/commit/1f3b629e9cea4d11fbf3cf29f575ba730bad898d)) - *(installer)* Missing `gd` extension ([#1749](https://github.com/torrentpier/torrentpier/pull/1749)) - ([a1c519d](https://github.com/torrentpier/torrentpier/commit/a1c519d938b848edffcbf7fbbe6a3fdb9a5394f1)) From 387a25870abd37b641b55ffd98e13f4aaecb73b1 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 30 Jan 2025 20:10:47 +0300 Subject: [PATCH 024/238] misc(database): Use `DEFAULT ''` for `privmsgs_subject` (#1786) * fix(posting): Exception on too long topic title * Update mysql.sql --- install/sql/mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 71d05fb14..c13b460f3 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -1047,7 +1047,7 @@ CREATE TABLE IF NOT EXISTS `bb_privmsgs` ( `privmsgs_id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT, `privmsgs_type` TINYINT(4) NOT NULL DEFAULT '0', - `privmsgs_subject` VARCHAR(255) NOT NULL DEFAULT '0', + `privmsgs_subject` VARCHAR(255) NOT NULL DEFAULT '', `privmsgs_from_userid` MEDIUMINT(8) NOT NULL DEFAULT '0', `privmsgs_to_userid` MEDIUMINT(8) NOT NULL DEFAULT '0', `privmsgs_date` INT(11) NOT NULL DEFAULT '0', From 14714716b7ae0cdd9f04d7d2382bb665e60adc01 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Thu, 30 Jan 2025 17:11:05 +0000 Subject: [PATCH 025/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20174ae44..add238688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ - *(cliff)* Fixed typo ([#1747](https://github.com/torrentpier/torrentpier/pull/1747)) - ([4936af7](https://github.com/torrentpier/torrentpier/commit/4936af7d3d10f553d8586a14de249c32e50f3494)) - *(cliff)* Notice about previous changelog file ([#1746](https://github.com/torrentpier/torrentpier/pull/1746)) - ([85395be](https://github.com/torrentpier/torrentpier/commit/85395be5e7c6a891c79ec72cf215894af097f819)) - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) +- *(database)* Use `DEFAULT ''` for `privmsgs_subject` ([#1786](https://github.com/torrentpier/torrentpier/pull/1786)) - ([387a258](https://github.com/torrentpier/torrentpier/commit/387a25870abd37b641b55ffd98e13f4aaecb73b1)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) - *(readme)* Improved installation guide ([#1781](https://github.com/torrentpier/torrentpier/pull/1781)) - ([e579b81](https://github.com/torrentpier/torrentpier/commit/e579b816b4dc346b3242cb3d9db292ad05596c1f)) From 4333d6aca4aeb8584ff8a8ef0bf76c537a3f371a Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 1 Feb 2025 07:26:39 +0300 Subject: [PATCH 026/238] feat(workflow): Automated deploy actual changes to `TorrentPier Demo` (#1788) * feat(workflow): Automated deploy actual changes to TorrentPier Demo * Update deploy.yml * Update README.md * Update README.md * Update README.md * Update README.md --- .github/workflows/deploy.yml | 33 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..ed66078fe --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: Deploy to TorrentPier Demo + +on: + push: + branches: + - master + +jobs: + deploy: + name: 🎉 Deploy + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v4 + + - name: 🔩 Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: 🖇 Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: 📂 Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: ${{ secrets.FTP_SERVER }} + username: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + exclude: | + **/.git* + **/.git*/** + .env diff --git a/README.md b/README.md index 59cdc8af9..93a1d58ac 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Version Last release Size + Deployed to TorrentPier Demo with FTP Deploy Action

## 🐂 About TorrentPier From a8e53cb37c372e23a12f3409c80db478c7e259a8 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sat, 1 Feb 2025 04:26:57 +0000 Subject: [PATCH 027/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index add238688..ee9880eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - *(installer)* More explanations ([#1754](https://github.com/torrentpier/torrentpier/pull/1754)) - ([fd6f1f8](https://github.com/torrentpier/torrentpier/commit/fd6f1f86a5e9216469cd648601ecb9ba875f9eb6)) - *(installer)* Create `config.local.php` on local environment ([#1745](https://github.com/torrentpier/torrentpier/pull/1745)) - ([0d93b2c](https://github.com/torrentpier/torrentpier/commit/0d93b2c768c2965c12ac62e2f3b2886dc1ef31c2)) - *(torrent)* Bring back old torrent file naming ([#1783](https://github.com/torrentpier/torrentpier/pull/1783)) - ([314c592](https://github.com/torrentpier/torrentpier/commit/314c592affbef4b8db48d562b9633aad27059a76)) +- *(workflow)* Automated deploy actual changes to `TorrentPier Demo` ([#1788](https://github.com/torrentpier/torrentpier/pull/1788)) - ([4333d6a](https://github.com/torrentpier/torrentpier/commit/4333d6aca4aeb8584ff8a8ef0bf76c537a3f371a)) - Used `TORRENT_MIMETYPE` constant instead of hardcoded string ([#1757](https://github.com/torrentpier/torrentpier/pull/1757)) - ([4b0d270](https://github.com/torrentpier/torrentpier/commit/4b0d270c89ec06abed590504f6a0cb70076a9e59)) ### 🐛 Bug Fixes From 6115900b765752209a6ed1dfb83e4f0cbee2ae77 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 1 Feb 2025 07:33:51 +0300 Subject: [PATCH 028/238] misc(deploy action): Specify some missing params (#1789) --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ed66078fe..868d8645e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,6 +27,9 @@ jobs: server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} + server-dir: ${{ secrets.FTP_DIR }} + protocol: ${{ secrets.FTP_PROTOCOL }} + port: ${{ secrets.FTP_PORT }} exclude: | **/.git* **/.git*/** From 9eb0aede734912dfb551dcaa797b570deb58daa1 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sat, 1 Feb 2025 04:34:07 +0000 Subject: [PATCH 029/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9880eb7..0372aa16b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ - *(cliff)* Notice about previous changelog file ([#1746](https://github.com/torrentpier/torrentpier/pull/1746)) - ([85395be](https://github.com/torrentpier/torrentpier/commit/85395be5e7c6a891c79ec72cf215894af097f819)) - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) - *(database)* Use `DEFAULT ''` for `privmsgs_subject` ([#1786](https://github.com/torrentpier/torrentpier/pull/1786)) - ([387a258](https://github.com/torrentpier/torrentpier/commit/387a25870abd37b641b55ffd98e13f4aaecb73b1)) +- *(deploy action)* Specify some missing params ([#1789](https://github.com/torrentpier/torrentpier/pull/1789)) - ([6115900](https://github.com/torrentpier/torrentpier/commit/6115900b765752209a6ed1dfb83e4f0cbee2ae77)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) - *(readme)* Improved installation guide ([#1781](https://github.com/torrentpier/torrentpier/pull/1781)) - ([e579b81](https://github.com/torrentpier/torrentpier/commit/e579b816b4dc346b3242cb3d9db292ad05596c1f)) From 602137b65129b817811b80975a369ebde3270c6d Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 2 Feb 2025 08:32:26 +0300 Subject: [PATCH 030/238] fix: Null `$bb_cfg['tp_instance_hash']` (#1790) --- library/includes/cron/jobs/board_maintenance.php | 4 ++-- library/includes/init_bb.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/includes/cron/jobs/board_maintenance.php b/library/includes/cron/jobs/board_maintenance.php index 3662e65ca..2a46bc416 100644 --- a/library/includes/cron/jobs/board_maintenance.php +++ b/library/includes/cron/jobs/board_maintenance.php @@ -54,9 +54,9 @@ if (empty($bb_cfg['bt_announce_url']) || ($bb_cfg['bt_announce_url'] === 'https: bb_update_config(['bt_announce_url' => FULL_URL . 'bt/announce.php']); } -// [Demo mode] Allow registering torrents by default +// [Demo mode] Allow registering torrents by default for "Your first forum" if (IN_DEMO_MODE) { - DB()->query("UPDATE " . BB_FORUMS . " SET allow_reg_tracker = 1 WHERE allow_reg_tracker = 0"); + 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 diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index ed97788f3..fb6792508 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -397,7 +397,7 @@ $userdata =& $user->data; /** * Some shared defines */ -define('TP_INSTANCE_HASH', $bb_cfg['tp_instance_hash']); +define('TP_INSTANCE_HASH', !empty($bb_cfg['tp_instance_hash']) ? $bb_cfg['tp_instance_hash'] : ''); /** * Cron From 856afe7f208b36f33bfa75ed993d2e1b3b1a31fc Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 2 Feb 2025 05:32:41 +0000 Subject: [PATCH 031/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0372aa16b..3e5bab074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - *(bb_die)* HTML characters converting ([#1744](https://github.com/torrentpier/torrentpier/pull/1744)) - ([4f1c7e4](https://github.com/torrentpier/torrentpier/commit/4f1c7e40d82e52f81eba44ead501e1f01058cc4f)) - *(debug)* Disabled `Bugsnag` reporting on local environment ([#1751](https://github.com/torrentpier/torrentpier/pull/1751)) - ([1f3b629](https://github.com/torrentpier/torrentpier/commit/1f3b629e9cea4d11fbf3cf29f575ba730bad898d)) - *(installer)* Missing `gd` extension ([#1749](https://github.com/torrentpier/torrentpier/pull/1749)) - ([a1c519d](https://github.com/torrentpier/torrentpier/commit/a1c519d938b848edffcbf7fbbe6a3fdb9a5394f1)) +- Null `$bb_cfg['tp_instance_hash']` ([#1790](https://github.com/torrentpier/torrentpier/pull/1790)) - ([602137b](https://github.com/torrentpier/torrentpier/commit/602137b65129b817811b80975a369ebde3270c6d)) - Incorrect peer country flag ([#1768](https://github.com/torrentpier/torrentpier/pull/1768)) - ([0f091eb](https://github.com/torrentpier/torrentpier/commit/0f091eb546e34923d9d1ab34be5faf92080ec198)) ### 📦 Dependencies From 4eb26ae37e1f4c82a45961517ffeb54c20200408 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 2 Feb 2025 12:08:24 +0300 Subject: [PATCH 032/238] revert: fix: Null `$bb_cfg['tp_instance_hash']` (#1792) --- library/includes/init_bb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index fb6792508..ed97788f3 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -397,7 +397,7 @@ $userdata =& $user->data; /** * Some shared defines */ -define('TP_INSTANCE_HASH', !empty($bb_cfg['tp_instance_hash']) ? $bb_cfg['tp_instance_hash'] : ''); +define('TP_INSTANCE_HASH', $bb_cfg['tp_instance_hash']); /** * Cron From fc265ce96ede35958954c06af31033becbd79c86 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 2 Feb 2025 09:08:39 +0000 Subject: [PATCH 033/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e5bab074..48199a0f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,4 +66,8 @@ - Update `cliff.toml` - ([254dca2](https://github.com/torrentpier/torrentpier/commit/254dca2b27c2d92421d3e639c80b0adf1172202f)) - Minor improvements ([#1743](https://github.com/torrentpier/torrentpier/pull/1743)) - ([e73d650](https://github.com/torrentpier/torrentpier/commit/e73d65011fff0a8b8e1368eef61bbfb67e87eab8)) - Enabled `$bb_cfg['integrity_check']` by defaul ([#1742](https://github.com/torrentpier/torrentpier/pull/1742)) - ([7e3601e](https://github.com/torrentpier/torrentpier/commit/7e3601e63aff73be1428969ca37dda3da2537d9b)) + +### ◀️ Revert + +- Fix: Null `$bb_cfg['tp_instance_hash']` ([#1792](https://github.com/torrentpier/torrentpier/pull/1792)) - ([4eb26ae](https://github.com/torrentpier/torrentpier/commit/4eb26ae37e1f4c82a45961517ffeb54c20200408)) From 8e4cd97734fc46f33459c4b00a0fe38b0597f92b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 3 Feb 2025 21:16:56 +0300 Subject: [PATCH 034/238] misc(notify): Hide notify checkbox in topic for guests (#1793) * misc(notify): Hide notify checkbox in topic for guests * Update usercp_viewprofile.tpl --- styles/templates/default/usercp_viewprofile.tpl | 2 +- styles/templates/default/viewtopic.tpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index 558045f9b..5f1cb06b5 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -382,7 +382,7 @@ ajax.callback.group_membership = function(data) { [ {L_SEARCH_USER_POSTS} ] [ {L_SEARCH_USER_TOPICS} ] [ {L_SEARCH_RELEASES} ] - [ {L_WATCHED_TOPICS} ] + [ {L_WATCHED_TOPICS} ] [ {FEED_IMG} ]

diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index d6a9eb2bc..7b6f5e793 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -623,12 +623,14 @@ function build_poll_add_form (src_el) + + From 95ccf9bf3e53c8daadde1e04d135714f6f016eb1 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Mon, 3 Feb 2025 18:17:15 +0000 Subject: [PATCH 035/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48199a0f9..2d1942888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ - *(deploy action)* Specify some missing params ([#1789](https://github.com/torrentpier/torrentpier/pull/1789)) - ([6115900](https://github.com/torrentpier/torrentpier/commit/6115900b765752209a6ed1dfb83e4f0cbee2ae77)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) +- *(notify)* Hide notify checkbox in topic for guests ([#1793](https://github.com/torrentpier/torrentpier/pull/1793)) - ([8e4cd97](https://github.com/torrentpier/torrentpier/commit/8e4cd97734fc46f33459c4b00a0fe38b0597f92b)) - *(readme)* Improved installation guide ([#1781](https://github.com/torrentpier/torrentpier/pull/1781)) - ([e579b81](https://github.com/torrentpier/torrentpier/commit/e579b816b4dc346b3242cb3d9db292ad05596c1f)) - *(readme)* Minor improvements ([#1779](https://github.com/torrentpier/torrentpier/pull/1779)) - ([5b0ed02](https://github.com/torrentpier/torrentpier/commit/5b0ed020890a8f938df912f9215cccbda42b0317)) - *(readme)* Added Caddy webserver ([#1778](https://github.com/torrentpier/torrentpier/pull/1778)) - ([970a028](https://github.com/torrentpier/torrentpier/commit/970a0282e3631c403029c959ffd46b21c5cad0cd)) From c95d414ef63ca37118f1f660880cd58b4480c414 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 4 Feb 2025 20:47:44 +0300 Subject: [PATCH 036/238] misc(emailer): Use constants for email types (#1794) --- library/includes/init_bb.php | 3 +++ src/Emailer.php | 16 ++++++++++++---- src/IndexNow.php | 3 +++ src/Updater.php | 8 ++++---- styles/templates/admin/admin_mass_email.tpl | 4 ++-- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index ed97788f3..05d51880c 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -309,6 +309,9 @@ define('HTML_DISABLED', ' disabled '); define('HTML_READONLY', ' readonly '); define('HTML_SELECTED', ' selected '); +define('EMAIL_TYPE_HTML', 'text/html'); +define('EMAIL_TYPE_TEXT', 'text/plain'); + // $GPC define('KEY_NAME', 0); // position in $GPC['xxx'] define('DEF_VAL', 1); diff --git a/src/Emailer.php b/src/Emailer.php index 1b9b9d751..f1162eb36 100644 --- a/src/Emailer.php +++ b/src/Emailer.php @@ -9,6 +9,8 @@ namespace TorrentPier; +use Exception; + use Symfony\Component\Mailer\Exception\TransportExceptionInterface; use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Transport\SendmailTransport; @@ -119,6 +121,7 @@ class Emailer * @param string $email_format * * @return bool + * @throws Exception */ public function send(string $email_format = 'text/plain'): bool { @@ -176,10 +179,15 @@ class Emailer $message->getHeaders() ->addTextHeader('X-Auto-Response-Suppress', 'OOF, DR, RN, NRN, AutoReply'); - if ($email_format == 'text/html') { - $message->html($this->message); - } else { - $message->text($this->message); + switch ($email_format) { + case EMAIL_TYPE_HTML: + $message->html($this->message); + break; + case EMAIL_TYPE_TEXT: + $message->text($this->message); + break; + default: + throw new Exception('Unknown email format: ' . $email_format); } /** Send message */ diff --git a/src/IndexNow.php b/src/IndexNow.php index 87511d17b..e0e2ad9a1 100644 --- a/src/IndexNow.php +++ b/src/IndexNow.php @@ -50,6 +50,9 @@ class IndexNow 'naver' => 'searchadvisor.naver.com' ]; + /** + * IndexNow constructor + */ public function __construct() { global $bb_cfg; diff --git a/src/Updater.php b/src/Updater.php index c27242d09..f41277239 100644 --- a/src/Updater.php +++ b/src/Updater.php @@ -130,14 +130,14 @@ class Updater } /** - * Returns information of latest TorrentPier version + * Returns information of latest TorrentPier version available * - * @param bool $allowRC + * @param bool $allowPreReleases * @return array */ - public function getLastVersion(bool $allowRC = true): array + public function getLastVersion(bool $allowPreReleases = true): array { - if (!$allowRC) { + if (!$allowPreReleases) { foreach ($this->jsonResponse as $index) { if (isset($index['prerelease']) && $index['prerelease']) { continue; diff --git a/styles/templates/admin/admin_mass_email.tpl b/styles/templates/admin/admin_mass_email.tpl index ecc623f21..8a5846241 100644 --- a/styles/templates/admin/admin_mass_email.tpl +++ b/styles/templates/admin/admin_mass_email.tpl @@ -16,8 +16,8 @@ {L_MASS_EMAIL_MESSAGE_TYPE} From 30836fb8d5db06270b92e17170f4240927d5c05c Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Tue, 4 Feb 2025 17:47:59 +0000 Subject: [PATCH 037/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d1942888..c7e2d2b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ - *(copyright)* Updated copyright year ([#1760](https://github.com/torrentpier/torrentpier/pull/1760)) - ([6697410](https://github.com/torrentpier/torrentpier/commit/6697410c1df6c8d9d7f511b1e984ae90d888ae0e)) - *(database)* Use `DEFAULT ''` for `privmsgs_subject` ([#1786](https://github.com/torrentpier/torrentpier/pull/1786)) - ([387a258](https://github.com/torrentpier/torrentpier/commit/387a25870abd37b641b55ffd98e13f4aaecb73b1)) - *(deploy action)* Specify some missing params ([#1789](https://github.com/torrentpier/torrentpier/pull/1789)) - ([6115900](https://github.com/torrentpier/torrentpier/commit/6115900b765752209a6ed1dfb83e4f0cbee2ae77)) +- *(emailer)* Use constants for email types ([#1794](https://github.com/torrentpier/torrentpier/pull/1794)) - ([c95d414](https://github.com/torrentpier/torrentpier/commit/c95d414ef63ca37118f1f660880cd58b4480c414)) - *(issue template)* Improved `Feature request` template ([#1774](https://github.com/torrentpier/torrentpier/pull/1774)) - ([268f79d](https://github.com/torrentpier/torrentpier/commit/268f79d7259de67aa8877fcf7130ff0069469ab2)) - *(issue template)* Improved `Bug report` template ([#1773](https://github.com/torrentpier/torrentpier/pull/1773)) - ([53ebfef](https://github.com/torrentpier/torrentpier/commit/53ebfef32c0e9016257e03b96ef96349e22d3e9b)) - *(notify)* Hide notify checkbox in topic for guests ([#1793](https://github.com/torrentpier/torrentpier/pull/1793)) - ([8e4cd97](https://github.com/torrentpier/torrentpier/commit/8e4cd97734fc46f33459c4b00a0fe38b0597f92b)) From 3c0a1d5d0018daa87ad3914ea04078a9a6d05fc2 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 5 Feb 2025 15:37:12 +0300 Subject: [PATCH 038/238] fix(youtube player): Mixed content issue (#1795) --- styles/js/bbcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/js/bbcode.js b/styles/js/bbcode.js index b9a53b46b..2ae20acc6 100644 --- a/styles/js/bbcode.js +++ b/styles/js/bbcode.js @@ -437,7 +437,7 @@ function initMedia(context) { a.className = 'YTLink'; a.innerHTML = ''; window.addEvent(a, 'click', function (e) { - var vhref = e.target.nextSibling.href.replace(/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\//ig, "http://www.youtube.com/embed/$3"); + var vhref = e.target.nextSibling.href.replace(/^http(?:s|):\/\/www.youtube.com\/watch\?(.*)?(&?v=([a-z0-9\-_]+))(.*)?|http:\/\/youtu.be\//ig, "https://www.youtube.com/embed/$3"); var text = e.target.nextSibling.innerText !== "" ? e.target.nextSibling.innerText : e.target.nextSibling.href; $('#Panel_youtube').remove(); ypanel('youtube', { From c554f90c312454789a7e39fd50bb4ce07619d12d Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Wed, 5 Feb 2025 12:37:30 +0000 Subject: [PATCH 039/238] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e2d2b1c..8122d44d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - *(bb_die)* HTML characters converting ([#1744](https://github.com/torrentpier/torrentpier/pull/1744)) - ([4f1c7e4](https://github.com/torrentpier/torrentpier/commit/4f1c7e40d82e52f81eba44ead501e1f01058cc4f)) - *(debug)* Disabled `Bugsnag` reporting on local environment ([#1751](https://github.com/torrentpier/torrentpier/pull/1751)) - ([1f3b629](https://github.com/torrentpier/torrentpier/commit/1f3b629e9cea4d11fbf3cf29f575ba730bad898d)) - *(installer)* Missing `gd` extension ([#1749](https://github.com/torrentpier/torrentpier/pull/1749)) - ([a1c519d](https://github.com/torrentpier/torrentpier/commit/a1c519d938b848edffcbf7fbbe6a3fdb9a5394f1)) +- *(youtube player)* Mixed content issue ([#1795](https://github.com/torrentpier/torrentpier/pull/1795)) - ([3c0a1d5](https://github.com/torrentpier/torrentpier/commit/3c0a1d5d0018daa87ad3914ea04078a9a6d05fc2)) - Null `$bb_cfg['tp_instance_hash']` ([#1790](https://github.com/torrentpier/torrentpier/pull/1790)) - ([602137b](https://github.com/torrentpier/torrentpier/commit/602137b65129b817811b80975a369ebde3270c6d)) - Incorrect peer country flag ([#1768](https://github.com/torrentpier/torrentpier/pull/1768)) - ([0f091eb](https://github.com/torrentpier/torrentpier/commit/0f091eb546e34923d9d1ab34be5faf92080ec198)) From 8650ad30f429ab14a03f44b26d7be7701f1985f1 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 5 Feb 2025 20:59:23 +0300 Subject: [PATCH 040/238] misc: Minor improvements (#1796) * misc: Minor improvements * Update build_files_integrity.php --- .../includes/datastore/build_files_integrity.php | 13 +++++++++---- styles/templates/default/viewtopic.tpl | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/library/includes/datastore/build_files_integrity.php b/library/includes/datastore/build_files_integrity.php index b8e5bd36a..ce9701672 100644 --- a/library/includes/datastore/build_files_integrity.php +++ b/library/includes/datastore/build_files_integrity.php @@ -26,6 +26,7 @@ $checksumFile->setFlags(SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE $ignoreFiles = [ '.env.example', '.htaccess', + 'CHANGELOG.md', 'robots.txt', 'install.php', 'favicon.png', @@ -40,17 +41,21 @@ $ignoreFiles = [ foreach ($checksumFile as $line) { $parts = explode(' ', $line); - if (!isset($parts[0]) || !isset($parts[1])) { + [$hash, $path] = $parts; + + if (!isset($hash) || !isset($path)) { // Skip end line break; } - if (!empty($ignoreFiles) && in_array($parts[1], $ignoreFiles)) { + + if (!empty($ignoreFiles) && in_array($path, $ignoreFiles)) { // Skip files from "Ignoring list" continue; } + $filesList[] = [ - 'path' => trim($parts[1]), - 'hash' => trim($parts[0]) + 'path' => trim($path), + 'hash' => trim($hash) ]; } diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index 7b6f5e793..09fdbc871 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -626,7 +626,7 @@ function build_poll_add_form (src_el) -