aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid
diff options
context:
space:
mode:
Diffstat (limited to 'config/squid')
-rw-r--r--config/squid/proxy_monitor.sh8
-rw-r--r--config/squid/squid.inc16
-rw-r--r--config/squid/squid.xml5
-rw-r--r--config/squid/squid_cache.xml8
4 files changed, 18 insertions, 19 deletions
diff --git a/config/squid/proxy_monitor.sh b/config/squid/proxy_monitor.sh
index fab2ee54..fa5a87bb 100644
--- a/config/squid/proxy_monitor.sh
+++ b/config/squid/proxy_monitor.sh
@@ -41,7 +41,7 @@ sleep 5
# Squid monitor 1.2
while [ /bin/true ]; do
if [ ! -f /var/run/squid_alarm ]; then
- NUM_PROCS=`ps auxw | grep "[s]quid -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'`
+ NUM_PROCS=`ps auxw | grep "[s]quid -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'`
if [ $NUM_PROCS -lt 1 ]; then
# squid is down
echo "Squid has exited. Reconfiguring filter." | \
@@ -50,16 +50,16 @@ while [ /bin/true ]; do
/usr/local/etc/rc.d/squid.sh start
sleep 3
echo "Reconfiguring filter..." | logger -p daemon.info -i -t Squid_Alarm
- /etc/rc.filter_configure_sync
+ /etc/rc.filter_configure
touch /var/run/squid_alarm
fi
fi
- NUM_PROCS=`ps auxw | grep "[s]quid -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'`
+ NUM_PROCS=`ps auxw | grep "[s]quid -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'`
if [ $NUM_PROCS -gt 0 ]; then
if [ -f /var/run/squid_alarm ]; then
echo "Squid has resumed. Reconfiguring filter." | \
logger -p daemon.info -i -t Squid_Alarm
- /etc/rc.filter_configure_sync
+ /etc/rc.filter_configure
rm /var/run/squid_alarm
fi
fi
diff --git a/config/squid/squid.inc b/config/squid/squid.inc
index 7a31f750..3848b818 100644
--- a/config/squid/squid.inc
+++ b/config/squid/squid.inc
@@ -266,7 +266,7 @@ function squid_deinstall_command() {
mwexec("ps awux | grep \"dnsserver\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill");
mwexec("ps awux | grep \"unlinkd\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill");
update_status("Reloading filter...");
- filter_configure_sync();
+ filter_configure();
}
function squid_before_form_general($pkg) {
@@ -324,17 +324,6 @@ function squid_validate_general($post, $input_errors) {
$input_errors[] = "You can not run squid on the same port as the webgui";
}
- if (($post['transparent_proxy'] != 'on') && ($post['private_subnet_proxy_off'] == 'on')) {
- $input_errors[] = "You can not bypass traffic to private subnets without using the transparent proxy.";
- }
-
- if (($post['transparent_proxy'] != 'on') && !empty($post['defined_ip_proxy_off'])) {
- $input_errors[] = "You can not bypass traffic from specific IPs without using the transparent proxy.";
- }
- if (($post['transparent_proxy'] != 'on') && !empty($post['defined_ip_proxy_off_dest'])) {
- $input_errors[] = "You can not bypass traffic to specific IPs without using the transparent proxy.";
- }
-
foreach (array('defined_ip_proxy_off') as $hosts) {
foreach (explode(";", $post[$hosts]) as $host) {
$host = trim($host);
@@ -690,6 +679,7 @@ function squid_resync_cache() {
$memory_cache_size = ($settings['memory_cache_size'] ? $settings['memory_cache_size'] : 8);
$max_objsize = ($settings['maximum_object_size'] ? $settings['maximum_object_size'] : 10);
$min_objsize = ($settings['minimum_object_size'] ? $settings['minimum_object_size'] : 0);
+ $max_objsize_in_mem = ($settings['maximum_objsize_in_mem'] ? $settings['maximum_objsize_in_mem'] : 32);
$cache_policy = ($settings['cache_replacement_policy'] ? $settings['cache_replacement_policy'] : 'heap LFUDA');
$memory_policy = ($settings['memory_replacement_policy'] ? $settings['memory_replacement_policy'] : 'heap GDSF');
$offline_mode = ($settings['enable_offline'] == 'on' ? 'on' : 'off');
@@ -712,7 +702,7 @@ function squid_resync_cache() {
$conf = <<<EOD
cache_mem $memory_cache_size MB
-maximum_object_size_in_memory 32 KB
+maximum_object_size_in_memory $max_objsize_in_mem KB
memory_replacement_policy $memory_policy
cache_replacement_policy $cache_policy
cache_dir $disk_cache_opts
diff --git a/config/squid/squid.xml b/config/squid/squid.xml
index 4ce0af0f..6f9ecb18 100644
--- a/config/squid/squid.xml
+++ b/config/squid/squid.xml
@@ -166,6 +166,7 @@
<fieldname>transparent_proxy</fieldname>
<description>If transparent mode is enabled, all requests for destination port 80 will be forwarded to the proxy server without any additional configuration necessary.</description>
<type>checkbox</type>
+ <enablefields>private_subnet_proxy_off,defined_ip_proxy_off,defined_ip_proxy_off_dest</enablefields>
<required/>
</field>
<field>
@@ -177,14 +178,14 @@
<field>
<fielddescr>Bypass proxy for these source IPs</fielddescr>
<fieldname>defined_ip_proxy_off</fieldname>
- <description>Do not forward traffic from these &lt;b&gt;source&lt;/b&gt; IPs, CIDR nets, hostnames, or aliases through the proxy server but directly through the firewall. Separate by semi-colons (;).</description>
+ <description>Do not forward traffic from these &lt;b&gt;source&lt;/b&gt; IPs, CIDR nets, hostnames, or aliases through the proxy server but directly through the firewall. Separate by semi-colons (;). [Applies only to transparent mode]</description>
<type>input</type>
<size>80</size>
</field>
<field>
<fielddescr>Bypass proxy for these destination IPs</fielddescr>
<fieldname>defined_ip_proxy_off_dest</fieldname>
- <description>Do not proxy traffic going to these &lt;b&gt;destination&lt;/b&gt; IPs, CIDR nets, hostnames, or aliases, but let it pass directly through the firewall. Separate by semi-colons (;).</description>
+ <description>Do not proxy traffic going to these &lt;b&gt;destination&lt;/b&gt; IPs, CIDR nets, hostnames, or aliases, but let it pass directly through the firewall. Separate by semi-colons (;). [Applies only to transparent mode]</description>
<type>input</type>
<size>80</size>
</field>
diff --git a/config/squid/squid_cache.xml b/config/squid/squid_cache.xml
index 881f15b3..55a1ca59 100644
--- a/config/squid/squid_cache.xml
+++ b/config/squid/squid_cache.xml
@@ -136,6 +136,14 @@
<default_value>4</default_value>
</field>
<field>
+ <fielddescr>Maximum object size in RAM</fielddescr>
+ <fieldname>maximum_objsize_in_mem</fieldname>
+ <description>Objects smaller than the size specified (in kilobytes) will be saved in RAM. Default is 32.</description>
+ <type>input</type>
+ <required/>
+ <default_value>32</default_value>
+ </field>
+ <field>
<fielddescr>Level 1 subdirectories</fielddescr>
<fieldname>level1_subdirs</fieldname>
<description>Each level-1 directory contains 256 subdirectories, so a value of 256 level-1 directories will use a total of 65536 directories for the hard disk cache. This will significantly slow down the startup process of the proxy service, but can speed up the caching under certain conditions.</description>