aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/squid.xml84
1 files changed, 0 insertions, 84 deletions
diff --git a/packages/squid.xml b/packages/squid.xml
deleted file mode 100644
index 38b3fc77..00000000
--- a/packages/squid.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<packagegui>
- <name>squid</name>
- <version>2.5.7_5</version>
- <custom_php_global_functions>
- function write_squid_static_config() {
- global $config;
- $lancfg = $config['interfaces']['lan'];
- $lanif = $lancfg['if'];
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
- $fout = fopen("/usr/local/etc/squid/squid.conf","w");
- fwrite($fout, "#\n");
- fwrite($fout, "# This file was automatically generated by the pfSense package manager\n");
- fwrite($fout, "#\n");
- fwrite($fout, "http_port 3128\n");
- fwrite($fout, "icp_port 0\n");
- fwrite($fout, "acl localnet src " . $lansa . "/" . $lansn . "\n");
- fwrite($fout, "acl all src " . $lansa . "/" . $lansn . "\n");
- fwrite($fout, "acl localhost src 127.0.0.1/255.255.255.255\n");
- fwrite($fout, "acl Safe_ports port 80 443 210 119 70 21 1025-65535\n");
- fwrite($fout, "acl CONNECT method CONNECT\n");
- fwrite($fout, "http_access allow localnet\n");
- fwrite($fout, "http_access allow localhost\n");
- 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, "cache_effective_user squid\n");
- fwrite($fout, "cache_effective_group squid\n");
- fclose($fout);
- }
- </custom_php_global_functions>
- <custom_add_php_command>
- function sync_package_squid() {
- conf_mount_rw();
- config_lock();
- global $config;
- /* if ($_POST[0] == "") $_POST = $config['installedpackages']['package']['squid']['config']; */
- write_squid_static_config();
- $fout = fopen("/usr/local/etc/squid/squid.conf", "a");
- if ($_POST['cache_size'] != "") fwrite($fout, "cache_mem " . $_POST['cache_size'] . " MB\n");
- fclose($fout);
- mwexec("/usr/local/sbin/squid -k reconfigure");
- conf_mount_ro();
- config_unlock();
- }
- sync_package_squid();
- </custom_add_php_command>
- <custom_php_install_command>
- write_squid_static_config();
- $fout = fopen("/usr/local/etc/rc.d/squid.sh","w");
- fwrite($fout, "#!/bin/sh\n");
- fwrite($fout, "# PACKAGE: Squid\n");
- fwrite($fout, "# EXECUTABLE: squid\n\n");
- fwrite($fout, "# Alert system that we need the / mount rw\n");
- fwrite($fout, "touch /tmp/ro_root_mount\n\n");
- fwrite($fout, "/usr/local/sbin/squid -D\n\n");
- fwrite($fout, "touch /tmp/filter_dirty\n\n");
- fclose($fout);
- chmod("/usr/local/etc/rc.d/squid.sh", 755);
- update_output_window("Configuring Squid... This may take a moment...");
- mwexec("/usr/local/sbin/squid -z");
- update_output_window("Starting Squid...");
- mwexec_bg("/usr/local/etc/rc.d/squid.sh");
- filter_configure();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- rmdir_recursive("/usr/local/squid");
- unlink_if_exists("/var/mail/squid");
- unlink_if_exists("/usr/local/etc/rc.d/squid");
- unlink_if_exists("/usr/local/etc/squid/squid.conf");
- rmdir_recursive("/usr/local/etc/squid");
- rmdir_recursive("/usr/local/libexec/squid");
- filter_configure();
- </custom_php_deinstall_command>
- <start_command>/usr/local/etc/rc.d/squid.sh</start_command>
- <process_kill_command>squid</process_kill_command>
-</packagegui>