MyBB Community Forums

Full Version: Cloudflare Management Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: cloudflare-logo.png]
Preface/About
Almost a year ago, I started using Cloudflare for the forum I run. The improvements to site speed were pretty impressive, but I noticed that since Cloudflare was essentially a reverse proxy, user IPs were showing up as the reverse proxy IPs which rendered protection and bans useless.
That's when I started looking for how to fix this issue, and I arrived at a rather simple answer: develop a plugin to set the forwarded header as the user IP. (I've since personally switched to a server-side configuration block, but have kept the core functionality intact).
A short while later, another problem arose, namely that my fellow Administrators were unable to test changes to code (CSS/JS) unless Cloudflare development mode was on, and were also unable to see information about the bandwidth used etc... so I implemented quite a bit more.
The plugin stands today at ~400 lines of code, and since we are switching over to another forum (XenForo) I have decided to release the plugin (and thereby the source-code, under a modified ISC License) to anyone who may be interested.

I am not dropping development of this project, and if features are requested I will strive to implement them. I believe I am long overdue to implement some of the newer settings (IPv6 and the like), and so those will come at some point in the near future. Support will also be provided.
(I know that there is a similar project currently available, arguably better. This was created before then, and has been in use on my forum since earlier this year).

Donations are welcome, and will provide a better incentive to build bigger/better/more plugins.

Features
  • Allows remote control of Cloudflare Site settings (Cache, Traffic).
  • Displays statistics from Cloudflare (Time, Cache, Traffic, Bandwidth).
  • Automatically fetches Cloudflare Zone ID.
  • Fixes user-IPs.

Screenshots
[Image: mybbcloudflare.png]

Installation & Configuration
The entire project is available either from the MyBB Mods Database
or if you prefer, my GitHub repo, bleeding-edge style: https://github.com/antoligy/MyBB-Plugins...Management

Installation of the plugin is relatively simple (although REQUIRES a Cloudflare account, and for your domain to be handled by it):
  1. Upload the Cloudflare.php to your inc/plugins/ directory.
  2. Install & Activate the plugin under the Administrator Control Panel.
  3. Configure API Key, Email Address and Domain Name in Plugin Settings.
  4. Start using under Tools->Cloudflare Management.
where to find API key becaues my cloudflare install in CPANEL only not in mybb ????
(2012-01-24, 02:49 PM)wangoldsdotcom Wrote: [ -> ]where to find API key becaues my cloudflare install in CPANEL only not in mybb ????

https://www.cloudflare.com/my-account
Can anyone tell where cloudfare is good for? I have my thoughts and if they are right, I may use this plugin at my forum either
Quote:That's when I started looking for how to fix this issue, and I arrived at a rather simple answer: develop a plugin to set the forwarded header as the user IP. (I've since personally switched to a server-side configuration block, but have kept the core functionality intact).

MyBB added a setting to deal with this already. No plugin required. Under Server and Optimization Options as "Scrutinize User's IP address?".

Quote:A short while later, another problem arose, namely that my fellow Administrators were unable to test changes to code (CSS/JS) unless Cloudflare development mode was on, and were also unable to see information about the bandwidth used etc... so I implemented quite a bit more.

Cloudflare normally by default creates a direct subdomain (direct.site.com) so that you bypass their proxy. Just as good too for development work.

But thanks for release. Appears you did fair amount of work. Remote site access via the admincp is a nifty feature for those too lazy to login directly to cloudflare.
(2012-02-02, 10:38 PM)Tankey Wrote: [ -> ]Can anyone tell where cloudfare is good for? I have my thoughts and if they are right, I may use this plugin at my forum either

CloudFlare acts as both a CDN & a security layer for your site. More than happy to answer any questions about CloudFlare.

Warning: Call-time pass-by-reference has been deprecated in /var/www/vhosts/............/httpdocs/inc/plugins/Cloudflare.php on line 157

Warning: Call-time pass-by-reference has been deprecated in /var/www/vhosts/............/httpdocs/inc/plugins/Cloudflare.php on line 158

Warning: Call-time pass-by-reference has been deprecated in /var/www/vhosts/.........../httpdocs/inc/plugins/Cloudflare.php on line 159




What does it mean and how can i fix it please?
I installed the Plugin on my MyBB 1.6.8 and got this error which shows up on the AdminCP with the overview on the Cloudfare Manager.

Quote:Warning [2] Invalid argument supplied for foreach() - Line: 50 - File: acp/modules/cloudflare/cloudflare_overview.php PHP 5.3.13-nmm1 (Linux)

Quote:File Line Function
/acp/modules/cloudflare/cloudflare_overview.php 50 errorHandler->error
/acp/index.php 523 require

Other than that the ACP part of the Plugin looks normal. Also, is the API key inserted automatically at some point or do I do that manually ? I am asking because I dont see a EDIT function for that.

Any help is appreciated. Wink

Thank you very much.

Wolfseye

Ups, I think i mixed that up with the other Cloudflare plugin. Wink

Sorry. Please ignore !