1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[SolidMean] CloudFlare Detect 1.1.1

Replace visitors' CF based IP's with the visitor's true, originating IP address

  1. SneakyDave

    SneakyDave Well-Known Member

    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

    Read more about this resource...
     
    a legacy reborn likes this.
  2. ip0dhacker

    ip0dhacker Active Member

    Very nice add-on. Thank you! Let's me test it out :D
     
  3. SneakyDave

    SneakyDave Well-Known Member

  4. SneakyDave

    SneakyDave Well-Known Member

    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.
     
  5. SneakyDave

    SneakyDave Well-Known Member

    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.
     
  6. SneakyDave

    SneakyDave Well-Known Member

    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.
     
  7. |Jordan|

    |Jordan| Active Member

    EDIT: NM its working now.
     
    Last edited: Aug 9, 2013
  8. SneakyDave

    SneakyDave Well-Known Member

    Is CloudFlare enabled?

    What code exactly did you add to config.php?
     
  9. Mauricio Macas

    Mauricio Macas New Member

    Hi, how can use this code in server with nginx and ssl?.

    I have xenforo in folder blog-url-wordpress/foro/

    Thanks for you support.
     
  10. Chad

    Chad Active Member

    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.
     
  11. SneakyDave

    SneakyDave Well-Known Member

    Only new IP's registered are changed, the old ones won't be changed.
     
  12. TheXboxCloud

    TheXboxCloud Active Member

    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.
     
  13. SneakyDave

    SneakyDave Well-Known Member

    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. TheXboxCloud

    TheXboxCloud Active Member

    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.
     
    SneakyDave likes this.
  15. Minecraftly

    Minecraftly Member

    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.
     
  16. Liam W

    Liam W Well-Known Member

    Couldn't you use the init_dependencies event?

    I'm pretty sure it fires on the installer pages.

    Liam
     
    SneakyDave likes this.
  17. SneakyDave

    SneakyDave Well-Known Member

    Thanks Liam, I'll try that out. Haven't played with this addon for quite a while, but I'll try your suggestion. thanks again.
     
  18. SneakyDave

    SneakyDave Well-Known Member

    TheXboxCloud likes this.
  19. SneakyDave

    SneakyDave Well-Known Member

    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: May 9, 2016
    Andrej likes this.
  20. SneakyDave

    SneakyDave Well-Known Member

    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.
     

Share This Page