From db072559dc851c7d85cf78c0b4b449f3262dd7d9 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 20 Oct 2015 11:00:28 +0200 Subject: No need to check for loopback with transparent proxy --- config/lightsquid/lightsquid.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc index 6bc4df4b..7decc050 100644 --- a/config/lightsquid/lightsquid.inc +++ b/config/lightsquid/lightsquid.inc @@ -456,18 +456,22 @@ function lightsquid_validate_input($post, &$input_errors) { } else { $ext_cachemanager = ""; } - if (strpos($ext_cachemanager, $ifmgr) === FALSE) { + if (strpos($ext_cachemanager, $ifmgr) === false) { $input_errors[] = "Please, add '{$ifmgr}' to Squid - Access Control - External Cache-Managers first."; } } - /* SqStat - check that Squid listens on loopback */ + /* SqStat - check that Squid listens on loopback unless the proxy is set as transparent (which makes it listen on localhost automatically) */ if (is_array($config['installedpackages']['squid']['config'])) { $active_interfaces = ($config['installedpackages']['squid']['config'][0]['active_interface'] ?: ""); + $transparent = ($config['installedpackages']['squid']['config'][0]['transparent_proxy'] == "on" ? true : false); } else { $active_interfaces = ""; + $transparent = false; } - if (strpos($active_interfaces, "lo0") === FALSE) { - $input_errors[] = "Please, configure Squid - General - Proxy Interface(s) to include 'loopback' interface."; + if (!$transparent) { + if (strpos($active_interfaces, "lo0") === false) { + $input_errors[] = "Please, configure Squid - General - Proxy Interface(s) to include 'loopback' interface."; + } } /* 'Skip URL(s)' validation */ -- cgit v1.2.3