diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-01-05 17:31:24 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-01-05 17:31:24 -0500 |
commit | 24c4ac584871b991a8b57042e96eba36b7dd46e9 (patch) | |
tree | b32982ff8c98b9ffc8eb1bb83e8faa172c9a1e78 | |
parent | 29e0928f3a732cba3c8dd332c1df8061b1fe6548 (diff) | |
parent | ac950976f70f4bb7af201aa38c0d7cbd4f822169 (diff) | |
download | pfsense-24c4ac584871b991a8b57042e96eba36b7dd46e9.zip pfsense-24c4ac584871b991a8b57042e96eba36b7dd46e9.tar.gz |
Merge pull request #2354 from ExolonDX/branch_01
-rw-r--r-- | license.txt | 2 | ||||
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 73 | ||||
-rw-r--r-- | src/etc/inc/system.inc | 3 | ||||
-rw-r--r-- | src/etc/version | 2 | ||||
-rw-r--r-- | src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css | 3 | ||||
-rw-r--r-- | src/usr/local/www/diag_arp.php | 7 | ||||
-rw-r--r-- | src/usr/local/www/diag_ndp.php | 7 | ||||
-rw-r--r-- | src/usr/local/www/firewall_aliases.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/firewall_rules.php | 14 | ||||
-rw-r--r-- | src/usr/local/www/services_igmpproxy.php | 9 | ||||
-rw-r--r-- | src/usr/local/www/services_pppoe.php | 9 | ||||
-rwxr-xr-x | src/usr/local/www/status_gateway_groups.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/status_gateways.php | 6 | ||||
-rwxr-xr-x | src/usr/local/www/status_services.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/vpn_ipsec_keys.php | 7 |
15 files changed, 128 insertions, 34 deletions
diff --git a/license.txt b/license.txt index c29218a..f69175b 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved. +Copyright (c) 2004-2016 Electric Sheep Fencing, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 426a043..fc0a126 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -113,7 +113,7 @@ function pkg_update($force = false) { } } - $rc = pkg_call("update"); + $rc = pkg_call("update -f"); if ($rc) { file_put_contents($last_update_file, $now . "\n"); @@ -122,8 +122,27 @@ function pkg_update($force = false) { return $rc; } +/* return an array with necessary environment vars for pkg */ +function pkg_env() { + global $config, $g; + + $pkg_env_vars = array( + "HTTP_USER_AGENT" => $user_agent, + "ASSUME_ALWAYS_YES" => "true", + "REPO_AUTOUPDATE" => "false" + ); + + if ($g['platform'] == "nanobsd" || + isset($config['system']['use_mfs_tmpvar'])) { + $pkg_env_vars['PKG_DBDIR'] = '/root/var/db/pkg'; + $pkg_env_vars['PKG_CACHEDIR'] = '/root/var/cache/pkg'; + } + + return $pkg_env_vars; +} + /* Execute a pkg call */ -function pkg_call($params, $mute = false) { +function pkg_call($params, $mute = false, $readonly = false) { global $g, $config; if (empty($params)) { @@ -135,21 +154,23 @@ function pkg_call($params, $mute = false) { $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid'); } - $env = array( - "HTTP_USER_AGENT" => $user_agent, - "ASSUME_ALWAYS_YES" => "true", - "REPO_AUTOUPDATE" => "false" - ); - $descriptorspec = array( 1 => array("pipe", "w"), /* stdout */ 2 => array("pipe", "w") /* stderr */ ); + if (!$readonly) { + conf_mount_rw(); + } + pkg_debug("pkg_call(): {$params}\n"); - $process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes, '/', $env); + $process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes, + '/', pkg_env()); if (!is_resource($process)) { + if (!$readonly) { + conf_mount_ro(); + } return false; } @@ -201,6 +222,10 @@ function pkg_call($params, $mute = false) { fclose($pipes[2]); proc_close($process); + if (!$readonly) { + conf_mount_ro(); + } + if (!isset($rc)) { $rc = $status['exitcode']; } @@ -221,7 +246,7 @@ function pkg_call($params, $mute = false) { } /* Execute pkg with $params, fill stdout and stderr and return pkg rc */ -function pkg_exec($params, &$stdout, &$stderr) { +function pkg_exec($params, &$stdout, &$stderr, $readonly = false) { global $g, $config; if (empty($params)) { @@ -233,21 +258,23 @@ function pkg_exec($params, &$stdout, &$stderr) { $user_agent .= ' : ' . get_single_sysctl('kern.hostuuid'); } - $env = array( - "HTTP_USER_AGENT" => $user_agent, - "ASSUME_ALWAYS_YES" => "true", - "REPO_AUTOUPDATE" => "false" - ); - $descriptorspec = array( 1 => array("pipe", "w"), /* stdout */ 2 => array("pipe", "w") /* stderr */ ); + if (!$readonly) { + conf_mount_rw(); + } + pkg_debug("pkg_exec(): {$params}\n"); - $process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes, '/', $env); + $process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes, + '/', pkg_env()); if (!is_resource($process)) { + if (!$readonly) { + conf_mount_ro(); + } return -1; } @@ -263,6 +290,10 @@ function pkg_exec($params, &$stdout, &$stderr) { } fclose($pipes[2]); + if (!$readonly) { + conf_mount_ro(); + } + return proc_close($process); } @@ -277,7 +308,7 @@ function pkg_version_compare($v1, $v2) { return '?'; } - $rc = pkg_exec("version -t '{$v1}' '{$v2}'", $stdout, $stderr); + $rc = pkg_exec("version -t '{$v1}' '{$v2}'", $stdout, $stderr, true); if ($rc != 0) { return '?'; @@ -294,7 +325,7 @@ function is_pkg_installed($pkg_name) { return false; } - return pkg_call("info -e " . $pkg_name, true); + return pkg_call("info -e " . $pkg_name, true, true); } /* Install package, $pkg_name should not contain prefix */ @@ -404,7 +435,7 @@ function get_pkg_info($pkgs = 'all', $info = 'all') { return array(); } - $rc = pkg_exec("search -U --raw-format json-compact " . $pkgs, $out, $err); + $rc = pkg_exec("search -U --raw-format json-compact " . $pkgs, $out, $err, true); if ($rc != 0) { update_status("\n" . gettext( @@ -439,7 +470,7 @@ function get_pkg_info($pkgs = 'all', $info = 'all') { if (is_pkg_installed($pkg_info['name'])) { $pkg_info['installed'] = true; - $rc = pkg_exec("query %v {$pkg_info['name']}", $out, $err); + $rc = pkg_exec("query %v {$pkg_info['name']}", $out, $err, true); if ($rc != 0) { update_status("\n" . gettext( diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 3c1c8ac..847879d 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -1364,6 +1364,9 @@ EOD; fwrite($fd, $nginx_config); fclose($fd); + /* nginx will fail to start if this directory does not exist. */ + safe_mkdir("/var/tmp/nginx/"); + return 0; } diff --git a/src/etc/version b/src/etc/version index df3f865..b223756 100644 --- a/src/etc/version +++ b/src/etc/version @@ -1 +1 @@ -2.3-ALPHA +2.3-BETA diff --git a/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css b/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css new file mode 100644 index 0000000..46f9283 --- /dev/null +++ b/src/usr/local/www/bootstrap/css/pfSense-dark-BETA.css @@ -0,0 +1,3 @@ +@import url("/bootstrap/css/pfSense-dark.css"); + +/*** Experimental Changes Go Here ***/ diff --git a/src/usr/local/www/diag_arp.php b/src/usr/local/www/diag_arp.php index d456be9..8ec4623 100644 --- a/src/usr/local/www/diag_arp.php +++ b/src/usr/local/www/diag_arp.php @@ -333,6 +333,10 @@ $data = msort($data, "dnsresolve"); // Load MAC-Manufacturer table $mac_man = load_mac_manufacturer_table(); ?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('ARP Table')?></h2></div> + <div class="panel-body"> + <div class="table-responsive"> <table class="sortable-theme-bootstrap table table-striped table-hover" data-sortable> <thead> @@ -368,6 +372,9 @@ $mac_man = load_mac_manufacturer_table(); </table> </div> + </div> +</div> + <script type="text/javascript"> //<![CDATA[ // Clear the "loading" div once the page has loaded" diff --git a/src/usr/local/www/diag_ndp.php b/src/usr/local/www/diag_ndp.php index b542552..348002d 100644 --- a/src/usr/local/www/diag_ndp.php +++ b/src/usr/local/www/diag_ndp.php @@ -129,6 +129,10 @@ $pgtitle = array(gettext("Diagnostics"), gettext("NDP Table")); include("head.inc"); ?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('NDP Table')?></h2></div> + <div class="panel-body"> + <div class="table-responsive"> <table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable> <thead> @@ -173,4 +177,7 @@ include("head.inc"); </table> </div> + </div> +</div> + <?php include("foot.inc"); diff --git a/src/usr/local/www/firewall_aliases.php b/src/usr/local/www/firewall_aliases.php index 2733a7a..9862ebb 100644 --- a/src/usr/local/www/firewall_aliases.php +++ b/src/usr/local/www/firewall_aliases.php @@ -212,7 +212,7 @@ display_top_tabs($tab_array); ?> <div class="panel panel-default"> - <div class="panel-heading"><h2 class="panel-title">Firewall Aliases <?=$bctab?></h2></div> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Firewall Aliases') . " " . $bctab?></h2></div> <div class="panel-body"> <div class="table-responsive"> @@ -294,8 +294,8 @@ display_top_tabs($tab_array); </table> </div> - </div><!-- panel body --> -</div><!-- panel default --> + </div> +</div> <nav class="action-buttons"> <a href="firewall_aliases_edit.php?tab=<?=$tab?>" role="button" class="btn btn-success btn-sm"> diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index 5cc9ea4..c5bd1b9 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -301,7 +301,7 @@ display_top_tabs($tab_array); ((count($config['interfaces']) == 1) && ($if == 'wan')))): $alports = implode('<br />', filter_get_antilockout_ports(true)); ?> - <tr id="antilockout" class="hover-success"> + <tr id="antilockout"> <td></td> <td title="<?=gettext("traffic is passed")?>"><i class="fa fa-check text-success"></i></td> <td>*</td> @@ -312,14 +312,14 @@ display_top_tabs($tab_array); <td>*</td> <td>*</td> <td></td> - <td class="bg-info"><?=gettext("Anti-Lockout Rule");?></td> + <td><?=gettext("Anti-Lockout Rule");?></td> <td> <a href="system_advanced_admin.php" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a> </td> </tr> <?php endif;?> <?php if (isset($config['interfaces'][$if]['blockpriv'])): ?> - <tr id="frrfc1918" class="hover-danger"> + <tr id="frrfc1918"> <td></td> <td title="<?=gettext("traffic is blocked")?>"><i class="fa fa-times text-danger"></i></td> <td>*</td> @@ -330,14 +330,14 @@ display_top_tabs($tab_array); <td>*</td> <td>*</td> <td></td> - <td class="bg-info"><?=gettext("Block private networks");?></td> + <td><?=gettext("Block private networks");?></td> <td> <a href="interfaces.php?if=<?=htmlspecialchars($if)?>" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a> </td> </tr> <?php endif;?> <?php if (isset($config['interfaces'][$if]['blockbogons'])): ?> - <tr id="frrfc1918" class="hover-danger"> + <tr id="frrfc1918"> <td></td> <td title="<?=gettext("traffic is blocked")?>"><i class="fa fa-times text-danger"></i></td> <td>*</td> @@ -348,7 +348,7 @@ display_top_tabs($tab_array); <td>*</td> <td>*</td> <td></td> - <td class="bg-info"><?=gettext("Block bogon networks");?></td> + <td><?=gettext("Block bogon networks");?></td> <td> <a href="interfaces.php?if=<?=htmlspecialchars($if)?>" title="<?=gettext("Settings");?>"><i class="fa fa-cog"></i></a> </td> @@ -634,7 +634,7 @@ for ($i = 0; isset($a_filter[$i]); $i++): <?php } ?> <?=$schedule_span_begin;?><?=htmlspecialchars($filterent['sched']);?> <?=$schedule_span_end;?> </td> - <td class="bg-info"> + <td> <?=htmlspecialchars($filterent['descr']);?> </td> <td class="action-icons"> diff --git a/src/usr/local/www/services_igmpproxy.php b/src/usr/local/www/services_igmpproxy.php index 7face46..4e531ce 100644 --- a/src/usr/local/www/services_igmpproxy.php +++ b/src/usr/local/www/services_igmpproxy.php @@ -111,6 +111,11 @@ if (is_subsystem_dirty('igmpproxy')) { ?> <form action="services_igmpproxy.php" method="post"> + +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('IGMP Proxy')?></h2></div> + <div class="panel-body"> + <div class="table-responsive"> <table class="table table-striped table-hover table-condensed"> <thead> @@ -161,6 +166,10 @@ endforeach; </tbody> </table> </div> + + </div> +</div> + </form> <nav class="action-buttons"> diff --git a/src/usr/local/www/services_pppoe.php b/src/usr/local/www/services_pppoe.php index 109520b..fc40515 100644 --- a/src/usr/local/www/services_pppoe.php +++ b/src/usr/local/www/services_pppoe.php @@ -126,7 +126,11 @@ if (is_subsystem_dirty('vpnpppoe')) { } ?> -<div class="table-responsive"> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('PPPoE Server')?></h2></div> + <div class="panel-body"> + + <div class="table-responsive"> <table class="table table-striped table-hover table-condensed"> <thead> <tr> @@ -168,6 +172,9 @@ endforeach; </table> </div> + </div> +</div> + <nav class="action-buttons"> <a href="services_pppoe_edit.php" class="btn btn-success"> <i class="fa fa-plus icon-embed-btn"></i> diff --git a/src/usr/local/www/status_gateway_groups.php b/src/usr/local/www/status_gateway_groups.php index b88c7cd..d244b88 100755 --- a/src/usr/local/www/status_gateway_groups.php +++ b/src/usr/local/www/status_gateway_groups.php @@ -92,6 +92,9 @@ $tab_array[0] = array(gettext("Gateways"), false, "status_gateways.php"); $tab_array[1] = array(gettext("Gateway Groups"), true, "status_gateway_groups.php"); display_top_tabs($tab_array); ?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateway Groups')?></h2></div> + <div class="panel-body"> <div class="table-responsive"> <table class="table table-hover table-condensed table-striped"> @@ -204,4 +207,7 @@ display_top_tabs($tab_array); </table> </div> + </div> +</div> + <?php include("foot.inc"); diff --git a/src/usr/local/www/status_gateways.php b/src/usr/local/www/status_gateways.php index 97c0051..f6ad489 100644 --- a/src/usr/local/www/status_gateways.php +++ b/src/usr/local/www/status_gateways.php @@ -87,6 +87,9 @@ $tab_array[] = array(gettext("Gateways"), true, "status_gateways.php"); $tab_array[] = array(gettext("Gateway Groups"), false, "status_gateway_groups.php"); display_top_tabs($tab_array); ?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Gateways')?></h2></div> + <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> @@ -188,4 +191,7 @@ display_top_tabs($tab_array); </table> </div> + </div> +</div> + <?php include("foot.inc"); ?> diff --git a/src/usr/local/www/status_services.php b/src/usr/local/www/status_services.php index a944696..905057a 100755 --- a/src/usr/local/www/status_services.php +++ b/src/usr/local/www/status_services.php @@ -118,6 +118,10 @@ if (count($services) > 0) { <input id="id" type="hidden" name="id" value=""/> <input id="zone" type="hidden" name="zone" value=""/> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Services')?></h2></div> + <div class="panel-body"> + <div class="panel-body panel-default"> <div class="table-responsive"> <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> @@ -184,6 +188,10 @@ if (count($services) > 0) { </table> </div> </div> + + </div> +</div> + </form> <?php } else { diff --git a/src/usr/local/www/vpn_ipsec_keys.php b/src/usr/local/www/vpn_ipsec_keys.php index 7fcd642..c3886bb 100644 --- a/src/usr/local/www/vpn_ipsec_keys.php +++ b/src/usr/local/www/vpn_ipsec_keys.php @@ -128,6 +128,10 @@ if (is_subsystem_dirty('ipsec')) { display_top_tabs($tab_array); ?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext('Pre-Shared Keys')?></h2></div> + <div class="panel-body"> + <div class="table-responsive"> <table class="table table-striped table-hover"> <thead> @@ -196,6 +200,9 @@ if (is_subsystem_dirty('ipsec')) { </table> </div> + </div> +</div> + <nav class="action-buttons"> <a class="btn btn-success btn-sm" href="vpn_ipsec_keys_edit.php"> <i class="fa fa-plus icon-embed-btn"></i> |