diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/bandwidthd/bandwidthd.inc | 11 | ||||
-rw-r--r-- | config/bandwidthd/bandwidthd.xml | 2 | ||||
-rw-r--r-- | config/haproxy-devel/haproxy.inc | 36 | ||||
-rw-r--r-- | config/haproxy-devel/haproxy.xml | 3 | ||||
-rw-r--r-- | config/lcdproc-dev/lcdproc_client.php | 1 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.inc | 69 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.xml | 11 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd_interfaces.xml | 4 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd_raw.xml | 71 | ||||
-rw-r--r-- | config/quagga_ospfd/status_ospfd.php | 4 | ||||
-rw-r--r-- | config/systempatches/system_patches_edit.php | 2 | ||||
-rw-r--r-- | config/systempatches/systempatches.xml | 2 |
12 files changed, 164 insertions, 52 deletions
diff --git a/config/bandwidthd/bandwidthd.inc b/config/bandwidthd/bandwidthd.inc index 7cdc8006..16ce4ab1 100644 --- a/config/bandwidthd/bandwidthd.inc +++ b/config/bandwidthd/bandwidthd.inc @@ -34,9 +34,15 @@ switch ($pfs_version) { case "1.2": case "2.0": define('PKG_BANDWIDTHD_BASE', '/usr/local/bandwidthd'); + define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', ''); break; - default: + case "2.1": define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/bandwidthd'); + define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', ''); + break; + default: + define('PKG_BANDWIDTHD_BASE', '/usr/pbi/bandwidthd-' . php_uname("m") . '/local/bandwidthd'); + define('PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV', 'LD_LIBRARY_PATH=/usr/pbi/bandwidthd-' . php_uname("m") . '/local/lib'); } // End: Check pfSense version @@ -63,6 +69,7 @@ function bandwidthd_install_config() { /* 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"; + $bandwidthd_runtime_library_env = PKG_BANDWIDTHD_RUNTIME_LIBRARY_ENV; conf_mount_rw(); config_lock(); @@ -336,7 +343,7 @@ if [ ! -f "{$bandwidthd_htdocs_dir}/logo.gif" ] ; then /bin/cp {$bandwidthd_base_dir}/htdocs/logo.gif {$bandwidthd_htdocs_dir} fi cd {$bandwidthd_nano_dir} -{$bandwidthd_nano_dir}/bandwidthd +{$bandwidthd_runtime_library_env} {$bandwidthd_nano_dir}/bandwidthd cd - EOD; } else { diff --git a/config/bandwidthd/bandwidthd.xml b/config/bandwidthd/bandwidthd.xml index 7f0f12fe..fc768761 100644 --- a/config/bandwidthd/bandwidthd.xml +++ b/config/bandwidthd/bandwidthd.xml @@ -46,7 +46,7 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>bandwidthd</name> - <version>2.0.1_5 pkg v.0.3</version> + <version>2.0.1_5 pkg v.0.4</version> <title>Bandwidthd</title> <aftersaveredirect>/pkg_edit.php?xml=bandwidthd.xml&id=0</aftersaveredirect> <include_file>/usr/local/pkg/bandwidthd.inc</include_file> diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 1d85cc51..1e403c48 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -818,15 +818,9 @@ function haproxy_writeconf($configpath) { if(is_array($a_frontends)) { foreach ($a_frontends as $frontend) { if($frontend['status'] != 'active') - { - unlink_if_exists("var/etc/{$frontend['name']}.{$frontend['port']}.crt"); continue; - } if(!$frontend['backend_serverpool']) - { - unlink_if_exists("var/etc/{$frontend['name']}.{$frontend['port']}.crt"); continue; - } $primaryfrontend = get_primaryfrontend($frontend); $bname = get_frontend_ipport($frontend); @@ -1192,6 +1186,36 @@ function haproxy_plugin_carp($pluginparams) { haproxy_check_run(0); } +function haproxy_plugin_certificates($pluginparams) { + global $config; + $result = array(); + if ($pluginparams['type'] == 'certificates' && $pluginparams['event'] == 'used_certificates') { + $result['pkgname'] = "HAProxy"; + $result['certificatelist'] = array(); + // return a array of used certificates. + foreach($config['installedpackages']['haproxy']['ha_backends']['item'] as &$frontend) { + $mainfrontend = get_primaryfrontend($frontend); + if (strtolower($mainfrontend['type']) == "http" && $mainfrontend['ssloffload']) { + if ($frontend['ssloffloadacl']){ + $item = array(); + $cert = $frontend['ssloffloadcert']; + $item['usedby'] = $frontend['name']; + $result['certificatelist'][$cert][] = $item; + } + if ($frontend['ssloffloadacladditional']){ + foreach($frontend['ha_certificates']['item'] as $certref){ + $item = array(); + $cert = $certref['ssl_certificate']; + $item['usedby'] = $frontend['name']; + $result['certificatelist'][$cert][] = $item; + } + } + } + } + } + return $result; +} + function haproxy_check_run($reload) { global $config, $g, $haproxy_run_message; diff --git a/config/haproxy-devel/haproxy.xml b/config/haproxy-devel/haproxy.xml index 5c534522..acd934a7 100644 --- a/config/haproxy-devel/haproxy.xml +++ b/config/haproxy-devel/haproxy.xml @@ -62,6 +62,9 @@ <item> <type>plugin_carp</type> </item> + <item> + <type>plugin_certificates</type> + </item> </plugins> <configpath>installedpackages->haproxy->config</configpath> <additional_files_needed> diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php index 3337052c..5306c903 100644 --- a/config/lcdproc-dev/lcdproc_client.php +++ b/config/lcdproc-dev/lcdproc_client.php @@ -513,6 +513,7 @@ 1 = All gateway up */ global $g; global $config; + $a_gateways = return_gateways_array(); $gateways_status = array(); $gateways_status = return_gateways_status(true); foreach ($a_gateways as $gname => $gateway) diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc index 782baf0f..17c13246 100644 --- a/config/quagga_ospfd/quagga_ospfd.inc +++ b/config/quagga_ospfd/quagga_ospfd.inc @@ -74,20 +74,20 @@ function quagga_ospfd_install_conf() { $quagga_config_base = PKG_QUAGGA_CONFIG_BASE; $noaccept = ""; + + // generate ospfd.conf based on the assistant + if(is_array($config['installedpackages']['quaggaospfd']['config'])) + $ospfd_conf = &$config['installedpackages']['quaggaospfd']['config'][0]; + else { + log_error("Quagga OSPFd: No config data found."); + return; + } - if ($config['installedpackages']['quaggaospfd']['rawconfig'] && $config['installedpackages']['quaggaospfd']['rawconfig']['item']) { + if (isset($config['installedpackages']['quaggaospfdraw']['config'][0]['ospfd']) + && !empty($config['installedpackages']['quaggaospfdraw']['config'][0]['ospfd'])) { // if there is a raw config specifyed in tthe config.xml use that instead of the assisted config - $conffile = implode("\n",$config['installedpackages']['quaggaospfd']['rawconfig']['item']); - //$conffile = $config['installedpackages']['quaggaospfd']['rawconfig']; + $conffile = str_replace("\r","",base64_decode($config['installedpackages']['quaggaospfdraw']['config'][0]['ospfd'])); } else { - // generate ospfd.conf based on the assistant - if($config['installedpackages']['quaggaospfd']['config']) - $ospfd_conf = &$config['installedpackages']['quaggaospfd']['config'][0]; - else { - log_error("Quagga OSPFd: No config data found."); - return; - } - $conffile = "# This file was created by the pfSense package manager. Do not edit!\n\n"; if($ospfd_conf['password']) @@ -100,7 +100,7 @@ function quagga_ospfd_install_conf() { $passive_interfaces = array(); $interface_networks = array(); - if ($config['installedpackages']['quaggaospfdinterfaces']['config']) { + if (is_array($config['installedpackages']['quaggaospfdinterfaces']['config'])) { foreach ($config['installedpackages']['quaggaospfdinterfaces']['config'] as $conf) { $realif = get_real_interface($conf['interface']); $conffile .= "interface {$realif}\n" ; @@ -242,17 +242,23 @@ function quagga_ospfd_install_conf() { fclose($fd); /* Make zebra config */ - $zebraconffile = "# This file was created by the pfSense package manager. Do not edit!\n\n"; - if($ospfd_conf['password']) - $zebraconffile .= "password {$ospfd_conf['password']}\n"; - if ($ospfd_conf['logging']) - $zebraconffile .= "log syslog\n"; - if (!empty($noaccept)) { - $zebraconffile .= $noaccept; - $zebraconffile .= "ip prefix-list ACCEPTFILTER permit any\n"; - $zebraconffile .= "route-map ACCEPTFILTER permit 10\n"; - $zebraconffile .= "match ip address prefix-list ACCEPTFILTER\n"; - $zebraconffile .= "ip protocol ospf route-map ACCEPTFILTER\n"; + if (isset($config['installedpackages']['quaggaospfdraw']['config'][0]['zebra']) + && !empty($config['installedpackages']['quaggaospfdraw']['config'][0]['zebra'])) { + // if there is a raw config specifyed in tthe config.xml use that instead of the assisted config + $zebraconffile = str_replace("\r","",base64_decode($config['installedpackages']['quaggaospfdraw']['config'][0]['zebra'])); + } else { + $zebraconffile = "# This file was created by the pfSense package manager. Do not edit!\n\n"; + if($ospfd_conf['password']) + $zebraconffile .= "password {$ospfd_conf['password']}\n"; + if ($ospfd_conf['logging']) + $zebraconffile .= "log syslog\n"; + if (!empty($noaccept)) { + $zebraconffile .= $noaccept; + $zebraconffile .= "ip prefix-list ACCEPTFILTER permit any\n"; + $zebraconffile .= "route-map ACCEPTFILTER permit 10\n"; + $zebraconffile .= "match ip address prefix-list ACCEPTFILTER\n"; + $zebraconffile .= "ip protocol ospf route-map ACCEPTFILTER\n"; + } } $fd = fopen("{$quagga_config_base}/zebra.conf", "w"); fwrite($fd, $zebraconffile); @@ -375,23 +381,6 @@ function quagga_ospfd_validate_input() { $input_errors[] = "Please select an interface to use for Quagga OSPFd."; } -// get the raw ospfd confi file for manual inspection/editing -function quagga_ospfd_get_raw_config() { - return file_get_contents(PKG_QUAGGA_CONFIG_BASE . "/ospfd.conf"); -} - -// serialize the raw ospfd confi file to config.xml -function quagga_ospfd_put_raw_config($conffile) { - global $config; - if ($conffile == "") - unset($config['installedpackages']['quaggaospfd']['rawconfig']); - else { - $config['installedpackages']['quaggaospfd']['rawconfig'] = array(); - $config['installedpackages']['quaggaospfd']['rawconfig']['item'] = explode("\n",$_POST['quagga_ospfd_raw']); - $config['installedpackages']['quaggaospfd']['rawconfig'] = $conffile; - } -} - function quagga_get_carp_status_by_ip($ipaddr) { $iface = trim(find_carp_interface($ipaddr)); if ($iface) { diff --git a/config/quagga_ospfd/quagga_ospfd.xml b/config/quagga_ospfd/quagga_ospfd.xml index 76a396fa..8edfcc3f 100644 --- a/config/quagga_ospfd/quagga_ospfd.xml +++ b/config/quagga_ospfd/quagga_ospfd.xml @@ -15,6 +15,11 @@ <item>https://packages.pfsense.org/packages/config/quagga_ospfd/quagga_ospfd_interfaces.xml</item> </additional_files_needed> <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>644</chmod> + <item>http://www.pfsense.com/packages/config/quagga_ospfd/quagga_ospfd_raw.xml</item> + </additional_files_needed> + <additional_files_needed> <prefix>/usr/local/www/</prefix> <chmod>644</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/status_ospfd.php</item> @@ -42,6 +47,10 @@ <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> </tab> <tab> + <text>Raw Config</text> + <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> + </tab> + <tab> <text>Status</text> <url>/status_ospfd.php</url> </tab> @@ -199,4 +208,4 @@ <custom_php_validation_command> quagga_ospfd_validate_input(); </custom_php_validation_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/quagga_ospfd/quagga_ospfd_interfaces.xml b/config/quagga_ospfd/quagga_ospfd_interfaces.xml index 09635597..f9953112 100644 --- a/config/quagga_ospfd/quagga_ospfd_interfaces.xml +++ b/config/quagga_ospfd/quagga_ospfd_interfaces.xml @@ -27,6 +27,10 @@ <active/> </tab> <tab> + <text>Raw Config</text> + <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> + </tab> + <tab> <text>Status</text> <url>/status_ospfd.php</url> </tab> diff --git a/config/quagga_ospfd/quagga_ospfd_raw.xml b/config/quagga_ospfd/quagga_ospfd_raw.xml new file mode 100644 index 00000000..b34558de --- /dev/null +++ b/config/quagga_ospfd/quagga_ospfd_raw.xml @@ -0,0 +1,71 @@ +<packagegui> + <name>quagga_ospfd_raw</name> + <version>0.1</version> + <title>Services: Quagga OSPFd</title> + <include_file>/usr/local/pkg/quagga_ospfd.inc</include_file> + <aftersaveredirect>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</aftersaveredirect> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> + <chmod>077</chmod> + <item>http://www.pfsense.com/packages/config/quagga_ospfd/quagga_ospfd.inc</item> + </additional_files_needed> + <menu> + <name>OSPF</name> + <tooltiptext>Modify Quagga RAW Config.</tooltiptext> + <section>Services</section> + <configfile>quagga_ospfd.xml</configfile> + <url>/pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> + </menu> + <tabs> + <tab> + <text>Global Settings</text> + <url>pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> + </tab> + <tab> + <text>Interface Settings</text> + <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> + </tab> + <tab> + <text>Raw Config</text> + <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> + <active/> + </tab> + <tab> + <text>Status</text> + <url>/status_ospfd.php</url> + </tab> + </tabs> + <service> + <name>Quagga OSPFd</name> + <rcfile>quagga.sh</rcfile> + <executable>ospfd</executable> + </service> + <service> + <name>Quagga Zebra</name> + <rcfile>quagga.sh</rcfile> + <executable>zebra</executable> + </service> + <fields> + <field> + <fielddescr>ospfd.conf</fielddescr> + <fieldname>ospfd</fieldname> + <description>Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here. To get back the assisted config save this form below once with both empty input fields.</description> + <type>textarea</type> + <encoding>base64</encoding> + <rows>30</rows> + <cols>65</cols> + </field> + <field> + <fielddescr>zebra.conf</fielddescr> + <fieldname>zebra</fieldname> + <description>Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here. To get back the assisted config save this form below once with both empty input fields.</description> + <type>textarea</type> + <encoding>base64</encoding> + <rows>30</rows> + <cols>65</cols> + </field> + </fields> + <custom_php_resync_config_command> + quagga_ospfd_install_conf(); + </custom_php_resync_config_command> +</packagegui> diff --git a/config/quagga_ospfd/status_ospfd.php b/config/quagga_ospfd/status_ospfd.php index dc6c6aea..8ecf19d0 100644 --- a/config/quagga_ospfd/status_ospfd.php +++ b/config/quagga_ospfd/status_ospfd.php @@ -33,6 +33,7 @@ $pgtitle = "Quagga OSPF: Status"; include("head.inc"); $control_script = "/usr/local/bin/quaggactl"; +$pkg_homedir = "/var/etc/quagga"; /* List all of the commands as an index. */ function listCmds() { @@ -90,6 +91,7 @@ function doCmdT($title, $command) { $tab_array = array(); $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=quagga_ospfd.xml&id=0"); $tab_array[] = array(gettext("Interface Settings"), false, "/pkg.php?xml=quagga_ospfd_interfaces.xml"); + $tab_array[] = array(gettext("RAW Config"), false, "/pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0"); $tab_array[] = array(gettext("Status"), true, "/status_ospfd.php"); display_top_tabs($tab_array); ?> @@ -110,6 +112,8 @@ function doCmdT($title, $command) { defCmdT("Quagga OSPF Interfaces", "{$control_script} ospf interfaces"); defCmdT("Quagga OSPF CPU Usage", "{$control_script} ospf cpu"); defCmdT("Quagga OSPF Memory", "{$control_script} ospf mem"); + defCmdT("Quagga ospfd.conf", "/bin/cat {$pkg_homedir}/ospfd.conf"); + defCmdT("Quagga zebra.conf", "/bin/cat {$pkg_homedir}/zebra.conf"); ?> <div id="cmdspace" style="width:100%"> <?php listCmds(); ?> diff --git a/config/systempatches/system_patches_edit.php b/config/systempatches/system_patches_edit.php index 0d45ce92..3e63038e 100644 --- a/config/systempatches/system_patches_edit.php +++ b/config/systempatches/system_patches_edit.php @@ -88,7 +88,7 @@ if ($_POST) { $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); if ($pf_version < 2.1) - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;'); else do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); diff --git a/config/systempatches/systempatches.xml b/config/systempatches/systempatches.xml index 23b0795b..b9875140 100644 --- a/config/systempatches/systempatches.xml +++ b/config/systempatches/systempatches.xml @@ -40,7 +40,7 @@ <requirements>None</requirements> <faq>Applies patches supplied by the user to the firewall.</faq> <name>System Patches</name> - <version>1.0</version> + <version>1.0.2</version> <title>System: Patches</title> <include_file>/usr/local/pkg/patches.inc</include_file> <menu> |