From 92d04b4b8ae266fef55700651525b1203674ae3c Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Tue, 19 Dec 2006 21:20:19 +0000 Subject: Last few commits have been in no particular order: - remove stopping and starting of squid on reconfiguration. use squid -k reconfigure instead. - stop killing and starting the proxy_monitor.sh script. It's not needed. - Always allow the webgui port for access, otherwise you could lock yourself from the gui. - Add cache location option. If you have another disk to store them on. - Fix input validation on a number of gui items. - Transparent and normal proxy mode now work. - Fix throttling. TEST - Authentication UNTESTED I think we are good for another public test attempt --- packages/squid.inc | 41 +++++++++++++---------------------------- packages/squid_cache.xml | 9 +++++++++ 2 files changed, 22 insertions(+), 28 deletions(-) (limited to 'packages') diff --git a/packages/squid.inc b/packages/squid.inc index bab0f788..deab63d9 100644 --- a/packages/squid.inc +++ b/packages/squid.inc @@ -169,6 +169,15 @@ function squid_validate_general($post, $input_errors) { $icp_port = trim($post['icp_port']); if (!empty($icp_port) && !is_port($icp_port)) $input_errors[] = 'You must enter a valid port number in the \'ICP port\' field'; + + if (substr($post['log_dir'], -1, 1) == '/') + $input_errors[] = 'You may not end log location with an / mark'; + + if ($post['log_dir']{0} != '/') + $input_errors[] = 'You must start log location with a / mark'; + if (strlen($post['log_dir']) <= 3) + $input_errors[] = "That is not a valid log location dir"; + if (($post['transparent_proxy'] == 'on')) { $port = 80; } else { @@ -391,15 +400,6 @@ EOD; } - log_error("Reloading squid configuration"); - mwexec("/usr/local/sbin/squid -k reconfigure"); - /* kill any running proxy alarm scripts */ - // log_error("Stopping proxy monitor script"); - // mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill"); - /* restart proxy alarm scripts */ - // log_error("Starting proxy monitor script"); - // mwexec_bg("/usr/local/etc/rc.d/proxy_monitor.sh"); - return $conf; } @@ -469,12 +469,13 @@ function squid_resync_nac() { global $config, $valid_acls; $settings = $config['installedpackages']['squidnac']['config'][0]; + $webgui_port = $config['system']['webgui']['port']; $conf = <<100 input + + Hard disk cache location + harddisk_cache_location + This is the directory where the cache will be stored. (note: do not end with a /). If you change this location, squid needs to make a new cache, this could take a while + + /var/squid/cache + 60 + input + Memory cache size memory_cache_size -- cgit v1.2.3