• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
[SolidMean] CloudFlare Detect

[SolidMean] CloudFlare Detect 1.1.1

No permission to download

SneakyDave

Well-known member
#1
SneakyDave submitted a new resource:

CloudFlare Detect by Solid Mean Technology (version 1.0) - Replace visitors' CF based IP's with the visitor's true, originating IP address

PLEASE BE SURE TO READ THIS INFORMATION BEFORE DECIDING TO INSTALL THIS ADD-ON

This is a port of CloudFlare's Wordpress add-on that reassigns a visitor's Cloudflare based IP address to their "true" IP address.

You may choose to use this add-on if:
  1. Your host will not, or cannot, install a CloudFlare compatible add-on for your web server (i.e. HttpRealipModule for Nginx or mod_cloudflare for Apache).
  2. You don't want to add code suggested by CloudFlare to your config.php or...
Read more about this resource...
 

SneakyDave

Well-known member
#4
I was testing some things, and this add-on may intefere with upgrading xF in the admin area.

If you have this issue, please post it here. To get around the problem, turn debugging on in your xfroot/library/config.php
Code:
$config['debug'] = true;
And then go into your administration area and disable this add-on. You can re-enable it after the upgrade is complete. Turning debug on is required as you can't get into your admin control panel while an upgrade is in process.

It looks like the add-on is interfering with the admin session when visiting the install page, and it won't authenticate an admin user.
 

SneakyDave

Well-known member
#5
The issue with xF upgrades and this add-on is that the install process doesn't trigger the listenControllerPreDispatch code event listener when the upgrade starts, but it does trigger it after trying to sign in as an administrator, so the authentication failes because the REMOTE_ADDR is different.

I'm going to disable this add-on and make it a code routine to add to config.php. Sorry for any hassles.
 

SneakyDave

Well-known member
#6
This add-on still works, but it may interfere with upgrades to your xenforo installation. I haven't found a good solution to this, as it appears xF uses the visitor IP address (whether it's a Cloudflare Based IP or a real ISP issued IP) when authenticating the user.

I'll release a new add-on that will add one line to the config file, that does the same function as this add-on. If you have any questions, or want to beta test this, let me know.
 

Chad

Active member
#10
This doesn't seem to be working for me.

I added this to the config

if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }

However, all users still show same shared IP instead of their real ones.
 
#12
I just wanted to let you all know that the code does not work for viewing ip addresses.

I'm at sort of a standstill because I'd like to find a way to view ip addresses. I have not tried the modification although the code provided has not returned any ips. Even for ordinary guests.

Thank you.
 

SneakyDave

Well-known member
#13
Well, this resource is removed, so yeah, it doesn't work. See this post:
CloudFlare Detect by Solid Mean Technology [REMOVED]

If you don't have access to the Apache module that exposes visitors IP addresses, or nginx's similar module, you can add this to the bottom of your config.php file, which isn't a perfect solution, but it should work:

Code:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
And again, all the old IP addresses in posts won't be changed, but new visitors should.

Here is the official word from CloudFlare, ignore the "XenForo Plugin" link, because that directs to this thread:
https://support.cloudflare.com/hc/e...o-I-restore-original-visitor-IP-with-XenForo-
 
#14
Well, this resource is removed, so yeah, it doesn't work. See this post:
CloudFlare Detect by Solid Mean Technology [REMOVED]

If you don't have access to the Apache module that exposes visitors IP addresses, or nginx's similar module, you can add this to the bottom of your config.php file, which isn't a perfect solution, but it should work:

Code:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
And again, all the old IP addresses in posts won't be changed, but new visitors should.

Here is the official word from CloudFlare, ignore the "XenForo Plugin" link, because that directs to this thread:
How do I restore original visitor IP with XenForo?
Thanks for your support, although it didn't work for me for some reason.

I had my host install the apache module earlier today and everything is fine from there. Anyways I appreciate it.
 
#15
I just moved my site to Google App Engine, I'm nolonger able to install any Apache module and have to rely solely on plugins/PHP script. Unfortunately the script provided doesn't work for me. Is there any other solution?

Thanks.
 

SneakyDave

Well-known member
#19
Cloudflare has added a new IP block to their configuration (104.16.0.0/12). Anybody using this addon should update their Cloudflare Detect IP addresses for IPv4 to these.

Code:
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
104.16.0.0/12
108.162.192.0/18
141.101.64.0/18
162.158.0.0/15
172.64.0.0/13
173.245.48.0/20
188.114.96.0/20
190.93.240.0/20
197.234.240.0/22
198.41.128.0/17
199.27.128.0/21
Links to these IP's are included on the addon's option page.
 
Last edited:

SneakyDave

Well-known member
#20
Thanks to @Andrej 's "like" above, I was reminded to check the IP addresses at CloudFlare and see if they've changed. They have. CloudFlare added a new block "131.0.72.0/22" to their IPv4 network:

Anybody using this addon should update their Cloudflare Detect IP addresses for IPV4 as follows:
Code:
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
104.16.0.0/12
108.162.192.0/18
131.0.72.0/22
141.101.64.0/18
162.158.0.0/15
172.64.0.0/13
173.245.48.0/20
188.114.96.0/20
190.93.240.0/20
197.234.240.0/22
198.41.128.0/17
199.27.128.0/21
I'll have a release soon to update these in the addon, but if you've updated them in your boards "Cloudflare Detect" options, you'll already have the changes.

The IPv6 network blocks have not changed.