aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-03 03:08:55 -0200
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-03 03:08:55 -0200
commit68f850e299f234fa0837467a4a0eb31b9c1f97b9 (patch)
tree1a4fc64f9dc1220247b875aaff61da7dd37d0f82 /config
parentd40916e639e314d9124586f7a068762020f7beeb (diff)
downloadpfsense-packages-68f850e299f234fa0837467a4a0eb31b9c1f97b9.tar.gz
pfsense-packages-68f850e299f234fa0837467a4a0eb31b9c1f97b9.tar.bz2
pfsense-packages-68f850e299f234fa0837467a4a0eb31b9c1f97b9.zip
haproxy-full - move sync to its own tab, add sync to configured backup server
change some fields position add shortcut info to haproxy on pfsense 2.1
Diffstat (limited to 'config')
-rw-r--r--config/haproxy-legacy/haproxy.inc121
-rw-r--r--config/haproxy-legacy/haproxy.xml10
-rwxr-xr-xconfig/haproxy-legacy/haproxy_frontends.php3
-rwxr-xr-xconfig/haproxy-legacy/haproxy_frontends_edit.php247
-rwxr-xr-xconfig/haproxy-legacy/haproxy_global.php74
-rwxr-xr-xconfig/haproxy-legacy/haproxy_servers.php3
-rwxr-xr-xconfig/haproxy-legacy/haproxy_servers_edit.php39
-rw-r--r--config/haproxy-legacy/haproxy_sync.xml146
-rwxr-xr-xconfig/haproxy-legacy/pkg_haproxy.inc11
9 files changed, 439 insertions, 215 deletions
diff --git a/config/haproxy-legacy/haproxy.inc b/config/haproxy-legacy/haproxy.inc
index dfbec28c..47dc5474 100644
--- a/config/haproxy-legacy/haproxy.inc
+++ b/config/haproxy-legacy/haproxy.inc
@@ -1,6 +1,7 @@
<?php
/*
haproxy.inc
+ Copyright (C) 2013 Marcello Coutinho
Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
Copyright (C) 2008 Remco Hoef
All rights reserved.
@@ -28,6 +29,7 @@
*/
/* include all configuration functions */
+$shortcut_section = "haproxy";
require_once("functions.inc");
require_once("pkg-utils.inc");
require_once("notices.inc");
@@ -40,6 +42,31 @@ function haproxy_custom_php_deinstall_command() {
exec("rm /usr/local/www/haproxy*");
}
+function migrate_old_sync_config(){
+ global $g, $config;
+ //move Sync HAProxy configuration (if enabled)
+ $write_config=0;
+ if(is_array($config['installedpackages']['haproxy'])){
+ $haproxy_cfg=$config['installedpackages']['haproxy'];
+ if (isset($haproxy_cfg['enablesync'])) {
+ for($si=1;$si<=3;$si++){
+ if($haproxy_cfg['synchost'.$si]) {
+ $config['installedpackages']['haproxysync']['config'][0]['row'][]=array('enabless'=>'ON',
+ 'ipaddress'=>$haproxy_cfg['synchost'.$si],
+ 'username'=> 'admin',
+ 'password'=> $haproxy_cfg['syncpassword']);
+ unset($config['installedpackages']['haproxy']['synchost'.$si]);
+ $write_config++;
+ }
+ }
+ }
+ }
+ if ($write_config > 0){
+ unset($config['installedpackages']['haproxy']['enablesync']);
+ unset($config['installedpackages']['haproxy']['syncpassword']);
+ write_config("Haproxy - Migrate old sync config from global to sync tab.");
+ }
+}
function haproxy_custom_php_install_command() {
global $g, $config;
conf_mount_rw();
@@ -90,7 +117,7 @@ EOD;
fwrite($fd, $haproxy);
fclose($fd);
exec("chmod a+rx /usr/local/etc/rc.d/haproxy.sh");
-
+ migrate_old_sync_config();
conf_mount_ro();
exec("/usr/local/etc/rc.d/haproxy.sh start");
@@ -274,26 +301,11 @@ function haproxy_configure() {
}
fwrite ($fd, "\n");
}
- // Sync HAProxy configuration (if enabled)
- if(isset($config['installedpackages']['haproxy']['enablesync'])) {
- if($config['installedpackages']['haproxy']['synchost1']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost1'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- if($config['installedpackages']['haproxy']['synchost2']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost2'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- if($config['installedpackages']['haproxy']['synchost3']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost3'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- }
}
// create config file
fclose($fd);
-
+
$freebsd_version = substr(trim(`uname -r`), 0, 1);
if(!file_exists("/usr/bin/limits")) {
exec("fetch -q -o /usr/bin/limits http://files.pfsense.org/extras/{$freebsd_version}/limits");
@@ -301,7 +313,7 @@ function haproxy_configure() {
}
exec("/usr/bin/limits -n 300014");
-
+
// reload haproxy
if(isset($a_global['enable'])) {
if(is_process_running('haproxy')) {
@@ -309,13 +321,69 @@ function haproxy_configure() {
} else {
exec("/usr/local/sbin/haproxy -f /var/etc/haproxy.cfg -p /var/run/haproxy.pid -D");
}
+ haproxy_sync_on_changes();
return (0);
} else {
+ haproxy_sync_on_changes();
return (1);
}
}
-function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
+/* Uses XMLRPC to synchronize the changes to a remote node */
+function haproxy_sync_on_changes() {
+ global $config, $g;
+ if (is_array($config['installedpackages']['haproxysync']['config'])){
+ $haproxy_sync=$config['installedpackages']['haproxysync']['config'][0];
+ $synctimeout = $haproxy_sync['synctimeout'];
+ $synconchanges = $haproxy_sync['synconchanges'];
+ switch ($synconchanges){
+ case "manual":
+ if (is_array($haproxy_sync['row'])){
+ $rs=$haproxy_sync['row'];
+ }
+ else{
+ log_error("[haproxy] xmlrpc sync is enabled but there is no hosts to push haproxy config.");
+ return;
+ }
+ break;
+ case "auto":
+ if (is_array($config['installedpackages']['carpsettings']) && is_array($config['installedpackages']['carpsettings']['config'])){
+ $system_carp=$config['installedpackages']['carpsettings']['config'][0];
+ $rs[0]['ipaddress']=$system_carp['synchronizetoip'];
+ $rs[0]['username']=$system_carp['username'];
+ $rs[0]['password']=$system_carp['password'];
+ $rs[0]['enabless']=true;
+ if (! is_ipaddr($system_carp['synchronizetoip'])){
+ log_error("[haproxy] xmlrpc sync is enabled but there is no system backup hosts to push haproxy config.");
+ return;
+ }
+ }
+ else{
+ log_error("[haproxy] xmlrpc sync is enabled but there is no system backup hosts to push haproxy config.");
+ return;
+ }
+ break;
+ default:
+ return;
+ break;
+ }
+ if (is_array($rs)){
+ log_error("[haproxy] xmlrpc sync is starting.");
+ foreach($rs as $sh){
+ $sync_to_ip = $sh['ipaddress'];
+ if($sh['username'])
+ $username = $sh['username'];
+ else
+ $username = 'admin';
+ if($sh['password'] && $sh['ipaddress'] && $sh['enabless'])
+ haproxy_do_xmlrpc_sync($sh['ipaddress'], $username, $sh['password'],$synctimeout);
+ }
+ log_error("[haproxy] xmlrpc sync is ending.");
+ }
+ }
+}
+
+function haproxy_do_xmlrpc_sync($sync_to_ip, $username="admin", $password,$synctimeout="30") {
global $config, $g;
if(!$password)
@@ -323,6 +391,7 @@ function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
if(!$sync_to_ip)
return;
+
// Do not allow syncing to self.
$donotsync = false;
@@ -379,18 +448,18 @@ function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
$method = 'pfsense.merge_installedpackages_section_xmlrpc';
$msg = new XML_RPC_Message($method, $params);
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
+ $cli->setCredentials($username, $password);
if($g['debug'])
$cli->setDebug(1);
- /* send our XMLRPC message and timeout after 250 seconds */
- $resp = $cli->send($msg, "250");
+ /* send our XMLRPC message and timeout after $synctimeout seconds */
+ $resp = $cli->send($msg, $synctimeout);
if(!$resp) {
$error = "A communications error occurred while attempting HAProxy XMLRPC sync with {$url}:{$port}.";
log_error($error);
file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
} elseif($resp->faultCode()) {
$cli->setDebug(1);
- $resp = $cli->send($msg, "250");
+ $resp = $cli->send($msg, $synctimeout);
$error = "An error code was received while attempting HAProxy XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
log_error($error);
file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
@@ -412,15 +481,15 @@ function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
log_error("HAProxy XMLRPC reload data {$url}:{$port}.");
$msg = new XML_RPC_Message($method, $params);
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- $resp = $cli->send($msg, "250");
+ $cli->setCredentials($username, $password);
+ $resp = $cli->send($msg, $synctimeout);
if(!$resp) {
$error = "A communications error occurred while attempting HAProxy XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
log_error($error);
file_notice("sync_settings", $error, "HAProxy Settings Reload", "");
} elseif($resp->faultCode()) {
$cli->setDebug(1);
- $resp = $cli->send($msg, "250");
+ $resp = $cli->send($msg, $synctimeout);
$error = "An error code was received while attempting HAProxy XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
log_error($error);
file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
diff --git a/config/haproxy-legacy/haproxy.xml b/config/haproxy-legacy/haproxy.xml
index 556a1178..33b1913d 100644
--- a/config/haproxy-legacy/haproxy.xml
+++ b/config/haproxy-legacy/haproxy.xml
@@ -65,6 +65,11 @@
<item>http://www.pfsense.com/packages/config/haproxy-legacy/haproxy.inc</item>
</additional_files_needed>
<additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>077</chmod>
+ <item>http://www.pfsense.com/packages/config/haproxy-legacy/haproxy_sync.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
<prefix>/usr/local/www/</prefix>
<chmod>077</chmod>
<item>http://www.pfsense.com/packages/config/haproxy-legacy/haproxy_frontends.php</item>
@@ -89,6 +94,11 @@
<chmod>077</chmod>
<item>http://www.pfsense.com/packages/config/haproxy-legacy/haproxy_servers_edit.php</item>
</additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/www/shortcuts/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.org/packages/config/haproxy-legacy/pkg_haproxy.inc</item>
+ </additional_files_needed>
<custom_delete_php_command>
</custom_delete_php_command>
<custom_add_php_command>
diff --git a/config/haproxy-legacy/haproxy_frontends.php b/config/haproxy-legacy/haproxy_frontends.php
index d50133b8..e97fbc7b 100755
--- a/config/haproxy-legacy/haproxy_frontends.php
+++ b/config/haproxy-legacy/haproxy_frontends.php
@@ -28,7 +28,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require_once("guiconfig.inc");
$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
@@ -92,6 +92,7 @@ include("head.inc");
$tab_array[] = array("Settings", false, "haproxy_global.php");
$tab_array[] = array("Frontends", true, "haproxy_frontends.php");
$tab_array[] = array("Servers", false, "haproxy_servers.php");
+ $tab_array[] = array("Sync", false, "pkg_edit.php?xml=haproxy_sync.xml");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/config/haproxy-legacy/haproxy_frontends_edit.php b/config/haproxy-legacy/haproxy_frontends_edit.php
index 548cf612..99391fe9 100755
--- a/config/haproxy-legacy/haproxy_frontends_edit.php
+++ b/config/haproxy-legacy/haproxy_frontends_edit.php
@@ -3,6 +3,7 @@
/*
haproxy_frontends_edit.php
part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2013 Marcello Coutinho
Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
All rights reserved.
@@ -28,7 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require("guiconfig.inc");
$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
@@ -113,12 +114,14 @@ if ($_POST) {
if (!$_POST['retries'] && is_numeric($_POST['retries']))
$input_errors[] = "The field 'Retries' value is not a number.";
+
+ if ($_POST['stats_enabled'] == "yes"){
+ if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_username']))
+ $input_errors[] = "The field 'Stats Username' contains invalid characters.";
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_username']))
- $input_errors[] = "The field 'Stats Username' contains invalid characters.";
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_password']))
- $input_errors[] = "The field 'Stats Password' contains invalid characters.";
+ if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_password']))
+ $input_errors[] = "The field 'Stats Password' contains invalid characters.";
+ }
if (!is_numeric($_POST['max_connections']))
$input_errors[] = "The field 'Max connections' value is not a number.";
@@ -391,7 +394,21 @@ include("head.inc");
<p class="pgtitle"><?=$pgtitle?></p>
<?php endif; ?>
<form action="haproxy_frontends_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+ <?php
+ /* active tabs */
+ $tab_array = array();
+ $tab_array[] = array("Settings", false, "haproxy_global.php");
+ $tab_array[] = array("Frontends", true, "haproxy_frontends.php");
+ $tab_array[] = array("Servers", false, "haproxy_servers.php");
+ $tab_array[] = array("Sync", false, "pkg_edit.php?xml=haproxy_sync.xml");
+ display_top_tabs($tab_array);
+ ?>
+ </td></tr>
+ <tr><td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">Edit haproxy backend</td>
</tr>
@@ -408,30 +425,6 @@ include("head.inc");
</td>
</tr>
<tr align="left">
- <td width="22%" valign="top" class="vncellreq">Connection timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="connection_timeout" type="text" <?if(isset($pconfig['connection_timeout'])) echo "value=\"{$pconfig['connection_timeout']}\"";?> size="64">
- <div>the time (in milliseconds) we give up if the connection does not complete within (30000).</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Server timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="server_timeout" type="text" <?if(isset($pconfig['server_timeout'])) echo "value=\"{$pconfig['server_timeout']}\"";?> size="64">
- <div>the time (in milliseconds) we accept to wait for data from the server, or for the server to accept data (30000).</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Retries</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="retries" type="text" <?if(isset($pconfig['retries'])) echo "value=\"{$pconfig['retries']}\"";?> size="64">
- <div>After a connection failure to a server, it is possible to retry, potentially
-on another server. This is useful if health-checks are too rare and you don't
-want the clients to see the failures. The number of attempts to reconnect is
-set by the 'retries' parameter (2).</div>
- </td>
- </tr>
- <tr align="left">
<td width="22%" valign="top" class="vncellreq">Type</td>
<td width="78%" class="vtable" colspan="2">
<select name="type" id="type" onchange="type_change();">
@@ -441,7 +434,43 @@ set by the 'retries' parameter (2).</div>
<option value="health"<?php if($pconfig['type'] == "health") echo " SELECTED"; ?>>Health</option>
</select>
</td>
- </tr>
+ </tr>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncellreq">Port</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="6" maxlength="500">
+ <div>The port to listen to. To specify multiple ports, separate with a comma (,). EXAMPLE: 80,443</div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Listen address</td>
+ <td width="78%" class="vtable">
+ <select name="extaddr" class="formfld">
+ <option value="" <?php if (!$pconfig['extaddr']) echo "selected"; ?>>Interface address</option>
+ <option value="127.0.0.1" <?php if($pconfig['extaddr'] == "127.0.0.1") echo "selected"; ?>>127.0.0.1 (Localhost)</option>
+ <?php
+ if (is_array($config['virtualip']['vip'])):
+ foreach ($config['virtualip']['vip'] as $sn):
+ ?>
+ <option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['extaddr']) echo "selected"; ?>>
+ <?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?>
+ </option>
+ <?php
+ endforeach;
+ endif;
+ ?>
+ <option value="any" <?php if($pconfig['extaddr'] == "any") echo "selected"; ?>>any</option>
+ </select>
+ <br/>
+ <span class="vexpl">
+ If you want this rule to apply to another IP address than the IP address of the interface chosen above,
+ select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first).
+ Also note that if you are trying to redirect connections on the LAN select the "any" option.<br>
+ While using carp, select localhost and forward via NAT.
+ </span>
+ </td>
+ </tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq">Balance</td>
<td width="78%" class="vtable" colspan="2">
@@ -507,6 +536,69 @@ set by the 'retries' parameter (2).</div>
</table>
</td>
</tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncell">Use 'forwardfor' option</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input id="forwardfor" name="forwardfor" type="checkbox" value="yes" <?php if ($pconfig['forwardfor']=='yes') echo "checked"; ?>>
+ <br/>
+ The 'forwardfor' option creates an HTTP 'X-Forwarded-For' header which
+ contains the client's IP address. This is useful to let the final web server
+ know what the client address was (eg for statistics on domains)
+ </td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncell">Use 'httpclose' option</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input id="httpclose" name="httpclose" type="checkbox" value="yes" <?php if ($pconfig['httpclose']=='yes') echo "checked"; ?>>
+ <br/>
+ The 'httpclose' option removes any 'Connection' header both ways, and
+ adds a 'Connection: close' header in each direction. This makes it easier to
+ disable HTTP keep-alive than the previous 4-rules block.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Connection limits</td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncellreq">Connection timeout</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="connection_timeout" type="text" <?if(isset($pconfig['connection_timeout'])) echo "value=\"{$pconfig['connection_timeout']}\"";?> size="64">
+ <div>the time (in milliseconds) we give up if the connection does not complete within (30000).</div>
+ </td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncellreq">Server timeout</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="server_timeout" type="text" <?if(isset($pconfig['server_timeout'])) echo "value=\"{$pconfig['server_timeout']}\"";?> size="64">
+ <div>the time (in milliseconds) we accept to wait for data from the server, or for the server to accept data (30000).</div>
+ </td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncell">Retries</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="retries" type="text" <?if(isset($pconfig['retries'])) echo "value=\"{$pconfig['retries']}\"";?> size="6">
+ <div>After a connection failure to a server, it is possible to retry, potentially
+on another server. This is useful if health-checks are too rare and you don't
+want the clients to see the failures. The number of attempts to reconnect is
+set by the 'retries' parameter (2).</div>
+ </td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncell">Max connections</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="max_connections" type="text" <?if(isset($pconfig['max_connections'])) echo "value=\"{$pconfig['max_connections']}\"";?> size="10" maxlength="10">
+ </td>
+ </tr>
+ <tr align="left">
+ <td width="22%" valign="top" class="vncell">Client timeout</td>
+ <td width="78%" class="vtable" colspan="2">
+ <input name="client_timeout" type="text" <?if(isset($pconfig['client_timeout'])) echo "value=\"{$pconfig['client_timeout']}\"";?> size="10" maxlength="10">
+ <div>the time (in milliseconds) we accept to wait for data from the client, or for the client to accept data (30000).</div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Backend stats</td>
+ </tr>
<tr align="left">
<td width="22%" valign="top" class="vncell">Stats Enabled</td>
<td width="78%" class="vtable" colspan="2">
@@ -530,14 +622,14 @@ set by the 'retries' parameter (2).</div>
<tr align="left" id='stats_username_row' name='stats_username_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
<td width="22%" valign="top" class="vncellreq">Stats Username</td>
<td width="78%" class="vtable" colspan="2">
- <input id="stats_username" name="stats_username" type="text" <?if(isset($pconfig['stats_username'])) echo "value=\"{$pconfig['stats_username']}\"";?> size="64">
+ <input id="stats_username" name="stats_username" type="text" <?if(isset($pconfig['stats_username'])) echo "value=\"{$pconfig['stats_username']}\"";?> size="25">
</td>
</tr>
<tr align="left" id='stats_password_row' name='stats_password_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
<td width="22%" valign="top" class="vncellreq">Stats Password</td>
<td width="78%" class="vtable" colspan="2">
- <input id="stats_password" name="stats_password" type="password" <?if(isset($pconfig['stats_password'])) echo "value=\"{$pconfig['stats_password']}\"";?> size="64">
+ <input id="stats_password" name="stats_password" type="password" <?if(isset($pconfig['stats_password'])) echo "value=\"{$pconfig['stats_password']}\"";?> size="25">
<br/>
</td>
</tr>
@@ -565,7 +657,7 @@ set by the 'retries' parameter (2).</div>
<tr align="left" id='stats_refresh_row' name='stats_refresh_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
<td width="22%" valign="top" class="vncell">Stats Refresh</td>
<td width="78%" class="vtable" colspan="2">
- <input id="stats_refresh" name="stats_refresh" type="text" <?if(isset($pconfig['stats_refresh'])) echo "value=\"{$pconfig['stats_refresh']}\"";?> size="10" maxlength="30"><br/>
+ <input id="stats_refresh" name="stats_refresh" type="text" <?if(isset($pconfig['stats_refresh'])) echo "value=\"{$pconfig['stats_refresh']}\"";?> size="6" maxlength="30"><br/>
Specify the refresh rate of the stats page in seconds, or specified time unit (us, ms, s, m, h, d).
</td>
</tr>
@@ -577,56 +669,7 @@ set by the 'retries' parameter (2).</div>
Example: / or /index.php or /index.html or /testmypage.cgi
</td>
</tr>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Port</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="30" maxlength="500">
- <div>The port to listen to. To specify multiple ports, separate with a comma (,). EXAMPLE: 80,443</div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">External address</td>
- <td width="78%" class="vtable">
- <select name="extaddr" class="formfld">
- <option value="" <?php if (!$pconfig['extaddr']) echo "selected"; ?>>Interface address</option>
- <option value="127.0.0.1" <?php if($pconfig['extaddr'] == "Localhost") echo "selected"; ?>>Localhost</option>
- <option value="any" <?php if($pconfig['extaddr'] == "any") echo "selected"; ?>>any</option>
- <?php
- if (is_array($config['virtualip']['vip'])):
- foreach ($config['virtualip']['vip'] as $sn):
- ?>
- <option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['extaddr']) echo "selected"; ?>>
- <?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?>
- </option>
- <?php
- endforeach;
- endif;
- ?>
-
- </select>
- <br />
- <span class="vexpl">
- If you want this rule to apply to another IP address than the IP address of the interface chosen above,
- select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first).
- Also note that if you are trying to redirect connections on the LAN select the "any" option.<br>
- While using carp, select localhost and forward via NAT.
- </span>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Max connections</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="max_connections" type="text" <?if(isset($pconfig['max_connections'])) echo "value=\"{$pconfig['max_connections']}\"";?> size="10" maxlength="10">
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Client timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="client_timeout" type="text" <?if(isset($pconfig['client_timeout'])) echo "value=\"{$pconfig['client_timeout']}\"";?> size="10" maxlength="10">
- <div>the time (in milliseconds) we accept to wait for data from the client, or for the client to accept data (30000).</div>
- </td>
- </tr>
+
<?php
/*
<tr>
@@ -679,30 +722,12 @@ set by the 'retries' parameter (2).</div>
</tr>
*/
?>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Use 'forwardfor' option</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="forwardfor" name="forwardfor" type="checkbox" value="yes" <?php if ($pconfig['forwardfor']=='yes') echo "checked"; ?>>
- <br/>
- The 'forwardfor' option creates an HTTP 'X-Forwarded-For' header which
- contains the client's IP address. This is useful to let the final web server
- know what the client address was (eg for statistics on domains)
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Use 'httpclose' option</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="httpclose" name="httpclose" type="checkbox" value="yes" <?php if ($pconfig['httpclose']=='yes') echo "checked"; ?>>
- <br/>
- The 'httpclose' option removes any 'Connection' header both ways, and
- adds a 'Connection: close' header in each direction. This makes it easier to
- disable HTTP keep-alive than the previous 4-rules block.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Advanced pass thru</td>
- <td width="78%" class="vtable" colspan="2">
- <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Advanced pass thru</td>
+ </tr>
+ <tr align="left" colspan="2" >
+ <td width="100%" class="vtable" colspan="2">
+ <textarea name='advanced' rows="6" cols="90" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
<br/>
NOTE: paste text into this box that you would like to pass thru.
</td>
@@ -718,12 +743,14 @@ set by the 'retries' parameter (2).</div>
</td>
</tr>
<tr>
- <br/>&nbsp;<br/>
+
<td colspan='3'>
<span class="vexpl"><b>NOTE:</b> You must add a firewall rule permitting access to this frontend!</span>
</td>
</tr>
</table>
+ </div>
+ </td></tr></table>
</form>
<br>
<script type="text/javascript">
diff --git a/config/haproxy-legacy/haproxy_global.php b/config/haproxy-legacy/haproxy_global.php
index b0486fb8..f47ada8b 100755
--- a/config/haproxy-legacy/haproxy_global.php
+++ b/config/haproxy-legacy/haproxy_global.php
@@ -3,6 +3,7 @@
/*
haproxy_global.php
part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2013 Marcello Coutinho
Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
All rights reserved.
@@ -28,7 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require("globals.inc");
require("guiconfig.inc");
require_once("haproxy.inc");
@@ -61,22 +62,10 @@ if ($_POST) {
if ($_POST['maxconn'] && (!is_numeric($_POST['maxconn'])))
$input_errors[] = "The maximum number of connections should be numeric.";
- if($_POST['synchost1'] && !is_ipaddr($_POST['synchost1']))
- $input_errors[] = "Synchost1 needs to be an IPAddress.";
- if($_POST['synchost2'] && !is_ipaddr($_POST['synchost2']))
- $input_errors[] = "Synchost2 needs to be an IPAddress.";
- if($_POST['synchost3'] && !is_ipaddr($_POST['synchost3']))
- $input_errors[] = "Synchost3 needs to be an IPAddress.";
-
if (!$input_errors) {
$config['installedpackages']['haproxy']['enable'] = $_POST['enable'] ? true : false;
$config['installedpackages']['haproxy']['maxconn'] = $_POST['maxconn'] ? $_POST['maxconn'] : false;
- $config['installedpackages']['haproxy']['enablesync'] = $_POST['enablesync'] ? true : false;
- $config['installedpackages']['haproxy']['synchost1'] = $_POST['synchost1'] ? $_POST['synchost1'] : false;
- $config['installedpackages']['haproxy']['synchost2'] = $_POST['synchost2'] ? $_POST['synchost2'] : false;
- $config['installedpackages']['haproxy']['synchost3'] = $_POST['synchost3'] ? $_POST['synchost3'] : false;
$config['installedpackages']['haproxy']['remotesyslog'] = $_POST['remotesyslog'] ? $_POST['remotesyslog'] : false;
- $config['installedpackages']['haproxy']['syncpassword'] = $_POST['syncpassword'] ? $_POST['syncpassword'] : false;
$config['installedpackages']['haproxy']['advanced'] = $_POST['advanced'] ? base64_encode($_POST['advanced']) : false;
$config['installedpackages']['haproxy']['nbproc'] = $_POST['nbproc'] ? $_POST['nbproc'] : false;
touch($d_haproxyconfdirty_path);
@@ -88,11 +77,6 @@ if ($_POST) {
$pconfig['enable'] = isset($config['installedpackages']['haproxy']['enable']);
$pconfig['maxconn'] = $config['installedpackages']['haproxy']['maxconn'];
-$pconfig['enablesync'] = isset($config['installedpackages']['haproxy']['enablesync']);
-$pconfig['syncpassword'] = $config['installedpackages']['haproxy']['syncpassword'];
-$pconfig['synchost1'] = $config['installedpackages']['haproxy']['synchost1'];
-$pconfig['synchost2'] = $config['installedpackages']['haproxy']['synchost2'];
-$pconfig['synchost3'] = $config['installedpackages']['haproxy']['synchost3'];
$pconfig['remotesyslog'] = $config['installedpackages']['haproxy']['remotesyslog'];
$pconfig['advanced'] = base64_decode($config['installedpackages']['haproxy']['advanced']);
$pconfig['nbproc'] = $config['installedpackages']['haproxy']['nbproc'];
@@ -134,7 +118,8 @@ function enable_change(enable_change) {
$tab_array = array();
$tab_array[] = array("Settings", true, "haproxy_global.php");
$tab_array[] = array("Frontends", false, "haproxy_frontends.php");
- $tab_array[] = array("Servers", false, "haproxy_servers.php");
+ $tab_array[] = array("Servers", false, "haproxy_servers.php");
+ $tab_array[] = array("Sync", false, "pkg_edit.php?xml=haproxy_sync.xml");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -207,7 +192,7 @@ function enable_change(enable_change) {
Number of processes to start
</td>
<td class="vtable">
- <input name="nbproc" type="text" class="formfld" id="nbproc" size="18" value="<?=htmlspecialchars($pconfig['nbproc']);?>">
+ <input name="nbproc" type="text" class="formfld" id="nbproc" size="4" value="<?=htmlspecialchars($pconfig['nbproc']);?>">
<br/>
Defaults to number of cores/processors installed if left blank (<?php echo trim(`/sbin/sysctl kern.smp.cpus | cut -d" " -f2`); ?> detected).
</td>
@@ -229,58 +214,15 @@ function enable_change(enable_change) {
<td colspan="2" valign="top" class="listtopic">Global Advanced pass thru</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
+ <td width="100%" class="vtable" colspan="2">
+ <textarea name='advanced' rows="6" cols="90" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
<br/>
NOTE: paste text into this box that you would like to pass thru in the global settings area.
</td>
</tr>
<tr>
<td>
- &nbsp;
- </td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Configuration synchronization</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enablesync" type="checkbox" value="yes" <?php if ($pconfig['enablesync']) echo "checked"; ?>>
- <strong>Sync HAProxy configuration to backup CARP members via XMLRPC.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Synchronization password</td>
- <td width="78%" class="vtable">
- <input name="syncpassword" type="password" value="<?=$pconfig['syncpassword'];?>">
- <br/>
- <strong>Enter the password that will be used during configuration synchronization. This is generally the remote webConfigurator password.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #1</td>
- <td width="78%" class="vtable">
- <input name="synchost1" value="<?=$pconfig['synchost1'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #2</td>
- <td width="78%" class="vtable">
- <input name="synchost2" value="<?=$pconfig['synchost2'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #3</td>
- <td width="78%" class="vtable">
- <input name="synchost3" value="<?=$pconfig['synchost3'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
+ &nbsp;
</td>
</tr>
<tr>
diff --git a/config/haproxy-legacy/haproxy_servers.php b/config/haproxy-legacy/haproxy_servers.php
index cacf995a..b8f58b73 100755
--- a/config/haproxy-legacy/haproxy_servers.php
+++ b/config/haproxy-legacy/haproxy_servers.php
@@ -28,7 +28,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require_once("guiconfig.inc");
require_once("haproxy.inc");
@@ -93,6 +93,7 @@ include("head.inc");
$tab_array[] = array("Settings", false, "haproxy_global.php");
$tab_array[] = array("Frontends", false, "haproxy_frontends.php");
$tab_array[] = array("Servers", true, "haproxy_servers.php");
+ $tab_array[] = array("Sync", false, "pkg_edit.php?xml=haproxy_sync.xml");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/config/haproxy-legacy/haproxy_servers_edit.php b/config/haproxy-legacy/haproxy_servers_edit.php
index a4360b04..4a8072b3 100755
--- a/config/haproxy-legacy/haproxy_servers_edit.php
+++ b/config/haproxy-legacy/haproxy_servers_edit.php
@@ -3,6 +3,7 @@
/*
haproxy_servers_edit.php
part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2013 Marcello Coutinho
Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
All rights reserved.
@@ -28,7 +29,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
+$shortcut_section = "haproxy";
require("guiconfig.inc");
$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
@@ -183,14 +184,29 @@ function clearcombo(){
<p class="pgtitle"><?=$pgtitle?></p>
<?php endif; ?>
<form action="haproxy_servers_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td class="tabnavtbl">
+ <?php
+ /* active tabs */
+ $tab_array = array();
+ $tab_array[] = array("Settings", false, "haproxy_global.php");
+ $tab_array[] = array("Frontends", false, "haproxy_frontends.php");
+ $tab_array[] = array("Servers", true, "haproxy_servers.php");
+ $tab_array[] = array("Sync", false, "pkg_edit.php?xml=haproxy_sync.xml");
+ display_top_tabs($tab_array);
+ ?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">Edit HAProxy server</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncellreq">Name</td>
<td width="78%" class="vtable" colspan="2">
- <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16">
+ <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16"><br>
</td>
</tr>
<tr align="left">
@@ -225,7 +241,7 @@ function clearcombo(){
<?=$backend['name'];?>
</option>
<?php } ?>
- </select>
+ </select><br>
</td>
<td>
<?php
@@ -244,7 +260,7 @@ function clearcombo(){
</table>
<a onclick="javascript:addRowTo('frontendtable'); return false;" href="#">
<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
- </a>
+ </a><br/>
</td>
</tr>
<tr>
@@ -253,8 +269,8 @@ function clearcombo(){
IP Address
</div>
</td>
- <td width="78%" class="vtable">
- <input name="address" type="text" id="address" size="30" value="<?=htmlspecialchars($pconfig['address']);?>" />
+ <td width="78%" class="vtable" colspan="2">
+ <input name="address" type="text" id="address" size="30" value="<?=htmlspecialchars($pconfig['address']);?>" /><br/>
</td>
</tr>
<tr align="left">
@@ -274,7 +290,7 @@ function clearcombo(){
<option value="disabled" <?php if($pconfig['status']=='disabled') echo "SELECTED";?>>disabled</option>
<option value="inactive" <?php if($pconfig['status']=='inactive') echo "SELECTED";?>>inactive</option>
</select>
- </td>
+ <br>Select Server Status</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncell">Cookie</td>
@@ -286,20 +302,20 @@ function clearcombo(){
sent to the client. There is nothing wrong in having several servers sharing
the same cookie value, and it is in fact somewhat common between normal and
backup servers. See also the "cookie" keyword in backend section.
-
+ <br/>
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncell">Check inter</td>
<td width="78%" class="vtable" colspan="2">
- <input name="checkinter" type="text" <?if(isset($pconfig['checkinter'])) echo "value=\"{$pconfig['checkinter']}\"";?>size="64">
+ <input name="checkinter" type="text" <?if(isset($pconfig['checkinter'])) echo "value=\"{$pconfig['checkinter']}\"";?>size="10">
<br/>Defaults to 1000 if left blank.
</td>
</tr>
<tr align="left">
<td width="22%" valign="top" class="vncell">Weight</td>
<td width="78%" class="vtable" colspan="2">
- <input name="weight" type="text" <?if(isset($pconfig['weight'])) echo "value=\"{$pconfig['weight']}\"";?>size="64"><br/>
+ <input name="weight" type="text" <?if(isset($pconfig['weight'])) echo "value=\"{$pconfig['weight']}\"";?>size="6"><br/>
The default weight is 1, and the maximal value is 255.<br/>
NOTE: If this
parameter is used to distribute the load according to server's capacity, it
@@ -327,6 +343,7 @@ function clearcombo(){
</td>
</tr>
</table>
+ </div></td></tr></table>
</form>
<br>
<?php include("fend.inc"); ?>
diff --git a/config/haproxy-legacy/haproxy_sync.xml b/config/haproxy-legacy/haproxy_sync.xml
new file mode 100644
index 00000000..5c2b6ab7
--- /dev/null
+++ b/config/haproxy-legacy/haproxy_sync.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ haproxy_sync.xml
+ part of the Haproxy package for pfSense
+ Copyright (C) 2013 Marcello Coutinho
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form MUST reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>haproxysync</name>
+ <version>1.0</version>
+ <title>Services: Haproxy: Sync</title>
+ <include_file>/usr/local/pkg/haproxy.inc</include_file>
+<tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/haproxy_global.php</url>
+ </tab>
+ <tab>
+ <text>Frontends</text>
+ <url>/haproxy_frontends.php</url>
+ </tab>
+ <tab>
+ <text>Servers</text>
+ <url>haproxy_servers.php</url>
+ </tab>
+ <tab>
+ <text>Sync</text>
+ <url>/pkg_edit.php?xml=haproxy_sync.xml</url>
+ <active/>
+ </tab>
+</tabs>
+ <fields>
+ <field>
+ <name>Haproxy Sync</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Sync method</fielddescr>
+ <fieldname>synconchanges</fieldname>
+ <description>Automatically sync Haproxy configuration changes to remote/backup server.</description>
+ <type>select</type>
+ <required/>
+ <default_value>auto</default_value>
+ <options>
+ <option><name>Sync to configured system backup server</name><value>auto</value></option>
+ <option><name>Sync to host(s) defined below</name><value>manual</value></option>
+ <option><name>Do not sync this package configuration</name><value>disabled</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Sync timeout</fielddescr>
+ <fieldname>synctimeout</fieldname>
+ <description>Select sync max wait time</description>
+ <type>select</type>
+ <required/>
+ <default_value>30</default_value>
+ <options>
+ <option><name>30 seconds(Default)</name><value>30</value></option>
+ <option><name>60 seconds</name><value>60</value></option>
+ <option><name>90 seconds</name><value>90</value></option>
+ <option><name>120 seconds</name><value>120</value></option>
+ <option><name>250 seconds</name><value>250</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr><![CDATA[Remote Server(s)]]></fielddescr>
+ <fieldname>none</fieldname>
+ <type>rowhelper</type>
+ <dontdisplayname/>
+ <usecolspan2/>
+ <rowhelper>
+ <rowhelperfield>
+ <fielddescr>Enable</fielddescr>
+ <fieldname>enabless</fieldname>
+ <type>checkbox</type>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Remote Server IP</fielddescr>
+ <fieldname>ipaddress</fieldname>
+ <description>IP Address of remote server</description>
+ <type>input</type>
+ <size>10</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Username</fielddescr>
+ <fieldname>username</fieldname>
+ <description>Username for remote server.</description>
+ <type>input</type>
+ <size>10</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Password</fielddescr>
+ <fieldname>password</fieldname>
+ <description>Password for remote server.</description>
+ <type>password</type>
+ <size>10</size>
+ </rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Description</fielddescr>
+ <fieldname>description</fieldname>
+ <type>input</type>
+ <size>27</size>
+ </rowhelperfield>
+ </rowhelper>
+ </field>
+ </fields>
+ <custom_php_validation_command>
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ </custom_php_resync_config_command>
+</packagegui>
diff --git a/config/haproxy-legacy/pkg_haproxy.inc b/config/haproxy-legacy/pkg_haproxy.inc
new file mode 100755
index 00000000..1e5c75c2
--- /dev/null
+++ b/config/haproxy-legacy/pkg_haproxy.inc
@@ -0,0 +1,11 @@
+<?php
+
+global $shortcuts;
+
+$shortcuts['haproxy'] = array();
+$shortcuts['haproxy']['main'] = "haproxy_global.php";
+$shortcuts['haproxy']['log'] = "diag_logs.php";
+$shortcuts['haproxy']['status'] = "status_services.php";
+$shortcuts['haproxy']['service'] = "HAProxy";
+
+?>