From 4f1ebacbfb78c855b85d447f2de7f397d7117167 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 23 Aug 2010 18:15:57 +0000 Subject: [PATCH 01/48] Ticket #769. Convert assigned openvpn interfaces by using custom options to 2.0 style assigned openvpn interfaces. This upgrade removes the 'dev tun#' from cutom options and upgrades the assigned interface name to new style. --- etc/inc/upgrade_config.inc | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 24f56f7499..eb1e425493 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1415,6 +1415,31 @@ function upgrade_051_to_052() { /* allocate vpnid */ $server['vpnid'] = $vpnid++; + if (!empty($server['custom_options'])) { + $cstmopts = array(); + $tmpcstmopts = explode(";", $server['custom_options']); + $assigned = false; + $tmpstr = ""; + foreach ($tmpcstmopts as $tmpcstmopt) { + $tmpstr = str_replace(" ", "", $tmpcstmopt); + if (substr($tmpstr,0 ,6) == "devtun") { + $assigned = true; + continue; + } else + $cstmopts[] = $tmpcstmopt; + } + $server['custom_options'] = implode(";", $cstmopts); + if ($assigned == true) { + $realif = substr($tmpstr, 3); + foreach ($config['interfaces'] as $iface => $cfgif) { + if ($cfgif['if'] == $realif) { + $config['interfaces'][$iface]['if'] = "ovpns{$server['vpnid']}"; + break; + } + } + } + } + $config['openvpn']['openvpn-server'][] = $server; } unset($config['installedpackages']['openvpnserver']); @@ -1489,6 +1514,31 @@ function upgrade_051_to_052() { /* allocate vpnid */ $client['vpnid'] = $vpnid++; + if (!empty($client['custom_options'])) { + $cstmopts = array(); + $tmpcstmopts = explode(";", $client['custom_options']); + $assigned = false; + $tmpstr = ""; + foreach ($tmpcstmopts as $tmpcstmopt) { + $tmpstr = str_replace(" ", "", $tmpcstmopt); + if (substr($tmpstr,0 ,6) == "devtun") { + $assigned = true; + continue; + } else + $cstmopts[] = $tmpcstmopt; + } + $client['custom_options'] = implode(";", $cstmopts); + if ($assigned == true) { + $realif = substr($tmpstr, 3); + foreach ($config['interfaces'] as $iface => $cfgif) { + if ($cfgif['if'] == $realif) { + $config['interfaces'][$iface]['if'] = "ovpnc{$client['vpnid']}"; + break; + } + } + } + } + if (!empty($client['disable'])) $client['disable'] = true; else From 8fd0badddbead2b224c50d55542897d75ed668e6 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 23 Aug 2010 18:23:53 +0000 Subject: [PATCH 02/48] Ticket #482. This solves point 3) which converts the custom 'local IP' directive to the 2.0 format. --- etc/inc/upgrade_config.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index eb1e425493..e94345482e 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1425,6 +1425,9 @@ function upgrade_051_to_052() { if (substr($tmpstr,0 ,6) == "devtun") { $assigned = true; continue; + } else if (substr($tmpstr, 0, 5) == "local") { + $localip = substr($tmpstr, 6); + $server['ipaddr'] = str_replace("\n", "", $localip); } else $cstmopts[] = $tmpcstmopt; } @@ -1524,6 +1527,9 @@ function upgrade_051_to_052() { if (substr($tmpstr,0 ,6) == "devtun") { $assigned = true; continue; + } else if (substr($tmpstr, 0, 5) == "local") { + $localip = substr($tmpstr, 6); + $client['ipaddr'] = str_replace("\n", "", $localip); } else $cstmopts[] = $tmpcstmopt; } From 58ed10132e74338f2beebd847ca31bd375bd4520 Mon Sep 17 00:00:00 2001 From: smos Date: Mon, 23 Aug 2010 22:31:54 +0200 Subject: [PATCH 03/48] Fix logic operator for graph endpoint --- usr/local/www/status_rrd_graph.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 14dc30dd37..6e577c1c39 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -227,12 +227,13 @@ function get_dates($curperiod, $graph) { break; } $start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear); - if($offset == 0) + if(($offset != 0) || (($start + ($end - (12 * 3600)) ) > 0) ) { $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear); + } break; case "day": $start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": @@ -245,27 +246,27 @@ function get_dates($curperiod, $graph) { break; } $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear); break; case "month": $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear); break; case "quarter": $start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear); break; case "year": $start = mktime(0, 0, 0, 1, 0, ($curyear + $offset)); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1)); break; case "4year": $start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset)); - if($offset == 0) + if($offset != 0) $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1)); break; } From de47ce7c57669ed09c778ae7aa38cd31f4cea14d Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 23 Aug 2010 16:47:14 -0400 Subject: [PATCH 04/48] Fix order of tabs in this file. --- usr/local/www/diag_logs_relayd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index ec654c71d1..3aac43170f 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -67,8 +67,8 @@ include("head.inc"); $tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php"); $tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php"); $tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php"); - $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); $tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php"); + $tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php"); $tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php"); $tab_array[] = array(gettext("Load Balancer"), true, "diag_logs_relayd.php"); $tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php"); From 59218e2212c318d7531ddeefe3a0dd254dd4d31c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 23 Aug 2010 17:11:24 -0400 Subject: [PATCH 05/48] Do not use APC on cli --- etc/rc.php_ini_setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup index 5479eed715..ee26d954ce 100755 --- a/etc/rc.php_ini_setup +++ b/etc/rc.php_ini_setup @@ -228,7 +228,7 @@ if [ $RAM -gt 96 ]; then ; APC Settings apc.enabled="1" -apc.enable_cli="1" +apc.enable_cli="0" apc.shm_size="${APCSHMEMSIZE}" [suhosin] From 85a4aab6125b7cd79d1c5a697c1f47ce473d9785 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Mon, 23 Aug 2010 19:51:53 -0600 Subject: [PATCH 06/48] Fix showing the current graph selection on the system RRD graphs. --- usr/local/www/status_rrd_graph.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 6e577c1c39..e1ee2b2c9c 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -358,9 +358,9 @@ function get_dates($curperiod, $graph) { switch($curcat) { case "system": - $optioncf = str_replace($search, $replace, $optionc[1]); - echo "