Cloudflare IP support

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Anti-Spam Guide
User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Cloudflare IP support

Post by Volksdevil »

Swanny wrote:I checked the code on your Corrado site and mine, the code is identical. <!-- INCLUDE overall_header.html --> is missing from both.
Hmmm, I have had a couple of cases where I've been told that all my style is broken...But I think it's just how cloudflare works. Even though the <!-- INCLUDE overall_header.html --> is not in that file any more, it's obviously still working...from somewhere. So I think we are OK. 8-)

PS: Could you remove that link to my sites ucp_header.html, just I don't want serch bots picking it up etc cheers mate.
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
Swanny
Registered User
Posts: 457
Joined: Sun Apr 14, 2002 2:11 am
Location: Canada

Re: Cloudflare IP support

Post by Swanny »

Sure, I'll edit it out. I think that CF removes that comment but it maybe doesn't affect what users see, since it's already been sent out by the main server.
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Cloudflare IP support

Post by javiexin »

If you access the template file directly, then you are accessing an HTML file with a comment on it.

If however you access a PHP file, this file loads AND PROCESSES the template file by using PHPBB template system, that in turn uses TWIG, all of that in the server. And what comes out of the PHP file is clean HTML code with the "special" comments already processed.

That is why it "works" through CF, while when you try to access the template directly it does not show the INCLUDEs as they are plane HTML comments.

Hope this helps and clarifies the situation.
-javiexin
User avatar
BriannaTT
Registered User
Posts: 4
Joined: Wed Jul 29, 2015 11:23 am

Re: Cloudflare IP support

Post by BriannaTT »

Would be nice if next Phpbb update had an option to add CloudFlare support via simple click.

#2015
User avatar
peopleinside
Registered User
Posts: 192
Joined: Sat Jan 31, 2015 10:37 pm
Name: Marco
Contact:

Re: Cloudflare IP support

Post by peopleinside »

fulgan wrote: BTW, in PHP 5.5+, you can't use

Code: Select all

!empty($request->server('HTTP_CF_CONNECTING_IP'))
Hi fulgan,
what do you mean with that sentence above?
You mean in the session.php file?

Thank you!
User avatar
3Di
Former Team Member
Posts: 16039
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Cloudflare IP support

Post by 3Di »

fulgan wrote:Ok. I got 5 minutes to look into this again and here is a quick and dirty fix:

In phpbb\session.php around line 280, you'll see this line:

Code: Select all

$this->ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'));
replace it with

Code: Select all

		if ($request->server('HTTP_CF_CONNECTING_IP') != '') 
		{
			$this->ip = htmlspecialchars_decode($request->server('HTTP_CF_CONNECTING_IP'));
		}
		else
		{
			$this->ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'));
		};
BTW, in PHP 5.5+, you can't use

Code: Select all

!empty($request->server('HTTP_CF_CONNECTING_IP'))
Why not using then a ternary operator? Just a note..

Thanks for your effort but here we are talking about EXTensions and not MODs. ;) You should use events where available and if not you could also create a PR in order the phpBB's Developers to discuss it and see if it is applicable for a future version.

As a matter of fact here's the Forum for Extension requests and not the one for MOD requests that is closed.

Since phpBB 3.1.x, MODs are not anymore considered as the correct way to deal with the phpBB's core.

MODifying the core phpBB code (to be clear) is considered and it is a bad behaviour, not to be suggested at all as a support reply. Every new update will erase those changes at least, making more troubles than nothing else.

Let me see what I will cook about, for those they can't have the benefits that mod_cloudflare gives.

Regards.
To request support for our extensions you can also contact me here: phpBB Studio

Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
🚀 Looking for a specific feature or alternative option? We will rock you! 🚀
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22841
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: Cloudflare IP support

Post by Mick »

BriannaTT wrote:Would be nice if next Phpbb update had an option to add CloudFlare support via simple click
It would be nice if the hosts offering Clodflare learned how to set it up properly then this wouldn't be required.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
peopleinside
Registered User
Posts: 192
Joined: Sat Jan 31, 2015 10:37 pm
Name: Marco
Contact:

Re: Cloudflare IP support

Post by peopleinside »

Mick wrote:
BriannaTT wrote:Would be nice if next Phpbb update had an option to add CloudFlare support via simple click
It would be nice if the hosts offering Clodflare learned how to set it up properly then this wouldn't be required.
Yes but not easy. Each host have different mind and some hosting people some time seems to me crazy, Is more easy an option inside phpbb so will work in all hosting.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68181
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cloudflare IP support

Post by Lumpy Burgertushie »

not possible. as you said, each host will set things differently. it is up to the host to know how to setup their own software properly, not for phpbb to try and figure out how to make things work when they don't.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
david63
Registered User
Posts: 18446
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Cloudflare IP support

Post by david63 »

I know that this has probably been said before - how many phpBB boards actually need Cloudflare anyway? From what little I know about Cloudflare, I would say very few (if any at all) - so just disable it altogether.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
Lumpy Burgertushie
Registered User
Posts: 68181
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cloudflare IP support

Post by Lumpy Burgertushie »

I agree with david. unless your board is very very large and very very busy, I doubt you will see any benefit from the extra caching that cloudfare does. some of the other functions of it are not really of much good either.

if it worked properly it would be different, but it doesn't work properly in many cases.

it is a fairly new server software package that In my opinion, basically plays to the insecurity of new users.
not something that even has all the bugs worked out of it yet.

cpanel has a history of adding new things to its package that do not work properly and/or are sometimes not safe, etc.




robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: Cloudflare IP support

Post by Volksdevil »

OK, I've done some testing using cloudflare VS not using it. My average complete load time for my homepage without cloudflare is 3.2 seconds.

With cloudflare...Well, here is the incredible result I've got just this minute...

And as that report won't be there forever, a piccy. Pretty friggin impressive I think.
Image
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60
Senky
Extension Customisations
Extension Customisations
Posts: 2290
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Re: Cloudflare IP support

Post by Senky »

Alright guys, this seems like pretty easy extension. However, we don't have event positioned, yet. If you really want this extension, I can post an event request, but bear in mind, that it will be included in a next release at best (which might take weeks to ship), and only after that I can submit the extension to CDB, which takes another month to validate.
‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎📝‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‎‏‏‎ ‎ ‎ ‎🔔 ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‎ ‎ ‎ ‎ ‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎🛠
Forms Extension | Browser & Mobile Notifications Extension | Mixed Content Fixer Extension
User avatar
k0nsl
Registered User
Posts: 90
Joined: Mon Mar 25, 2013 11:17 pm
Location: Scandinavia
Name: Eduard Drehner
Contact:

Re: Cloudflare IP support

Post by k0nsl »

I'm for it, it becomes tiring to edit a bunch of core files on every new release. Why don't you put it up on GitHub directly and then do the CDB routine?
Best wishes,
-k0nsl
Senky wrote:Alright guys, this seems like pretty easy extension. However, we don't have event positioned, yet. If you really want this extension, I can post an event request, but bear in mind, that it will be included in a next release at best (which might take weeks to ship), and only after that I can submit the extension to CDB, which takes another month to validate.
I'm a programmer, server administrator, designer, spokesman and factotum of a wide-variety of web pages.
spello
Registered User
Posts: 121
Joined: Sat May 28, 2011 11:12 am
Contact:

Re: Cloudflare IP support

Post by spello »

I'm waiting for Cloudflare extension too! :)
Post Reply

Return to “Extension Requests”