mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Improved BitTorrent clients ban functionality (#1657)
* Minor improvements
* Update config.php
* Update config.php
* Update config.php
* Update config.php
* Update CHANGELOG.md
* Update CHANGELOG.md
* Update announce.php
* Update main.php
* Update CronHelper.php
* Updated
* Update CHANGELOG.md
* Update announce.php
* Revert "Update announce.php"
This reverts commit 595784acd6
.
* Update announce.php
* Update announce.php
This commit is contained in:
parent
8e43fde956
commit
04e1adf4ba
4 changed files with 25 additions and 5 deletions
|
@ -13,6 +13,7 @@
|
|||
- Newtopic: Added configuring robots indexing [\#1599](https://github.com/torrentpier/torrentpier/pull/1599) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Added showing releaser stats in profile [\#1568](https://github.com/torrentpier/torrentpier/pull/1568) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Added ability to set country name manually [\#1652](https://github.com/torrentpier/torrentpier/pull/1652) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Improved BitTorrent clients ban functionality [\#1657](https://github.com/torrentpier/torrentpier/pull/1657) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Improved `filelist.php` [\#1586](https://github.com/torrentpier/torrentpier/pull/1586) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka))
|
||||
|
@ -22,7 +23,7 @@
|
|||
- Increased `USEREMAIL_MAX_LENGTH` [\#1566](https://github.com/torrentpier/torrentpier/pull/1566) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Disabled resizing for textarea tag [\#1638](https://github.com/torrentpier/torrentpier/pull/1638) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Minor improvements [\#1570](https://github.com/torrentpier/torrentpier/pull/1570), [\#1571](https://github.com/torrentpier/torrentpier/pull/1571), [\#1575](https://github.com/torrentpier/torrentpier/pull/1575), [\#1589](https://github.com/torrentpier/torrentpier/pull/1589), [\#1592](https://github.com/torrentpier/torrentpier/pull/1592), [\#1605](https://github.com/torrentpier/torrentpier/pull/1605), [\#1611](https://github.com/torrentpier/torrentpier/pull/1611), [\#1612](https://github.com/torrentpier/torrentpier/pull/1612), [\#1615](https://github.com/torrentpier/torrentpier/pull/1615), [\#1627](https://github.com/torrentpier/torrentpier/pull/1627), [\#1633](https://github.com/torrentpier/torrentpier/pull/1633), [\#1641](https://github.com/torrentpier/torrentpier/pull/1641), [\#1651](https://github.com/torrentpier/torrentpier/pull/1651) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Updated deps [\#1563](https://github.com/torrentpier/torrentpier/pull/1563), [\#1564](https://github.com/torrentpier/torrentpier/pull/1564), [\#1608](https://github.com/torrentpier/torrentpier/pull/1608), [\#1609](https://github.com/torrentpier/torrentpier/pull/1609), [\#1610](https://github.com/torrentpier/torrentpier/pull/1610), [\#1637](https://github.com/torrentpier/torrentpier/pull/1637), [\#1646](https://github.com/torrentpier/torrentpier/pull/1646), [\#1647](https://github.com/torrentpier/torrentpier/pull/1647), [\#1650](https://github.com/torrentpier/torrentpier/pull/1650) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Updated deps [\#1563](https://github.com/torrentpier/torrentpier/pull/1563), [\#1564](https://github.com/torrentpier/torrentpier/pull/1564), [\#1608](https://github.com/torrentpier/torrentpier/pull/1608), [\#1609](https://github.com/torrentpier/torrentpier/pull/1609), [\#1610](https://github.com/torrentpier/torrentpier/pull/1610), [\#1637](https://github.com/torrentpier/torrentpier/pull/1637), [\#1646](https://github.com/torrentpier/torrentpier/pull/1646), [\#1647](https://github.com/torrentpier/torrentpier/pull/1647), [\#1650](https://github.com/torrentpier/torrentpier/pull/1650), [\#1656](https://github.com/torrentpier/torrentpier/pull/1656) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- New Crowdin updates [\#1569](https://github.com/torrentpier/torrentpier/pull/1569), [\#1572](https://github.com/torrentpier/torrentpier/pull/1572), [\#1573](https://github.com/torrentpier/torrentpier/pull/1573), [\#1574](https://github.com/torrentpier/torrentpier/pull/1574), [\#1588](https://github.com/torrentpier/torrentpier/pull/1588), [\#1590](https://github.com/torrentpier/torrentpier/pull/1590), [\#1600](https://github.com/torrentpier/torrentpier/pull/1600), [\#1601](https://github.com/torrentpier/torrentpier/pull/1601), [\#1606](https://github.com/torrentpier/torrentpier/pull/1606), [\#1607](https://github.com/torrentpier/torrentpier/pull/1607), [\#1625](https://github.com/torrentpier/torrentpier/pull/1625), [\#1626](https://github.com/torrentpier/torrentpier/pull/1626), [\#1629](https://github.com/torrentpier/torrentpier/pull/1629), [\#1630](https://github.com/torrentpier/torrentpier/pull/1630), [\#1631](https://github.com/torrentpier/torrentpier/pull/1631), [\#1632](https://github.com/torrentpier/torrentpier/pull/1632), [\#1639](https://github.com/torrentpier/torrentpier/pull/1639), [\#1640](https://github.com/torrentpier/torrentpier/pull/1640), [\#1654](https://github.com/torrentpier/torrentpier/pull/1654), [\#1655](https://github.com/torrentpier/torrentpier/pull/1655) ([Exileum](https://github.com/Exileum))
|
||||
|
||||
## [v2.4.4](https://github.com/torrentpier/torrentpier/tree/v2.4.4) (2024-07-22)
|
||||
|
|
|
@ -66,9 +66,25 @@ if (strlen($peer_id) !== 20) {
|
|||
|
||||
// Check for client ban
|
||||
if ($bb_cfg['client_ban']['enabled']) {
|
||||
foreach ($bb_cfg['client_ban']['clients'] as $clientId => $reason) {
|
||||
$targetClient = [];
|
||||
|
||||
foreach ($bb_cfg['client_ban']['clients'] as $clientId => $banReason) {
|
||||
if (str_starts_with($peer_id, $clientId)) {
|
||||
msg_die($reason);
|
||||
$targetClient = [
|
||||
'peer_id' => $clientId,
|
||||
'ban_reason' => $banReason
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($bb_cfg['client_ban']['only_allow_mode']) {
|
||||
if (empty($targetClient['peer_id'])) {
|
||||
msg_die('Your BitTorrent client has been banned!');
|
||||
}
|
||||
} else {
|
||||
if (!empty($targetClient['peer_id'])) {
|
||||
msg_die(empty($targetClient['ban_reason']) ? 'Your BitTorrent client has been banned!' : $targetClient['ban_reason']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,12 +100,15 @@ $bb_cfg['verify_reported_ip'] = true; // Verify IP reported by client against $_
|
|||
$bb_cfg['allow_internal_ip'] = false; // Allow internal IP (10.xx.. etc.)
|
||||
$bb_cfg['client_ban'] = [
|
||||
'enabled' => false,
|
||||
// Clients to be blocked, for example, peer id '-UT' will block all uTorrent clients, '-UT2' will block builds starting with 2 (default: false)
|
||||
'only_allow_mode' => false,
|
||||
// Clients to be blocked / allowed (in "only allow mode"), for example, peer id '-UT' will block all uTorrent clients, '-UT2' will block builds starting with 2 (default: false)
|
||||
// The second argument is being shown in the torrent client as a failure message
|
||||
// Handy client list: https://github.com/transmission/transmission/blob/f85c3b6f8db95d5363f6ec38eee603f146c6adb6/libtransmission/clients.cc#L504
|
||||
'clients' => [
|
||||
// 'client_id' => 'Ban reason (can be empty)'
|
||||
'-UT' => 'uTorrent — NOT ad-free and open-source',
|
||||
'-MG' => 'Mostly leeching client',
|
||||
'-ZO' => '',
|
||||
]
|
||||
];
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ class CronHelper
|
|||
}
|
||||
break;
|
||||
default:
|
||||
bb_simple_die("Invalid mode: $mode");
|
||||
bb_simple_die("Invalid cron track mode: $mode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue