This commit is contained in:
Roman Kelesidis 2024-02-19 16:03:53 +07:00
parent 601107069f
commit 0160d9c486
2 changed files with 3 additions and 9 deletions

View File

@ -23,7 +23,6 @@
[Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.10-HotFix...v2.1.5-2024.02) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.10-HotFix...v2.1.5-2024.02)
- Release v2.1.5-2024.02 🎉 - Release v2.1.5-2024.02 🎉
- Added Fastly CDN support
- Some improvements in default template - Some improvements in default template
- Fixed void function result used - Fixed void function result used
- Feature to ban specific torrent clients - Feature to ban specific torrent clients

View File

@ -37,16 +37,11 @@ header('X-Frame-Options: SAMEORIGIN');
header('X-Powered-By: TorrentPier LTS Forever!'); header('X-Powered-By: TorrentPier LTS Forever!');
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
// Set remote address // Cloudflare
$allowed_cdn = array('HTTP_X_FORWARDED_FOR', 'HTTP_FASTLY_CLIENT_IP', 'HTTP_CF_CONNECTING_IP'); if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
foreach ($allowed_cdn as $cdn)
{ {
if (isset($_SERVER[$cdn]) && filter_var($_SERVER[$cdn], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
{
$_SERVER['REMOTE_ADDR'] = $_SERVER[$cdn];
}
} }
unset($allowed_cdn);
// Get initial config // Get initial config
if (file_exists(BB_ROOT . 'library/config.local.php')) if (file_exists(BB_ROOT . 'library/config.local.php'))