diff options
-rw-r--r-- | packages/squid/squid.inc | 31 | ||||
-rw-r--r-- | packages/squid/squid.xml | 4 | ||||
-rw-r--r-- | packages/squid/squid_nac.xml | 7 | ||||
-rw-r--r-- | packages/squid3/squid.inc | 30 | ||||
-rw-r--r-- | packages/squid3/squid_nac.xml | 7 | ||||
-rw-r--r-- | pkg_config.7.xml | 4 | ||||
-rw-r--r-- | pkg_config.xml | 2 |
7 files changed, 72 insertions, 13 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc index 9f08f7a9..1db19bd8 100644 --- a/packages/squid/squid.inc +++ b/packages/squid/squid.inc @@ -314,13 +314,10 @@ function squid_validate_general($post, $input_errors) { if(!empty($post['dns_nameservers'])) { $altdns = explode(";", ($post['dns_nameservers'])); -// $conf .= "# Custom options\n"; foreach ($altdns as $dnssrv) { -// $conf .= $custopt."\n"; if (!is_ipaddr($dnssrv)) $input_errors[] = 'You must enter a valid IP address in the \'Alternate DNS servers\' field'; }} - } function squid_validate_upstream($post, $input_errors) { @@ -413,6 +410,13 @@ function squid_validate_nac($post, $input_errors) { if (!empty($time) && !squid_is_timerange($time)) $input_errors[] = "The time range '$time' is not a valid time range"; } + + if(!empty($post['ext_cachemanager'])) { + $extmgr = explode(";", ($post['ext_cachemanager'])); + foreach ($extmgr as $mgr) { + if (!is_ipaddr($mgr)) + $input_errors[] = 'You must enter a valid IP address in the \'External Cache Manager\' field'; + }} } function squid_validate_traffic($post, $input_errors) { @@ -572,7 +576,7 @@ EOD; foreach ($altdns as $dnssrv) { $conf .= $dnssrv." "; } -// $conf .= "\n"; + $conf .= "\n"; } return $conf; @@ -696,8 +700,27 @@ EOD; } $conf .= <<<EOD + cache deny dynamic http_access allow manager localhost + +EOD; + + if(!empty($settings['ext_cachemanager'])) { + $extmgr = explode(";", ($settings['ext_cachemanager'])); + $count = 1; + $conf .= "\n# Allow external cache managers\n"; +// $conf .= "acl ext_manager src ".$settings['ext_cachemanager']."\n"; + foreach ($extmgr as $mgr) { + $conf .= "acl ext_manager_".$count." src "; + $conf .= $mgr." "; + $conf .= "\n"; + $conf .= "http_access allow manager ext_manager_".$count."\n"; + $count += 1; + }} + + $conf .= <<<EOD + http_access deny manager http_access allow purge localhost http_access deny purge diff --git a/packages/squid/squid.xml b/packages/squid/squid.xml index 50409a90..6f20d586 100644 --- a/packages/squid/squid.xml +++ b/packages/squid/squid.xml @@ -282,8 +282,8 @@ <fieldname>disable_squidversion</fieldname> <description>If set, suppress Squid version string info in HTTP headers and HTML error pages.</description> <type>checkbox</type> - </field> - <field> + </field> + <field> <fielddescr>Custom Options</fielddescr> <fieldname>custom_options</fieldname> <description>You can put your own custom options here, separated by semi-colons (;). They'll be added to the configuration. They need to be squid.conf native options, otherwise squid will NOT work.</description> diff --git a/packages/squid/squid_nac.xml b/packages/squid/squid_nac.xml index 435671a2..8b1741d6 100644 --- a/packages/squid/squid_nac.xml +++ b/packages/squid/squid_nac.xml @@ -126,6 +126,13 @@ <rows>5</rows> <encoding>base64</encoding> </field> + <field> + <fielddescr>Allow an external host as a cachemanager</fielddescr> + <fieldname>ext_cachemanager</fieldname> + <description>Enter the IPs for the external Cache Managers here, separated by semi-colons (;).</description> + <type>input</type> + <size>60</size> + </field> </fields> <custom_php_validation_command> squid_validate_nac($_POST, &$input_errors); diff --git a/packages/squid3/squid.inc b/packages/squid3/squid.inc index 9b87ce80..fc647481 100644 --- a/packages/squid3/squid.inc +++ b/packages/squid3/squid.inc @@ -314,13 +314,10 @@ function squid_validate_general($post, $input_errors) { if(!empty($post['dns_nameservers'])) { $altdns = explode(";", ($post['dns_nameservers'])); -// $conf .= "# Custom options\n"; foreach ($altdns as $dnssrv) { -// $conf .= $custopt."\n"; if (!is_ipaddr($dnssrv)) $input_errors[] = 'You must enter a valid IP address in the \'Alternate DNS servers\' field'; }} - } function squid_validate_upstream($post, $input_errors) { @@ -413,6 +410,13 @@ function squid_validate_nac($post, $input_errors) { if (!empty($time) && !squid_is_timerange($time)) $input_errors[] = "The time range '$time' is not a valid time range"; } + + if(!empty($post['ext_cachemanager'])) { + $extmgr = explode(";", ($post['ext_cachemanager'])); + foreach ($extmgr as $mgr) { + if (!is_ipaddr($mgr)) + $input_errors[] = 'You must enter a valid IP address in the \'External Cache Manager\' field'; + }} } function squid_validate_traffic($post, $input_errors) { @@ -572,7 +576,7 @@ EOD; foreach ($altdns as $dnssrv) { $conf .= $dnssrv." "; } -// $conf .= "\n"; + $conf .= "\n"; } return $conf; @@ -697,6 +701,24 @@ EOD; $conf .= <<<EOD cache deny dynamic http_access allow manager localhost + +EOD; + + if(!empty($settings['ext_cachemanager'])) { + $extmgr = explode(";", ($settings['ext_cachemanager'])); + $count = 1; + $conf .= "\n# Allow external cache managers\n"; +// $conf .= "acl ext_manager src ".$settings['ext_cachemanager']."\n"; + foreach ($extmgr as $mgr) { + $conf .= "acl ext_manager_".$count." src "; + $conf .= $mgr." "; + $conf .= "\n"; + $conf .= "http_access allow manager ext_manager_".$count."\n"; + $count += 1; + }} + + $conf .= <<<EOD + http_access deny manager http_access allow purge localhost http_access deny purge diff --git a/packages/squid3/squid_nac.xml b/packages/squid3/squid_nac.xml index 435671a2..8b1741d6 100644 --- a/packages/squid3/squid_nac.xml +++ b/packages/squid3/squid_nac.xml @@ -126,6 +126,13 @@ <rows>5</rows> <encoding>base64</encoding> </field> + <field> + <fielddescr>Allow an external host as a cachemanager</fielddescr> + <fieldname>ext_cachemanager</fieldname> + <description>Enter the IPs for the external Cache Managers here, separated by semi-colons (;).</description> + <type>input</type> + <size>60</size> + </field> </fields> <custom_php_validation_command> squid_validate_nac($_POST, &$input_errors); diff --git a/pkg_config.7.xml b/pkg_config.7.xml index 56d2bb6b..6b532ee1 100644 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -281,7 +281,7 @@ <descr>High performance web proxy cache.</descr> <website>http://www.squid-cache.org/</website> <category>Network</category> - <version>2.6.21_02</version> + <version>2.6.21_03</version> <status>BETA</status> <required_version>1.2.1</required_version> <maintainer>fernando@netfilter.com.br seth.mos@xs4all.nl</maintainer> @@ -297,7 +297,7 @@ <descr>EXPERIMANTAL! Not all directives are ported yet! High performance web proxy cache.</descr> <website>http://www.squid-cache.org/</website> <category>Network</category> - <version>3.0.8_01</version> + <version>3.0.8_02</version> <status>ALPHA</status> <required_version>1.2.1</required_version> <maintainer>fernando@netfilter.com.br seth.mos@xs4all.nl mfuchs77@googlemail.com</maintainer> diff --git a/pkg_config.xml b/pkg_config.xml index f0deb30e..7cd1b6d5 100644 --- a/pkg_config.xml +++ b/pkg_config.xml @@ -507,7 +507,7 @@ <descr>High performance web proxy cache.</descr> <website>http://www.squid-cache.org/</website> <category>Network</category> - <version>2.6.18.1_02</version> + <version>2.6.18.1_03</version> <status>BETA</status> <required_version>1.0</required_version> <maintainer>fernando@netfilter.com.br seth.mos@xs4all.nl</maintainer> |