diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2015-12-12 21:42:34 +0100 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2015-12-12 21:42:34 +0100 |
commit | 1980fb6674d51d73f5ed6aa6e48dc2133d373a36 (patch) | |
tree | 131385b855237777e9d403ad34686433bac9a371 | |
parent | dcc68137b44ee8f82f4e71f6650fc1cec5fd8c6b (diff) | |
download | pfsense-packages-1980fb6674d51d73f5ed6aa6e48dc2133d373a36.tar.gz pfsense-packages-1980fb6674d51d73f5ed6aa6e48dc2133d373a36.tar.bz2 pfsense-packages-1980fb6674d51d73f5ed6aa6e48dc2133d373a36.zip |
haproxy-devel, small fixes
-rw-r--r-- | config/haproxy-devel/pkg/haproxy.inc | 9 | ||||
-rw-r--r-- | config/haproxy-devel/pkg/haproxy_socketinfo.inc | 6 | ||||
-rw-r--r-- | config/haproxy-devel/www/haproxy_global.php | 29 | ||||
-rw-r--r-- | config/haproxy-devel/www/haproxy_listeners_edit.php | 16 | ||||
-rw-r--r-- | config/haproxy-devel/www/haproxy_pool_edit.php | 13 |
5 files changed, 51 insertions, 22 deletions
diff --git a/config/haproxy-devel/pkg/haproxy.inc b/config/haproxy-devel/pkg/haproxy.inc index 3d614fe0..8dce42ee 100644 --- a/config/haproxy-devel/pkg/haproxy.inc +++ b/config/haproxy-devel/pkg/haproxy.inc @@ -43,7 +43,10 @@ $a_frontendmode = array(); $a_frontendmode['http'] = array('name' => "http / https(offloading)", 'shortname' => "http/https"); $a_frontendmode['https'] = array('name' => "ssl / https(TCP mode)", 'shortname' => "ssl/https"); $a_frontendmode['tcp'] = array('name' => "tcp", 'shortname' => "tcp"); -$a_frontendmode['health'] = array('name' => "health", 'shortname' => "health"); +/* + if anyone actually used this what was it good for with recent package versions? +$a_frontendmode['health'] = array('name' => "health", 'shortname' => "health"); +*/ global $a_acltypes; $a_acltypes = array(); @@ -1738,8 +1741,8 @@ function haproxy_writeconf($configpath) { if ($bind['forwardfor']) { fwrite ($fd, "\toption\t\t\tforwardfor\n"); fwrite ($fd, "\tacl https ssl_fc\n"); - fwrite ($fd, "\treqadd X-Forwarded-Proto:\ http if !https\n"); - fwrite ($fd, "\treqadd X-Forwarded-Proto:\ https if https\n"); + fwrite ($fd, "\thttp-request set-header\t\tX-Forwarded-Proto http if !https\n"); + fwrite ($fd, "\thttp-request set-header\t\tX-Forwarded-Proto https if https\n"); } } diff --git a/config/haproxy-devel/pkg/haproxy_socketinfo.inc b/config/haproxy-devel/pkg/haproxy_socketinfo.inc index cbfb131b..7dbb6221 100644 --- a/config/haproxy-devel/pkg/haproxy_socketinfo.inc +++ b/config/haproxy-devel/pkg/haproxy_socketinfo.inc @@ -40,14 +40,18 @@ $show_clients_traffic = "YES"; function haproxy_socket_command($command){ $result = array(); if (file_exists("/tmp/haproxy.socket")) { - $socket = stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr); + $socket = @stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr); if ($socket) { fwrite($socket, "$command\n"); while (!feof($socket)) { $result[] = fgets($socket); } fclose($socket); + } else { + echo "cannot open command socket, haproxy not running? ({$errstr})"; } + } else { + echo "haproxy command socket does not exist, haproxy not running?"; } return $result; } diff --git a/config/haproxy-devel/www/haproxy_global.php b/config/haproxy-devel/www/haproxy_global.php index 4902b966..ce6b249e 100644 --- a/config/haproxy-devel/www/haproxy_global.php +++ b/config/haproxy-devel/www/haproxy_global.php @@ -425,29 +425,29 @@ function enable_change(enable_change) { </tr> <tr> <td valign="top" class="vncell"> - 'resolver_retries' + Retries </td> <td class="vtable"> <input name="resolver_retries" type="text" <?if(isset($pconfig['resolver_retries'])) echo "value=\"{$pconfig['resolver_retries']}\"";?> size="50"/><br/> - Email address to be used as the sender of the emails. + Defines the number of queries to send to resolve a server name before giving up. Default value: 3 </td> </tr> <tr> <td valign="top" class="vncell"> - 'resolver_timeoutretry' + Retry timeout </td> <td class="vtable"> <input name="resolver_timeoutretry" type="text" <?if(isset($pconfig['resolver_timeoutretry'])) echo "value=\"{$pconfig['resolver_timeoutretry']}\"";?> size="50"/><br/> - Email address to be used as the sender of the emails. + Time between two DNS queries, when no response have been received. Default value: 1s </td> </tr> <tr> <td valign="top" class="vncell"> - 'resolver_holdvalid' + Interval </td> <td class="vtable"> <input name="resolver_holdvalid" type="text" <?if(isset($pconfig['resolver_holdvalid'])) echo "value=\"{$pconfig['resolver_holdvalid']}\"";?> size="50"/><br/> - Email address to be used as the sender of the emails. + Interval between two successive name resolution when the last answer was valid. Default value: 10s </td> </tr> <tr><td> </td></tr> @@ -612,13 +612,22 @@ Minimum and default value is: 1024, bigger values might increase CPU usage.<br/> </div> </table> +<?php if(file_exists("/var/etc/haproxy_test/haproxy.cfg")): ?> + <div id="testconfiguration" style="display:none; border-style:dashed; padding: 8px;"> + <b><i>/var/etc/haproxy_test/haproxy.cfg file contents:</i></b> + <?php + echo "<pre>" . trim(file_get_contents("/var/etc/haproxy_test/haproxy.cfg")) . "</pre>"; + ?> + </div> + <div id="showtestconfiguration"> + <a onClick="new Effect.Fade('showtestconfiguration'); new Effect.Appear('testconfiguration'); setTimeout('scroll_after_fade();', 250); return false;" href="#">Show</a> automatically generated test configuration. + </div> +<?php endif; ?> <?php if(file_exists("/var/etc/haproxy/haproxy.cfg")): ?> <div id="configuration" style="display:none; border-style:dashed; padding: 8px;"> - <b><i>/var/etc/haproxy.cfg file contents:</i></b> + <b><i>/var/etc/haproxy/haproxy.cfg file contents:</i></b> <?php - if(file_exists("/var/etc/haproxy/haproxy.cfg")) { - echo "<pre>" . trim(file_get_contents("/var/etc/haproxy/haproxy.cfg")) . "</pre>"; - } + echo "<pre>" . trim(file_get_contents("/var/etc/haproxy/haproxy.cfg")) . "</pre>"; ?> </div> <div id="showconfiguration"> diff --git a/config/haproxy-devel/www/haproxy_listeners_edit.php b/config/haproxy-devel/www/haproxy_listeners_edit.php index 8e6c1c3d..f26341b2 100644 --- a/config/haproxy-devel/www/haproxy_listeners_edit.php +++ b/config/haproxy-devel/www/haproxy_listeners_edit.php @@ -532,8 +532,9 @@ $primaryfrontends = get_haproxy_frontends($excludefrontend); d = document; for (i = 0; i < 99; i++) { el = d.getElementById("table_acls" + "expression" + i); + row_v = d.getElementById("tr_view_" + i); row_e = d.getElementById("tr_edit_" + i); - row_v = d.getElementById("tr_viewdetail_" + i); + row_vd = d.getElementById("tr_viewdetail_" + i); if (!el || !row_e) continue; for (j = 0; j < count; j++) { @@ -543,10 +544,17 @@ $primaryfrontends = get_haproxy_frontends($excludefrontend); if (row_v) { Effect.Fade(row_v,{ duration: 1.0 }); } + if (row_vd) { + Effect.Fade(row_vd,{ duration: 1.0 }); + } } else { - Effect.Appear(row_e,{ duration: 1.0 }); - if (row_v) { - Effect.Appear(row_v,{ duration: 1.0 }); + if (!row_v || (row_v && row_v.style.display == "none")) { + // only make the edit row appear if the view row is not still on the screen. + // (when switching frontend types) + Effect.Appear(row_e,{ duration: 1.0 }); + } + if (row_vd) { + Effect.Appear(row_vd,{ duration: 1.0 }); } } } diff --git a/config/haproxy-devel/www/haproxy_pool_edit.php b/config/haproxy-devel/www/haproxy_pool_edit.php index 2b4787f3..54d9031f 100644 --- a/config/haproxy-devel/www/haproxy_pool_edit.php +++ b/config/haproxy-devel/www/haproxy_pool_edit.php @@ -491,7 +491,6 @@ foreach($simplefields as $field){ ?> <style type="text/css"> - .tableA_servers_details_visible{display:none;} .haproxy_stats_visible{display:none;} .haproxy_check_enabled{display:none;} .haproxy_check_http{display:none;} @@ -543,7 +542,12 @@ foreach($simplefields as $field){ function updatevisibility() { d = document; - setCSSdisplay(".tableA_servers_details_visible", server_advanced_options_visible.checked); + // IE needs components found into javascript variables + stats_enabled = d.getElementById("stats_enabled"); + persist_cookie_enabled = d.getElementById("persist_cookie_enabled"); + agent_check = d.getElementById("agent_check"); + sticky_type_description = d.getElementById("sticky_type_description"); + setCSSdisplay(".haproxy_stats_visible", stats_enabled.checked); setCSSdisplay(".haproxy_cookie_visible", persist_cookie_enabled.checked); @@ -611,7 +615,7 @@ foreach($simplefields as $field){ </td> </tr> <tr align="left"> - <td class="vncell" colspan="3"><strong>Server list</strong><input id="server_advanced_options_visible" name="server_advanced_options_visible" type='checkbox' onclick="updatevisibility();">Show advanced options(servers need to first be saved to configure these settings)</input> + <td class="vncell" colspan="3"><strong>Server list</strong> <span style="float:right;"> Toggle serverlist help. <a onclick="toggleCSSdisplay('.haproxy_help_serverlist');" title="<?php echo gettext("Help"); ?>"><img style="vertical-align:middle" src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_help.gif" border="0" alt="help" /></a> </span> @@ -893,7 +897,8 @@ foreach($simplefields as $field){ <? echo_html_select("httpcheck_method",$a_httpcheck_method,$pconfig['httpcheck_method']); ?> - <br/>OPTIONS is the method usually best to perform server checks, HEAD and GET can also be used + <br/>OPTIONS is the method usually best to perform server checks, HEAD and GET can also be used. + If the server gets marked as down in the stats page then changing this to GET usually has the biggest chance of working, but might cause more processing overhead on the websever and is less easy to filter out of its logs. </td> </tr> <tr align="left" class="haproxy_check_http"> |