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)
Scam Warning
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 » Sat Jun 13, 2015 8:33 pm

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: 444
Joined: Sun Apr 14, 2002 2:11 am
Location: Canada

Re: Cloudflare IP support

Post by Swanny » Sun Jun 14, 2015 5:13 am

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 » Sun Jun 14, 2015 11:08 am

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 » Wed Jul 29, 2015 10:11 pm

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 » Fri Apr 22, 2016 9:45 am

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: 14356
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Cloudflare IP support

Post by 3Di » Tue Jul 19, 2016 2:47 am

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.
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
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21665
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Cloudflare IP support

Post by Mick » Tue Jul 19, 2016 1:04 pm

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 » Tue Jul 19, 2016 2:01 pm

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: 66829
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cloudflare IP support

Post by Lumpy Burgertushie » Tue Jul 19, 2016 2:43 pm

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
david63
Registered User
Posts: 16681
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Cloudflare IP support

Post by david63 » Tue Jul 19, 2016 2:57 pm

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: 66829
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Cloudflare IP support

Post by Lumpy Burgertushie » Tue Jul 19, 2016 3:05 pm

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

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 » Tue Aug 02, 2016 4:37 pm

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: 2164
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Re: Cloudflare IP support

Post by Senky » Thu Sep 01, 2016 9:57 pm

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.

User avatar
k0nsl
Registered User
Posts: 88
Joined: Mon Mar 25, 2013 11:17 pm
Location: Scandinavia
Name: Eduard Drehner
Contact:

Re: Cloudflare IP support

Post by k0nsl » Fri Sep 02, 2016 3:26 am

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 » Mon Sep 19, 2016 8:54 pm

I'm waiting for Cloudflare extension too! :)

Post Reply

Return to “Extension Requests”