diff options
-rw-r--r-- | config/bandwidthd/bandwidthd.inc | 99 | ||||
-rw-r--r-- | config/jailctl/jailctl.xml | 2 | ||||
-rw-r--r-- | config/jailctl/jailctl_settings.xml | 7 | ||||
-rw-r--r-- | config/varnish3/varnish.inc | 26 | ||||
-rw-r--r-- | config/varnish3/varnish_backends.xml | 8 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
7 files changed, 115 insertions, 31 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc index 34532c18..8821ac76 100644 --- a/config/bandwidthd/bandwidthd.inc +++ b/config/bandwidthd/bandwidthd.inc @@ -54,6 +54,8 @@ function bandwidthd_install_config() { global $config, $g; /* bandwidthd doesn't have a way to pass a custom config path, unfortunately */ + /* the conf file must be ./etc/bandwidthd.conf relative to the current dir */ + $bandwidthd_base_dir = PKG_BANDWIDTHD_BASE; $bandwidthd_config_dir = PKG_BANDWIDTHD_BASE . "/etc"; conf_mount_rw(); @@ -143,7 +145,7 @@ function bandwidthd_install_config() { # This file was automatically generated by the pfSense # package management system. Changing this file # will lead to it being overwritten again when -# the package manage resyncs. +# the package manager resyncs. # #################################################### # Bandwidthd.conf @@ -206,25 +208,94 @@ EOF; fwrite($fd, $config_file); fclose($fd); - /* write out rc.d start/stop file */ - write_rcfile(array( - "file" => "bandwidthd.sh", - "start" => "/usr/local/bandwidthd/bandwidthd {$bandwidthd_config_dir}/bandwidthd.conf", - "stop" => "/usr/bin/killall bandwidthd" - ) - ); + $rc = array(); + $rc['file'] = 'bandwidthd.sh'; + $rc['stop'] = <<<EOD +/usr/bin/killall bandwidthd +EOD; + + if ($g['platform'] == 'nanobsd') { + // On nanobsd, /var/bandwidthd is created. + // In that is a real /var/bandwidth/htdocs, where the graph data is written + // A soft link to the real bandwidth program is made - /var/bandwidthd/bandwidthd + // A soft link to the etc folder with the conf file is made - /var/bandwidthd/etc + // bandwidthd is started from /var/bandwidthd with the current dir /var/bandwidth + // This way, it: + // looks in ./etc for the conf file + // writes graph files in ./htdocs + // writes cdf log files (if selected in the config) to ./ + // All of this is on the /var filesystem, which is a read-write memory disk on nanobsd + $bandwidthd_nano_dir = "/var/bandwidthd"; + $bandwidthd_htdocs_dir = $bandwidthd_nano_dir . "/htdocs"; + $rc['start'] = <<<EOD +if [ ! -d "{$bandwidthd_nano_dir}" ] ; then + if [ -e "{$bandwidthd_nano_dir}" ] ; then + /bin/rm -f {$bandwidthd_nano_dir} + fi + /bin/mkdir -p {$bandwidthd_nano_dir} +fi +if [ ! -d "{$bandwidthd_htdocs_dir}" ] ; then + if [ -e "{$bandwidthd_htdocs_dir}" ] ; then + /bin/rm -f {$bandwidthd_htdocs_dir} + fi + /bin/mkdir -p {$bandwidthd_htdocs_dir} +fi +if [ ! -L "{$bandwidthd_nano_dir}/bandwidthd" ] ; then + if [ -e "{$bandwidthd_nano_dir}/bandwidthd" ] ; then + /bin/rm -Rf {$bandwidthd_nano_dir}/bandwidthd + fi + /bin/ln -s {$bandwidthd_base_dir}/bandwidthd {$bandwidthd_nano_dir}/bandwidthd +fi +if [ ! -L "{$bandwidthd_nano_dir}/etc" ] ; then + if [ -e "{$bandwidthd_nano_dir}/etc" ] ; then + /bin/rm -Rf {$bandwidthd_nano_dir}/etc + fi + /bin/ln -s {$bandwidthd_config_dir} {$bandwidthd_nano_dir}/etc +fi + +cd {$bandwidthd_nano_dir} +{$bandwidthd_nano_dir}/bandwidthd +cd - +EOD; + if (!is_dir($bandwidthd_nano_dir)) { + if (file_exists($bandwidthd_nano_dir)) { + unlink($bandwidthd_nano_dir); + } + mkdir($bandwidthd_nano_dir); + } + } else { + $bandwidthd_htdocs_dir = $bandwidthd_base_dir . "/htdocs"; + $rc['start'] = <<<EOD +/usr/local/bandwidthd/bandwidthd +EOD; + } - exec("rm /usr/local/www/bandwidthd"); - exec("/bin/ln -s " . PKG_BANDWIDTHD_BASE . "/htdocs /usr/local/www/bandwidthd"); + /* write out rc.d start/stop file */ + write_rcfile($rc); - exec("echo \"Please start bandwidthd to populate this directory.\" > " . PKG_BANDWIDTHD_BASE . "/htdocs/index.html"); + if (!is_dir($bandwidthd_htdocs_dir)) { + if (file_exists($bandwidthd_htdocs_dir)) { + unlink($bandwidthd_htdocs_dir); + } + mkdir($bandwidthd_htdocs_dir); + } + $bandwidthd_www_link = $g["www_path"] . "/bandwidthd"; + if (!is_link($bandwidthd_www_link)) { + if (file_exists($bandwidthd_www_link)) { + // It is a file and not a link - clean it up. + unlink($bandwidthd_www_link); + } + symlink($bandwidthd_htdocs_dir, $bandwidthd_www_link); + } + $bandwidthd_index_file = $bandwidthd_htdocs_dir . "/index.html"; + if (!file_exists($bandwidthd_index_file)) { + exec("echo \"Please start bandwidthd to populate this directory.\" > " . $bandwidthd_index_file); + } conf_mount_ro(); config_unlock(); - stop_service("bandwidthd"); start_service("bandwidthd"); - } -?>
\ No newline at end of file +?> diff --git a/config/jailctl/jailctl.xml b/config/jailctl/jailctl.xml index 079ddb6b..5ca6c459 100644 --- a/config/jailctl/jailctl.xml +++ b/config/jailctl/jailctl.xml @@ -60,7 +60,7 @@ <additional_files_needed> <prefix>/usr/sbin/</prefix> <chmod>0755</chmod> - <item>http://www.pfsense.com/packages/config/jailctl/sysinstall</item> + <item>http://www.mundounix.com.br/~gugabsd/sysinstall</item> </additional_files_needed> <tabs> diff --git a/config/jailctl/jailctl_settings.xml b/config/jailctl/jailctl_settings.xml index e82eea6c..ae09adaf 100644 --- a/config/jailctl/jailctl_settings.xml +++ b/config/jailctl/jailctl_settings.xml @@ -35,12 +35,9 @@ <description>Select a FTP server (mirror) to use for sysinstall</description> <type>select</type> <options> - <option><name>ftp.FreeBSD.org</name><value>ftp://ftp.FreeBSD.org/pub/FreeBSD/</value></option> - <option><name>ftp.no.FreeBSD.org</name><value>ftp://ftp.no.FreeBSD.org/pub/FreeBSD/</value></option> - <option><name>ftp.de.FreeBSD.org</name><value>ftp://ftp.de.FreeBSD.org/pub/FreeBSD/</value></option> - <option><name>ftp.se.FreeBSD.org</name><value>ftp://ftp.se.FreeBSD.org/pub/FreeBSD/</value></option> + <option><name>ftp-archive.freebsd.org</name><value>ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/</value></option> </options> - <default_value>ftp://ftp.FreeBSD.org/pub/FreeBSD/</default_value> + <default_value>ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/</default_value> </field> <field> <fielddescr>DNS servers</fielddescr> diff --git a/config/varnish3/varnish.inc b/config/varnish3/varnish.inc index 9d38161e..3449c68b 100644 --- a/config/varnish3/varnish.inc +++ b/config/varnish3/varnish.inc @@ -34,7 +34,7 @@ /* ========================================================================== */ function varnish_settings_post_validate($post, $input_errors) { - if($post['storagesize'] && !is_numeric($post['storagesize'])) + if( !is_numeric($post['storagesize'])) $input_errors[] = "A valid number is required for the field 'Storage size'"; if($post['listeningport'] && !is_numeric($post['listeningport'])) $input_errors[] = "A valid number is required for the field 'Listening port'"; @@ -329,6 +329,22 @@ function get_backend_config_txt() { $probe_threshold = $backend['probe_threshold']; else $probe_threshold = "5"; + + + if ($backend['probe_disable']) { + $probe = ""; + } else { + $probe = <<<EOFPROBE + .probe = { + {$probe_url} + .interval = {$probe_interval}; + .timeout = {$probe_timeout}; + .window = {$probe_window}; + .threshold = {$probe_threshold}; + } +EOFPROBE; + } + if (isset($probe_threshold)){ #last parameter set ,so write conf if backend is in use if ($backends_in_use[$backend['backendname']] != ""){ @@ -340,13 +356,7 @@ backend {$backend['backendname']}BACKEND { .port = "{$backend['port']}"; .first_byte_timeout = {$first_byte_timeout}; .connect_timeout = {$connect_timeout}; - .probe = { - {$probe_url} - .interval = {$probe_interval}; - .timeout = {$probe_timeout}; - .window = {$probe_window}; - .threshold = {$probe_threshold}; - } +{$probe} } diff --git a/config/varnish3/varnish_backends.xml b/config/varnish3/varnish_backends.xml index e35ef07b..e480a8d6 100644 --- a/config/varnish3/varnish_backends.xml +++ b/config/varnish3/varnish_backends.xml @@ -11,7 +11,7 @@ Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> Copyright (C) 2011 Marcello Coutinho All rights reserved. -*/ +/*/ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without @@ -221,6 +221,12 @@ <type>input</type> </field> <field> + <fielddescr>Disable Probe</fielddescr> + <fieldname>probe_disable</fieldname> + <description>Check to disable probing for this backend</description> + <type>checkbox</type> + </field> + <field> <fielddescr>Mappings</fielddescr> <fieldname>Mappings</fieldname> <type>listtopic</type> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 3006bdd6..28d7f6ff 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1163,7 +1163,7 @@ <website>http://bandwidthd.sourceforge.net/</website> <descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr> <category>System</category> - <version>2.0.1.3</version> + <version>2.0.1.4</version> <status>BETA</status> <required_version>1.2.1</required_version> <depends_on_package_base_url>http://files.pfsense.org/packages/8/All/</depends_on_package_base_url> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index cee4e478..1c96c513 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1150,7 +1150,7 @@ <website>http://bandwidthd.sourceforge.net/</website> <descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr> <category>System</category> - <version>2.0.1.3</version> + <version>2.0.1.4</version> <status>BETA</status> <required_version>1.2.1</required_version> <depends_on_package_base_url>http://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> |