OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: myksto on April 11, 2025, 10:48:50 AM

Title: Inline base64 enconded images don't show up in error pages
Post by: myksto on April 11, 2025, 10:48:50 AM
Hi,
I'm on Opnsense 25.1.4_1-amd64 and trying to implement squid web proxy for a network.
Everything looks ok and works fine but the inline base64 image/logo doesn't appear in error pages, when using the squid pages and opnsense pages.
I've tried to implement custom error pages with a personal logo encoded with base64: the custom page show perfectly but not the logo.
I read againg and again the opnsense guide pages but I can't make it to work.
Do I have to activate anything in configuration? Do I have to add some line of code?
The stange fact is that the logo doesn't appear even ewith the standard error pages configuration.

Thanks a lot,
Michele.
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: franco on April 11, 2025, 11:30:02 AM
Hi,

Did this issue appear with the 25.1.4 version or is this a general issue during setup?

Haven't heard of issues in this regard, but could be there although I'm trying to rule out updates as a cause as it seems unlikely.


Cheers,
Franco
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 11, 2025, 11:47:59 AM
Hi Franco,
to tell the truth this is the first implementation of Squid since a lot of time so I can't answer your question.
What I can say is that I tried to open default error pages and my custom error page (with css file in the same dir) outside the installation (on my pc) and the image is displayed correctly.
I attached 2 screenshots to explain:
Image_1 is the error page downloaded from opnsense and displayed on my pc
Image_2 is the error page displayed on a pc filtered by Opnsense/Squid (you can see on the upper left side that logo is missing)

Michele.
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: franco on April 11, 2025, 12:18:13 PM
Can you check the browser console? It may complain about a security policy of inline images not being allowed.


Cheers,
Franco
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 11, 2025, 12:23:07 PM
Sorry,
what do you mean with "browser console"? What should I check?
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 11, 2025, 12:30:32 PM
Sorry again, I found it out.
What should I check anyway?

Thanks.
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: franco on April 11, 2025, 12:36:15 PM
When you load the page it could complain im the console about a security policy blocking the inline image.

Open browser dev console. Reload the error page from squid. Post the messages the console offers.


Thanks,
Franco
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 11, 2025, 02:41:06 PM
Attached what you requested.
Anyway it looks stange to me it could be a browser problem, the error page is loaded with the inline image when it's local and not forwarded by Squid.

Thanks,
Michele.
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: franco on April 11, 2025, 04:51:59 PM
This looks strange not allowing to pick up the static squid icons either, but first I'd check the source code of the page. SQuid is supposed to insert the CSS into the page and this should make the logo work unless the CSS has problems. Did you modify the CSS?


Cheers,
Franco
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 11, 2025, 04:57:55 PM
I modified the CSS for the code related to a new logo but I don't think it's the problem.
I resetted to standard error pages many times (using the GUI) and the problem was there.
Besides yesterday, when I first tried Squid and before modifying anything, the error page was exactly the same: error page without the image.

Thanks,
Michele
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: franco on April 11, 2025, 05:09:17 PM
Sorry, not sure where this may fail at the moment and I'm unable to test this at the moment.

Maybe someone else can chime in?


Cheers,
Franco
Title: Re: Inline base64 enconded images don't show up in errore pages
Post by: myksto on April 14, 2025, 10:39:04 AM
It looks like Squid or Opnsense can't decode inline images.
What and where is the process that decodes those images?
Maybe a problem can be there??

Should I open a case in https://github.com/search?q=repo%3Aopnsense%2Fplugins+squid&type=issues
Title: Re: Inline base64 enconded images don't show up in error pages
Post by: myksto on April 18, 2025, 05:21:13 PM
It's a pity noone helped. :(
I removed Squid in opnsense and setup a linux server with Squid where everything works like a charm.

Bye,
Michele.
Title: Re: Inline base64 enconded images don't show up in error pages
Post by: jarguess on April 21, 2025, 10:39:18 PM
I have the same issue. Looks like its trying to access the image at http://opnsense_hostname.opensense_domain:http_proxy_port/squid-internal-static/icons/SN.png

This doesn't work for me because I don't have local DNS.

Is there a configuration file someplace to customize this generated link so that an IP address can be used??