From a8e252f64f7205b7bb24739ab637144c6fb022d6 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 10:50:26 +0300 Subject: [PATCH 1/9] chore: Changed branch name from `master` to `v2.4` (#1968) --- .github/workflows/ci.yml | 36 ++-------------------------------- .github/workflows/phpmd.yml | 4 ++-- .github/workflows/schedule.yml | 6 +++--- cliff.toml | 2 +- 4 files changed, 8 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e92dfe326..e38c0ad2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Continuous Integration on: push: branches: - - master + - v2.4 jobs: nightly: @@ -44,37 +44,5 @@ jobs: - name: Upload Archive ๐Ÿ“ค uses: actions/upload-artifact@v4 with: - name: TorrentPier-master + name: TorrentPier-v2.4 path: ${{ steps.create-zip.outputs.ZIP_NAME }} - - deploy: - name: ๐ŸŽ‰ Deploy - runs-on: ubuntu-22.04 - steps: - - name: ๐Ÿšš Get latest code - uses: actions/checkout@v4 - - - name: ๐Ÿ”ฉ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - - name: Update composer.lock file - run: composer update --no-install - - - 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 }} - server-dir: ${{ secrets.FTP_DIR }} - protocol: ${{ secrets.FTP_PROTOCOL }} - port: ${{ secrets.FTP_PORT }} - exclude: | - **/.git* - **/.git*/** - .env diff --git a/.github/workflows/phpmd.yml b/.github/workflows/phpmd.yml index 3e06d7538..0bc28da28 100644 --- a/.github/workflows/phpmd.yml +++ b/.github/workflows/phpmd.yml @@ -17,10 +17,10 @@ name: PHPMD on: push: - branches: [ "master" ] + branches: [ "v2.4" ] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: [ "v2.4" ] schedule: - cron: '40 0 * * 3' diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 209512552..1bd8f0bdb 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: master + ref: v2.4 token: ${{ secrets.REPO_TOKEN }} - name: Generate a changelog @@ -32,10 +32,10 @@ jobs: - name: Commit changelog run: | - git checkout master + git checkout v2.4 git config --local user.name 'belomaxorka' git config --local user.email 'roman25052006.kelesh@gmail.com' set +e git add CHANGELOG.md git commit -m "Update CHANGELOG.md ๐Ÿ“–" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git v2.4 diff --git a/cliff.toml b/cliff.toml index 1753dd8a4..0fedab5e7 100644 --- a/cliff.toml +++ b/cliff.toml @@ -23,7 +23,7 @@ body = """ {%- endmacro -%} {%- macro nightly_url() -%} - https://nightly.link/{{ remote.github.owner }}/{{ remote.github.repo }}/workflows/ci/master/TorrentPier-master + https://nightly.link/{{ remote.github.owner }}/{{ remote.github.repo }}/workflows/ci/v2.4/TorrentPier-v2.4 {%- endmacro -%} {% macro print_commit(commit) -%} From ce1f35c2b5db7ae89c225d58f19786f5625fd5f3 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Thu, 19 Jun 2025 07:52:50 +0000 Subject: [PATCH 2/9] =?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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19f1dc9f6..bb384da2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # ๐Ÿ“– Change Log -## [nightly](https://nightly.link/torrentpier/torrentpier/workflows/ci/master/TorrentPier-master) +## [nightly](https://nightly.link/torrentpier/torrentpier/workflows/ci/v2.4/TorrentPier-v2.4) ### ๐Ÿ“ฆ Dependencies @@ -11,6 +11,7 @@ ### โš™๏ธ Miscellaneous - *(_release.php)* Finally! Removed some useless params ([#1947](https://github.com/torrentpier/torrentpier/pull/1947)) - ([9c7d270](https://github.com/torrentpier/torrentpier/commit/9c7d270598c0153fb82f4b7ad96f5b59399b2159)) +- Changed branch name from `master` to `v2.4` ([#1968](https://github.com/torrentpier/torrentpier/pull/1968)) - ([a8e252f](https://github.com/torrentpier/torrentpier/commit/a8e252f64f7205b7bb24739ab637144c6fb022d6)) ## [v2.4.6-alpha.4](https://github.com/torrentpier/torrentpier/compare/v2.4.6-alpha.3..v2.4.6-alpha.4) (2025-06-13) From 15f994840331b135cd64c0cd61de95fecfc29db8 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 10:59:18 +0300 Subject: [PATCH 3/9] fix(installer): Strip protocol from TP_HOST to keep only hostname (#1969) --- install.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.php b/install.php index 009098420..327c0fb5d 100644 --- a/install.php +++ b/install.php @@ -206,6 +206,12 @@ if (is_file(BB_ROOT . '.env')) { $newValue = trim(readline()); if (!empty($newValue) || $key === 'DB_PASSWORD') { + if ($key === 'TP_HOST') { + if (!preg_match('/^https?:\/\//', $newValue)) { + $newValue = 'https://' . $newValue; + } + $newValue = parse_url($newValue, PHP_URL_HOST); + } $line = "$key=$newValue"; $$key = $newValue; } else { From 7d9594eedab1b2c81d888dfba68ded1b8a142282 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:01:52 +0300 Subject: [PATCH 4/9] chore(cliff): Add conventional commit prefix to changelog message (#1970) --- .github/workflows/schedule.yml | 2 +- cliff.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 1bd8f0bdb..d0ab3b5a9 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -37,5 +37,5 @@ jobs: git config --local user.email 'roman25052006.kelesh@gmail.com' set +e git add CHANGELOG.md - git commit -m "Update CHANGELOG.md ๐Ÿ“–" + git commit -m "changelog: Update CHANGELOG.md ๐Ÿ“–" git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git v2.4 diff --git a/cliff.toml b/cliff.toml index 0fedab5e7..858d0a4db 100644 --- a/cliff.toml +++ b/cliff.toml @@ -105,7 +105,7 @@ commit_parsers = [ { message = "^refactor", group = "๐Ÿšœ Refactor" }, { message = "^style", group = "๐ŸŽจ Styling" }, { message = "^test", group = "๐Ÿงช Testing" }, - { message = "^ignore|^release", skip = true }, + { message = "^ignore|^release|^changelog", skip = true }, { message = "^chore|^ci|^misc", group = "โš™๏ธ Miscellaneous" }, { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, { message = "^revert", group = "โ—€๏ธ Revert" }, From 2a8b6daecf63752b8a852c950e9a7fd08e17f57c Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:05:23 +0300 Subject: [PATCH 5/9] fix: SQL queries in online_userlist.php to use MAX() for session data and adjusted GROUP BY clause for better accuracy (#1971) Co-authored-by: Yury Pikhtarev --- library/includes/online_userlist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/includes/online_userlist.php b/library/includes/online_userlist.php index ffa0cd2e4..7434f79ea 100644 --- a/library/includes/online_userlist.php +++ b/library/includes/online_userlist.php @@ -36,11 +36,11 @@ $online = $online_short = ['userlist' => '']; $sql = " SELECT u.username, u.user_id, u.user_opt, u.user_rank, u.user_level, - s.session_logged_in, s.session_ip, (s.session_time - s.session_start) AS ses_len, COUNT(s.session_id) AS sessions, COUNT(DISTINCT s.session_ip) AS ips + MAX(s.session_logged_in) AS session_logged_in, MAX(s.session_ip) AS session_ip, MAX(s.session_time - s.session_start) AS ses_len, COUNT(s.session_id) AS sessions, COUNT(DISTINCT s.session_ip) AS ips FROM " . BB_SESSIONS . " s, " . BB_USERS . " u WHERE s.session_time > $time_online AND u.user_id = s.session_user_id - GROUP BY s.session_user_id + GROUP BY s.session_user_id, u.username, u.user_id, u.user_opt, u.user_rank, u.user_level ORDER BY u.username "; From 7dc69ba699c75d87c709a799291c4b544b3e92aa Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:08:58 +0300 Subject: [PATCH 6/9] chore: Changed active branch name in `_release.php` (#1972) * chore: Changed active branch name in `_release.php` * Update _release.php --- _release.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_release.php b/_release.php index a09f3c718..bb3364439 100644 --- a/_release.php +++ b/_release.php @@ -124,7 +124,8 @@ runProcess("git tag -a \"$version\" -m \"Release $version\""); runProcess("git tag -v \"$version\""); // Git push -runProcess("git push origin master"); +runProcess("git checkout v2.4"); +runProcess("git push origin v2.4"); runProcess("git push origin $version"); out("\n- Release $version has been successfully prepared, committed and pushed!", 'success'); From faf3d7919249d869d8ca8d41617dd4356dc0ac48 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:11:35 +0300 Subject: [PATCH 7/9] fix(sql): Resolve `only_full_group_by` compatibility issues in tracker cleanup - Replace non-aggregated 'seeder' column with MAX(seeder) in GROUP BY query - Remove ORDER BY clause incompatible with GROUP BY in seeder update query Fixes MySQL 5.7+ strict SQL mode errors in tr_cleanup_and_dlstat cron job. Co-Authored-By: Yury Pikhtarev --- library/includes/cron/jobs/tr_cleanup_and_dlstat.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/includes/cron/jobs/tr_cleanup_and_dlstat.php b/library/includes/cron/jobs/tr_cleanup_and_dlstat.php index a0d7efd25..a0a64251f 100644 --- a/library/includes/cron/jobs/tr_cleanup_and_dlstat.php +++ b/library/includes/cron/jobs/tr_cleanup_and_dlstat.php @@ -39,7 +39,7 @@ if ($bb_cfg['tracker']['update_dlstat']) { INSERT INTO " . NEW_BB_BT_LAST_TORSTAT . " (topic_id, user_id, dl_status, up_add, down_add, release_add, speed_up, speed_down) SELECT - topic_id, user_id, IF(releaser, $releaser, seeder), SUM(up_add), SUM(down_add), IF(releaser, SUM(up_add), 0), SUM(speed_up), SUM(speed_down) + topic_id, user_id, IF(MAX(releaser), $releaser, MAX(seeder)), SUM(up_add), SUM(down_add), IF(MAX(releaser), SUM(up_add), 0), SUM(speed_up), SUM(speed_down) FROM " . BB_BT_TRACKER . " WHERE (up_add != 0 OR down_add != 0) GROUP BY topic_id, user_id @@ -61,7 +61,6 @@ DB()->query(" FROM " . BB_BT_TRACKER . " WHERE seeder = 1 GROUP BY topic_id, user_id - ORDER BY update_time DESC "); // Clean peers table From 6a1d6823856dd7c3cef45bea2681828526d1b9f8 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:16:17 +0300 Subject: [PATCH 8/9] fix: Duplicate column SQL query issues in `viewtopic.php` (#1973) Co-authored-by: Yury Pikhtarev --- viewtopic.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/viewtopic.php b/viewtopic.php index 82d39e685..c059c1b68 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -85,17 +85,17 @@ if ($topic_id && isset($_GET['view']) && ($_GET['view'] == 'next' || $_GET['view // Get forum/topic data if ($topic_id) { - $sql = "SELECT t.*, f.*, tw.notify_status + $sql = "SELECT t.*, f.cat_id, f.forum_name, f.forum_desc, f.forum_status, f.forum_order, f.forum_posts, f.forum_topics, f.forum_last_post_id, f.forum_tpl_id, f.prune_days, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_vote, f.auth_pollcreate, f.auth_attachments, f.auth_download, f.allow_reg_tracker, f.allow_porno_topic, f.self_moderated, f.forum_parent, f.show_on_index, f.forum_display_sort, f.forum_display_order, tw.notify_status FROM " . BB_TOPICS . " t - LEFT JOIN " . BB_FORUMS . " f USING(forum_id) + LEFT JOIN " . BB_FORUMS . " f ON t.forum_id = f.forum_id LEFT JOIN " . BB_TOPICS_WATCH . " tw ON(tw.topic_id = t.topic_id AND tw.user_id = {$userdata['user_id']}) WHERE t.topic_id = $topic_id "; } elseif ($post_id) { - $sql = "SELECT t.*, f.*, p.post_time, tw.notify_status + $sql = "SELECT t.*, f.cat_id, f.forum_name, f.forum_desc, f.forum_status, f.forum_order, f.forum_posts, f.forum_topics, f.forum_last_post_id, f.forum_tpl_id, f.prune_days, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_vote, f.auth_pollcreate, f.auth_attachments, f.auth_download, f.allow_reg_tracker, f.allow_porno_topic, f.self_moderated, f.forum_parent, f.show_on_index, f.forum_display_sort, f.forum_display_order, p.post_time, tw.notify_status FROM " . BB_TOPICS . " t - LEFT JOIN " . BB_FORUMS . " f USING(forum_id) - LEFT JOIN " . BB_POSTS . " p USING(topic_id) + LEFT JOIN " . BB_FORUMS . " f ON t.forum_id = f.forum_id + LEFT JOIN " . BB_POSTS . " p ON t.topic_id = p.topic_id LEFT JOIN " . BB_TOPICS_WATCH . " tw ON(tw.topic_id = t.topic_id AND tw.user_id = {$userdata['user_id']}) WHERE p.post_id = $post_id "; From de9f5e2cb18f9054eb3bfd7c4e2b72792f6efbcb Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 19 Jun 2025 11:19:30 +0300 Subject: [PATCH 9/9] =?UTF-8?q?release:=20v2.4.6=20=F0=9F=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 15 ++++++++++++++- library/config.php | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb384da2c..a96b57792 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,14 @@ # ๐Ÿ“– Change Log -## [nightly](https://nightly.link/torrentpier/torrentpier/workflows/ci/v2.4/TorrentPier-v2.4) +## [v2.4.6](https://github.com/torrentpier/torrentpier/compare/v2.4.6-alpha.4..v2.4.6) (2025-06-19) + +### ๐Ÿ› Bug Fixes + +- *(installer)* Strip protocol from TP_HOST to keep only hostname ([#1969](https://github.com/torrentpier/torrentpier/pull/1969)) - ([15f9948](https://github.com/torrentpier/torrentpier/commit/15f994840331b135cd64c0cd61de95fecfc29db8)) +- *(sql)* Resolve `only_full_group_by` compatibility issues in tracker cleanup - ([faf3d79](https://github.com/torrentpier/torrentpier/commit/faf3d7919249d869d8ca8d41617dd4356dc0ac48)) +- Duplicate column SQL query issues in `viewtopic.php` ([#1973](https://github.com/torrentpier/torrentpier/pull/1973)) - ([6a1d682](https://github.com/torrentpier/torrentpier/commit/6a1d6823856dd7c3cef45bea2681828526d1b9f8)) +- SQL queries in online_userlist.php to use MAX() for session data and adjusted GROUP BY clause for better accuracy ([#1971](https://github.com/torrentpier/torrentpier/pull/1971)) - ([2a8b6da](https://github.com/torrentpier/torrentpier/commit/2a8b6daecf63752b8a852c950e9a7fd08e17f57c)) ### ๐Ÿ“ฆ Dependencies @@ -11,8 +18,14 @@ ### โš™๏ธ Miscellaneous - *(_release.php)* Finally! Removed some useless params ([#1947](https://github.com/torrentpier/torrentpier/pull/1947)) - ([9c7d270](https://github.com/torrentpier/torrentpier/commit/9c7d270598c0153fb82f4b7ad96f5b59399b2159)) +- *(cliff)* Add conventional commit prefix to changelog message ([#1970](https://github.com/torrentpier/torrentpier/pull/1970)) - ([7d9594e](https://github.com/torrentpier/torrentpier/commit/7d9594eedab1b2c81d888dfba68ded1b8a142282)) +- Changed active branch name in `_release.php` ([#1972](https://github.com/torrentpier/torrentpier/pull/1972)) - ([7dc69ba](https://github.com/torrentpier/torrentpier/commit/7dc69ba699c75d87c709a799291c4b544b3e92aa)) - Changed branch name from `master` to `v2.4` ([#1968](https://github.com/torrentpier/torrentpier/pull/1968)) - ([a8e252f](https://github.com/torrentpier/torrentpier/commit/a8e252f64f7205b7bb24739ab637144c6fb022d6)) +## New Contributors โค๏ธ + +* @belomaxorka made their first contribution +* @dependabot[bot] made their first contribution in [#1948](https://github.com/torrentpier/torrentpier/pull/1948) ## [v2.4.6-alpha.4](https://github.com/torrentpier/torrentpier/compare/v2.4.6-alpha.3..v2.4.6-alpha.4) (2025-06-13) diff --git a/library/config.php b/library/config.php index 866c8ed75..e9e31af30 100644 --- a/library/config.php +++ b/library/config.php @@ -18,8 +18,8 @@ $reserved_port = env('TP_PORT', 80); $bb_cfg = []; // Version info -$bb_cfg['tp_version'] = 'v2.4.6-alpha.4'; -$bb_cfg['tp_release_date'] = '13-06-2025'; +$bb_cfg['tp_version'] = 'v2.4.6'; +$bb_cfg['tp_release_date'] = '19-06-2025'; $bb_cfg['tp_release_codename'] = 'Cattle'; // Increase version number after changing JS or CSS