From f2863b1c72a070e8b1e5c9320fc8aa4496babb03 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 5 Feb 2005 23:15:48 +0000 Subject: Update BKW's squid GUI changes. --- packages/squid.xml | 105 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 84 insertions(+), 21 deletions(-) (limited to 'packages') diff --git a/packages/squid.xml b/packages/squid.xml index e7cc3688..ff3fc4f0 100644 --- a/packages/squid.xml +++ b/packages/squid.xml @@ -1,14 +1,66 @@ - squid - - - ['installedpackages']['squid']['config'] - - - echo "<pre>"; - system("/bin/mkdir /usr/local/etc/squid"); + ['installedpackages']['squid']['config'] + pkg_edit.php?xml=squid.xml&id=0&savemsg=Settings%20saved. + squid + + Squid + Squid-Cache Proxy +
Services
+ pkg_edit.php?xml=squid.xml&id=0 +
+ + + hostname + visable_hostname + note: if left empty your default hostname will be used. + input + + + http_port + http_port + note: default proxy port is 3128. + input + + + httpd_accel_with_proxy + httpd_accel_with_proxy + enabled by default + select + + + + + + + cache size [MB] + cache_mem + hint: fill 1/3 of the cache memory size you want squid to use. + input + + + admin email + cache_mgr + + input + + + blocked words + rowhelper + + + badURL + url that contain any of the words will be blocked. + input + + + + + + + + function sync_package() { + system("/bin/mkdir /usr/local/etc/squid 2>/dev/null"); $lancfg = $config['interfaces']['lan']; $lanif = $lancfg['if']; $lanip = $lancfg['ipaddr']; @@ -17,6 +69,11 @@ $netmask = ""; $fout = fopen("/usr/local/etc/squid/squid.conf","w"); fwrite($fout, "# cat squid.conf\n"); + fwrite($fout, "visable_hostname " . $_POST['hostname'] . "\n"); + fwrite($fout, "http_port " . $_POST['http_port'] . "\n"); + fwrite($fout, "httpd_accel_with_proxy " . $_POST['httpd_accel_with_proxy'] . "\n"); + fwrite($fout, "cache_mem " . $_POST['cache_mem'] . "\n"); + fwrite($fout, "cache_mgr " . $_POST['cache_mgr'] . "\n"); fwrite($fout, "http_port 3128\n"); fwrite($fout, "icp_port 0\n"); fwrite($fout, "acl localnet src " . $lansa . "/" . $lansn . "\n"); @@ -29,11 +86,11 @@ fwrite($fout, "http_access deny !Safe_ports\n"); fwrite($fout, "http_access deny CONNECT\n"); fwrite($fout, "http_access deny all\n"); - fwrite($fout, "visible_hostname pfSense\n"); fwrite($fout, "httpd_accel_host virtual\n"); fwrite($fout, "httpd_accel_port 80\n"); fwrite($fout, "httpd_accel_with_proxy on\n"); fwrite($fout, "httpd_accel_uses_host_header on\n"); + /* fwrite($fout, "badURL " . $_POST['badURL'] . "\n"); */ fclose($fout); $fout = fopen("/usr/local/etc/rc.d/squid.sh","w"); fwrite($fout, "#!/bin/sh\n"); @@ -43,14 +100,20 @@ system("/usr/local/sbin/squid -z"); system("/usr/local/sbin/squid"); filter_configure(); -
- /usr/local/sbin/squid - - exec("mv /var/db/pkg/squid* /tmp/"); - filter_configure(); - exec("mv /tmp/squid* /var/db/pkg/"); - - - - squid -
+ } + + + sync_package(); + + + sync_package(); + + /usr/local/sbin/squid + + exec("mv /var/db/pkg/squid* /tmp/ 2>/dev/null"); + filter_configure(); + + + + squid + \ No newline at end of file -- cgit v1.2.3