Page 3 of 4

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 12:19 pm
by Cin-
I've checked everything ten times or so, but all settings are okay.

It's that the extension does nothing. No URL's are changed at all.

If it works on a vanilla phpBB 3.2 install it should work on my board too. It's just that I use nginx+apache as a configuration and thought it might have something to do with this.

I'll keep looking, maybe try another server. I'll let you know if I find the problem (and if it's related to your extension).

Edit: It also doesn't work on a fresh phpBB 3.2.0-RC2 install on my own PC (wamp). It's not my proxyaddress, because when i manually add it to the URL of an image and use img tags, the image shows via cloudinary.

So posting [ img] http://s21.postimg.org/g21720t9j/image.jpg [ /img] => shows the insecure image (URL not changed)

Posting [ img] https://res.cloudinary.com/XXX/image/fe ... /image.jpg [ /img] => shows the secure image via cloudinary

So manually adding the proxyaddress works. Is it possible that your extension just isnt compatible with 3.2-RC2?

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 6:23 pm
by v12mike
Cin- wrote:I've checked everything ten times or so, but all settings are okay.

It's that the extension does nothing. No URL's are changed at all.
Sorry, but I have to ask if you have set the mode of the extension to "enabled" in the ACP configuration page.
Cin- wrote: If it works on a vanilla phpBB 3.2 install it should work on my board too. It's just that I use nginx+apache as a configuration and thought it might have something to do with this.

I'll keep looking, maybe try another server. I'll let you know if I find the problem (and if it's related to your extension).

Edit: It also doesn't work on a fresh phpBB 3.2.0-RC2 install on my own PC (wamp). It's not my proxyaddress, because when i manually add it to the URL of an image and use img tags, the image shows via cloudinary.

So posting [ img] http://s21.postimg.org/g21720t9j/image.jpg [ /img] => shows the insecure image (URL not changed)

Posting [ img] https://res.cloudinary.com/XXX/image/fe ... /image.jpg [ /img] => shows the secure image via cloudinary

So manually adding the proxyaddress works. Is it possible that your extension just isnt compatible with 3.2-RC2?
It does work on vanilla 3.2.0-RC1.

You could (as a test) try installing the original v1.0.1 phpbb team version, to see if that does something (even if you don't mod the code for your configuration, it should at least be rewriting the links).

If that (by some chance) works, then I think I know where the problem is.

I will set up an RC2 forum to check, but probably not for a few days.

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 6:56 pm
by v12mike
Can you post here the actual html image link that is being generated by your forum for an image?

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 10:32 pm
by Cin-
Okay, now it works for avatars (I have the last post avatar extension installed) and those URLs are being rewritten (3.2-RC2). I never looked at the avatars because I don't enable external linking so all avatars are uploaded anyway. Both modes (camo + simple) work.

The images in my posts aren't rewritten though. I thought the locations you included should make that happen, no?

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 10:59 pm
by v12mike
Cin- wrote:Okay, now it works for avatars (I have the last post avatar extension installed) and those URLs are being rewritten (3.2-RC2). I never looked at the avatars because I don't enable external linking so all avatars are uploaded anyway. Both modes (camo + simple) work.

The images in my posts aren't rewritten though. I thought the locations you included should make that happen, no?
OK, if the avatars are being re-written, then the extension is basically configured and working, but something might have changed in RC2 to break compatibility. Can you examine the output html code and post an example of an image tag that should be rewritten but isn't? (in case the html has changed).

Did you try the 'training mode', in case the template variable name has changed?

Re: [BETA] Camo SSL Image Proxy

Posted: Tue Dec 06, 2016 11:11 pm
by Cin-
Edit:

I looked into the template locations and now I'm starting to think I misunderstood what this extension does. I thought it would rewrite the URLs of images when people post these on my forum. Because I recently switched to SSL-only and get the mixed secure/not-secure warning in chrome when viewing posts that contain images from an http site.

I thought the location postrow - message would identify unsecure URLs present in posts, but now I'm starting to think i'm wrong?

//Original message:

I tried the training mode, it doesn't appear to do anything.

This is the HTML output:

Code: Select all

<div id="post_content593450">
	<h3 ><a href="#p593450">Fotografie...</a></h3>
		<p class="author">
			<a class="unread" href="./viewtopic.php?p=593450#p593450" title="Bericht">
				<i class="icon fa-envelope fa-fw icon-lightgray icon-md" aria-hidden="true"></i><span class="sr-only">Bericht</span>
			</a>
			<span class="responsive-hide">door <strong><a href="./memberlist.php?mode=viewprofile&u=2" style="color: #0099CC;" class="username-coloured">Cin</a></strong> &raquo; </span>54 minuten geleden 
		</p>
		
	<div class="content"><img src="http://i997.photobucket.com/albums/af93/tcfcfphotos/be1d7160.jpg" class="postimage" alt="Afbeelding"></div>
	
</div>

Re: [BETA] Camo SSL Image Proxy

Posted: Wed Dec 07, 2016 12:57 am
by v12mike
I can't see anything changed in the html, so no clue at present. I will see if I can get a -RC2 board running to test.

Re: [BETA] Camo SSL Image Proxy

Posted: Wed Dec 07, 2016 2:39 am
by v12mike
Cin- wrote:Edit:

I looked into the template locations and now I'm starting to think I misunderstood what this extension does. I thought it would rewrite the URLs of images when people post these on my forum. Because I recently switched to SSL-only and get the mixed secure/not-secure warning in chrome when viewing posts that contain images from an http site.

I thought the location postrow - message would identify unsecure URLs present in posts, but now I'm starting to think i'm wrong?

//Original message:

I tried the training mode, it doesn't appear to do anything.
I think that what you want is what the extension does.

Try deleting all of the directly mapped domains (in case you configured any with wrong syntax).
If avatar urls are being correctly rewritten, try using one of those urls as an image link in a post.

Do you have a phpBB 3.1 forum you can test the extension on, to see if it behaves any differently?

Re: [BETA] Camo SSL Image Proxy

Posted: Wed Dec 07, 2016 8:01 am
by Cin-
Thanks, no hurry though :)

I just tested a 3.1 board on my pc (wamp) and it works as it should. When I disable the location "postrow - message" on the 3.1 board, it indeed removes the proxy from the tagged URLs inside a post.

On my 3.2-RC2 server deleting all of the directly mapped domains or posting an avatar url doesn't help (avatars are rewritten but images inside posts not).

When I do a clean install of 3.2 RC1 or RC2 on my local pc (wamp) the extension doesn't work either. When I install 3.1 (extension works), then upgrade to 3.2 (RC 1 or 2) the extension doesn't work anymore (avatars are rewritten but images inside posts not).

Re: [BETA] Camo SSL Image Proxy

Posted: Wed Dec 07, 2016 11:18 am
by kaspir
Anyone know how to add the template for 'phpbb pages' ext?

Re: [BETA] Camo SSL Image Proxy

Posted: Wed Dec 07, 2016 6:11 pm
by v12mike
Cin- wrote:Thanks, no hurry though :)

I just tested a 3.1 board on my pc (wamp) and it works as it should. When I disable the location "postrow - message" on the 3.1 board, it indeed removes the proxy from the tagged URLs inside a post.

On my 3.2-RC2 server deleting all of the directly mapped domains or posting an avatar url doesn't help (avatars are rewritten but images inside posts not).

When I do a clean install of 3.2 RC1 or RC2 on my local pc (wamp) the extension doesn't work either. When I install 3.1 (extension works), then upgrade to 3.2 (RC 1 or 2) the extension doesn't work anymore (avatars are rewritten but images inside posts not).
Thanks for doing that research, it should make it much easier to find the problem, but it is a bit worrying that an upgraded board behaves differently to a fresh install. Do you know if there any intentional difference?
[edit] I have reproduced the problem on 3.2.0, I have found a change in the format of img tags in 3.2.0 which is upsetting this extension. I have raised a bug report against phpbb for this, if it turns out to be intentional, I will patch the extension to handle it.[/edit]
kaspir wrote:Anyone know how to add the template for 'phpbb pages' ext?
Have you tried using the training mode? it should find it for you.

Re: [BETA] Camo SSL Image Proxy

Posted: Thu Dec 08, 2016 9:24 am
by Cin-
v12mike wrote: Thanks for doing that research, it should make it much easier to find the problem, but it is a bit worrying that an upgraded board behaves differently to a fresh install. Do you know if there any intentional difference?
[edit] I have reproduced the problem on 3.2.0, I have found a change in the format of img tags in 3.2.0 which is upsetting this extension. I have raised a bug report against phpbb for this, if it turns out to be intentional, I will patch the extension to handle it.[/edit]
I think you misunderstood me: the board doesn't behave differently between a fresh install or upgrade of 3.2, the extension behaves the same: avatar URLs (with last post avatar ext) are rewritten, but image URLs inside posts are not rewritten whereas in 3.1 everything works.

But I see you found the problem so great! Thanks for your work!

Re: [BETA] Camo SSL Image Proxy

Posted: Thu Dec 08, 2016 5:55 pm
by v12mike
Cin- wrote:
v12mike wrote: Thanks for doing that research, it should make it much easier to find the problem, but it is a bit worrying that an upgraded board behaves differently to a fresh install. Do you know if there any intentional difference?
[edit] I have reproduced the problem on 3.2.0, I have found a change in the format of img tags in 3.2.0 which is upsetting this extension. I have raised a bug report against phpbb for this, if it turns out to be intentional, I will patch the extension to handle it.[/edit]
I think you misunderstood me: the board doesn't behave differently between a fresh install or upgrade of 3.2, the extension behaves the same: avatar URLs (with last post avatar ext) are rewritten, but image URLs inside posts are not rewritten whereas in 3.1 everything works.

But I see you found the problem so great! Thanks for your work!
To clarify what I found: The difference in behaviour is that when an image link is encountered in a post, the [img]...[/img] BBCode is converted into an html <img ...> tag. In 3.2.0, the html tag is missing a / character that was present in 3.1.x. I think that this is probably a bug, as it is still present in other img tags generated by 3.2.0.

Re: [BETA] Camo SSL Image Proxy

Posted: Fri Dec 09, 2016 2:00 pm
by Cin-
I tried the fix proposed by JoshyPHP on tracker.phpbb.com and it works.

However, I have one gif that is being rewritten but google/firefox console still tag it as an insecure link (very weird because in the source code it shows as https)

Code: Select all

http://img12.deviantart.net/f11c/i/2012/253/9/2/smb3dx_grass_land__mockup__by_dogmansp-d5ea0zf.gif
I thought you might use Joshy's fix, and since I lack the knowledge to see what exactly is wrong with this URL I thought I post it for you to find out :)

Re: [BETA] Camo SSL Image Proxy

Posted: Fri Dec 09, 2016 6:38 pm
by v12mike
Cin- wrote:I tried the fix proposed by JoshyPHP on tracker.phpbb.com and it works.

However, I have one gif that is being rewritten but google/firefox console still tag it as an insecure link (very weird because in the source code it shows as https)

Code: Select all

http://img12.deviantart.net/f11c/i/2012/253/9/2/smb3dx_grass_land__mockup__by_dogmansp-d5ea0zf.gif
I thought you might use Joshy's fix, and since I lack the knowledge to see what exactly is wrong with this URL I thought I post it for you to find out :)
Joshy's fix does not have quite the right behaviour for some of the html tags generated by the forum (and other extensions).

try:

Code: Select all

'#<img [^>]*src="(http://[^"]+)"[^>]*>#'
at lines 36 and 190 of listener.php.

I tried your .gif, and it works OK on my test boards. Check again with the security checker in your browser to see that it is actually that url that is causing the problem.