Ok after the talk about cloudflare either on the forums or in a private, I figured I would make this very very, very basic guide...
In this guide CF = Cloudflare. If you dont know what that is you prob dont need to follow this guide.
If you going to use CF with an torrent site then you prob should setup an tracker. sub domain on CF admin page.
This pic shows what I mean.
once you get the sub domain setup change your tracker info in backend/config.php
stock location is:
$site_config['announce_list'] = "
http://changemydomain.com/announce.php"; //seperate via commaso it would then be
$site_config['announce_list'] = "http://tracker.changemydomain.com/announce.php"; //seperate via comma
Yes people will have to change the tracker url.from [url="
http://changemydomain.com/announce.php"]http://changemydomain.com/announce.php[/url] to [url="
http://tracker.changemydomain.com/announce.php"]http://tracker.changemydomain.com/announce.php[/url]
But one bonus is new torrents they download will already be the new url if you changed it in the config.
Its because CF is basically 1 big reverse proxy so when you try and seed and your main site is threw Cloudflare servers the ips will prob to reslove to the Cloudflare ips and not your tracker :(
It also seems stock getip function does not work with CF.
in backend/functions.php change
function getip() {
return $_SERVER["REMOTE_ADDR"];
}
to
//== Updated getip with validation
function getip()
{
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
return $ip;
}
foreach (array(
'HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_X_CLUSTER_CLIENT_IP',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'HTTP_CF_CONNECTING_IP',
'REMOTE_ADDR'
) as $key) {
if (array_key_exists($key, $_SERVER) === true) {
foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip) {
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {
return $ip;
}
}
}
}
}
function is prob also in announce.php you have to change that one too.
This below may or may not be needed.. its helpfully cause then server logs would show real ips instead of the CF ones.
Why do my server logs show CloudFlare's IPs using CloudFlare?
I would advise people using cloudflare to also read this topic from them. [url="
https://support.cloudflare.com/hc/en-us/articles/200170786"]https://support.cloudflare.com/hc/en-us/articles/200170786[/url]
This topic tells how to for different server setups --> [url="
https://support.cloudflare.com/hc/en-us/sections/200038166-How-do-I-restore-original-visitor-IP-to-my-server-logs-"]https://support.cloudflare.com/hc/en-us/sections/200038166-How-do-I-restore-original-visitor-IP-to-my-server-logs-[/url]
The one most people want to look at is the apache mod.
Before people ask yes you can use ssl website with CF but its only in the paid plan :( I dont know why they do that I guess they need to find some way to pay the bills.
I have all my websites threw CF and you will be shocked the amount of spam ips blocked out :P
This is the last 30 days :P
I hope this helps people. Its just stuff I have learned the many years using CF.