Project

General

Profile

Actions

Bug #15410

open

cache_object://URL Scheme is removed in Squid-6

Added by Jonathan Lee 3 months ago. Updated 8 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Squid
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
All
Affected Plus Version:
24.03
Affected Architecture:
All

Description

Hello fellow pfSense Squid Proxy Users can you please help?

I am so happy 6.6 is part of pfSense 24 however some small changes are made in 6.6

cache_object://URL Scheme is not removed in Squid-6
cache_object://hostname/request@password

Is used to check status inside the pfSense GUI for this package

It has been replaced with
http://hostname/squid-internal-mgr URL-prefix.

Therefore it will now say access denied when checking status

The status page needs to be updated to reflect the new URL scheme

I spoke with Squid user support and they have confirmed the new URL scheme

Ref:
https://wiki.squid-cache.org/Features/CacheManager/CacheObjectScheme


Files

Actions #1

Updated by Jonathan Lee 3 months ago

this is part of status_squid.php

Actions #2

Updated by Jonathan Lee 3 months ago

this calls /usr/local/sbin/squidclient with the older URI scheme
to access mgr:info

Actions #3

Updated by Jonathan Lee 3 months ago

@function squid_status() {
if (is_service_running('squid')) {
init_config_arr(array('installedpackages', 'squidcache','config'));
$proxy_ifaces = explode(",", config_get_path('installedpackages/squid/config/0/active_interface', ''));
foreach ($proxy_ifaces as $iface) {
if (get_interface_ip($iface)) {
$ip = get_interface_ip($iface);
$lip = '127.0.0.1';
} else {
$ip = get_interface_ipv6($iface);
$lip = '::1';
}
exec("/usr/local/sbin/squidclient -l " . escapeshellarg($lip) .
" -h " . escapeshellarg($ip) . " mgr:info", $result);
}
} else {
return(gettext('Squid Proxy is not running.'));
}
$i = 0;
$matchbegin = "Squid Object Cache";
foreach ($result as $line) {
if (preg_match("/{$matchbegin}/", $line)) {
$begin = $i;
}
$i++;
}

$output = "";
$i = 0;
foreach ($result as $line) {
if ($i >= $begin) {
$output .= $line . "\n";
}
$i++;
}
return $output;
} @

this is using the old version here with mgr:info

Actions #4

Updated by Jonathan Lee 3 months ago

squidclient mgr:info

no longer works this should be changed to reflect the new use with

squidclient -h 127.0.0.1 -p 3128 mgr:info shows access denined

@
You do have direct proxy (and thus manager) access via the 192.168.1.1:3128 so this URL should work:
http://192.168.1.1:3128/squid-internal-mgr/menu

.. or substitute the raw-IP for the visible_hostname setting if that hostname actually resolves to that IP.

HTH
Amos@

I think this should be
should be changed to reflect squid-internal-mgr:info

I am going to test

Actions #5

Updated by Jonathan Lee 3 months ago

Test failed it still says no access

Actions #7

Updated by Jonathan Lee 3 months ago

I can access the cachemgr.cgi if you are using it within the lightsquid area however.

I will find my issue and post a pull still researching

Actions #8

Updated by Jonathan Lee 3 months ago

Sorry This is the issue I am researching on how to resolve do to the cache_object change

I just have to find the line of code that references cache_object and replace it with the new URI scheme use

Actions #9

Updated by Jonathan Lee 8 days ago

Researching with Squid Email support in Squid 6.6

On 2024-07-18 00:55, Jonathan Lee wrote:

curl http://localhost:3128/squid-internal-mgr/info Where would I place the password?

See "man curl" or online manual pages for curl. They will point you to two relevant options: --user and --proxy-user. AFAICT, your particular cache manager requests are sent to the proxy (as if it were an origin server) rather than through the proxy. Thus, you should use --user.

As I keep saying on this thread, due to Squid complications related to Bug 5283, specifying seemingly correct client parameters may not be enough to convince Squid to accept the cache manager request. I recommend the following procedure:

1. List the corresponding http_port directive first, before any other http_port, https_port, and ftp_port directives. Do not use interception of any kind for this cache manager port.

2. Use curl with absolute squid-internal-mgr URLs with http scheme (like you show above). Do not use "curl --proxy" or similar. Do not use https scheme.

3. In that absolute mgr URL, use the host name that matches visible_hostname in squid.conf. If you do not have visible_hostname in squid.conf, add it. This is not required, but, due to Squid bugs, it is often much easier to get this to work with visible_hostname than without it.

4. Make (passwordless) mgr:info use case working first, before trying to get password-protected pages working.

5. When you do specify a username and a password, remember that you are sending this request to an (equivalent of) a service running on an origin server, not a proxy (hence --user rather than --proxy-user).

If you cannot figure it out despite carefully going through the above steps, share (privately if needed) a pointer to compressed ALL,9 cache.log while reproducing the problem with throw-away credentials on an idle Squid with a single curl request. Mention which step you got stuck on.

HTH,

Alex.

Actions

Also available in: Atom PDF