10
README.md
|
@ -48,7 +48,7 @@ Web interface(user-friendly web GUI, alerting, monitoring and secure) for managi
|
||||||
31. Backup HAProxy, Nginx and Keepalived config files through HAProxy-WI
|
31. Backup HAProxy, Nginx and Keepalived config files through HAProxy-WI
|
||||||
32. Manage OpenVPN3 as client via HAProxy-WI
|
32. Manage OpenVPN3 as client via HAProxy-WI
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ Web interface(user-friendly web GUI, alerting, monitoring and secure) for managi
|
||||||
# OS support
|
# OS support
|
||||||
HAProxy-WI was tested on EL7, EL8 and all scripts too. Debian/Ubuntu OS support at 'beta' stage, may work not correct
|
HAProxy-WI was tested on EL7, EL8 and all scripts too. Debian/Ubuntu OS support at 'beta' stage, may work not correct
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Database support
|
# Database support
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ Default HAProxy-WI use Sqlite, if you want use MySQL enable in config, and creat
|
||||||
|
|
||||||
### Read instruction on the official [site](https://haproxy-wi.org/settings.py#db_settings)
|
### Read instruction on the official [site](https://haproxy-wi.org/settings.py#db_settings)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
|
|
||||||
|
@ -82,10 +82,10 @@ Login https://haproxy-wi-server/users.py, and add: users, groups and servers. De
|
||||||
|
|
||||||
### Read instruction on the official [site](https://haproxy-wi.org/settings.py)
|
### Read instruction on the official [site](https://haproxy-wi.org/settings.py)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
15
app/add.py
|
@ -24,7 +24,7 @@ try:
|
||||||
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||||
group = cookie.get('group')
|
group = cookie.get('group')
|
||||||
user_group = group.value
|
user_group = group.value
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
dir = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')
|
dir = os.path.dirname(os.getcwd())+"/"+sql.get_setting('lists_path')
|
||||||
|
@ -77,7 +77,10 @@ if form.getvalue('mode') is not None:
|
||||||
balance = " balance " + form.getvalue('balance') + "\n"
|
balance = " balance " + form.getvalue('balance') + "\n"
|
||||||
|
|
||||||
if form.getvalue('health_check') is not None:
|
if form.getvalue('health_check') is not None:
|
||||||
balance += " " + form.getvalue('health_check') + "\n"
|
health_check = form.getvalue('health_check')
|
||||||
|
if health_check == 'option httpchk' and form.getvalue('checks_http_domain') is not None:
|
||||||
|
health_check = health_check + ' GET ' + form.getvalue('checks_http_path') + ' "HTTP/1.0\\r\\nHost: ' + form.getvalue('checks_http_domain') + '"'
|
||||||
|
balance += " " + health_check + "\n"
|
||||||
|
|
||||||
if form.getvalue('ip') is not None:
|
if form.getvalue('ip') is not None:
|
||||||
ip = form.getvalue('ip')
|
ip = form.getvalue('ip')
|
||||||
|
@ -180,14 +183,14 @@ if form.getvalue('mode') is not None:
|
||||||
send_proxy_param = 'send-proxy'
|
send_proxy_param = 'send-proxy'
|
||||||
else:
|
else:
|
||||||
send_proxy_param = ''
|
send_proxy_param = ''
|
||||||
except:
|
except Exception:
|
||||||
send_proxy_param = ''
|
send_proxy_param = ''
|
||||||
try:
|
try:
|
||||||
if backup[i] == '1':
|
if backup[i] == '1':
|
||||||
backup_param = 'backup'
|
backup_param = 'backup'
|
||||||
else:
|
else:
|
||||||
backup_param = ''
|
backup_param = ''
|
||||||
except:
|
except Exception:
|
||||||
backup_param = ''
|
backup_param = ''
|
||||||
servers_split += " server {0} {0}:{1}{2} {3} {4} \n".format(server,
|
servers_split += " server {0} {0}:{1}{2} {3} {4} \n".format(server,
|
||||||
server_port[i],
|
server_port[i],
|
||||||
|
@ -242,7 +245,7 @@ if form.getvalue('new_userlist') is not None:
|
||||||
for user in users:
|
for user in users:
|
||||||
try:
|
try:
|
||||||
group = ' groups '+userlist_user_group[i]
|
group = ' groups '+userlist_user_group[i]
|
||||||
except:
|
except Exception:
|
||||||
group = ''
|
group = ''
|
||||||
new_users_list += " user "+user+" insecure-password " + passwords[i] + group + "\n"
|
new_users_list += " user "+user+" insecure-password " + passwords[i] + group + "\n"
|
||||||
i += 1
|
i += 1
|
||||||
|
@ -277,5 +280,5 @@ try:
|
||||||
print('<meta http-equiv="refresh" content="0; url=add.py?add=%s&conf=%s&serv=%s">' % (name, config_add, serv))
|
print('<meta http-equiv="refresh" content="0; url=add.py?add=%s&conf=%s&serv=%s">' % (name, config_add, serv))
|
||||||
|
|
||||||
print('</div>')
|
print('</div>')
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -106,6 +106,11 @@
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
{{ select('listener_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
{{ select('listener_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
||||||
<span id="listener_checks_note" class="tooltip tooltipTop"></span>
|
<span id="listener_checks_note" class="tooltip tooltipTop"></span>
|
||||||
|
<br />
|
||||||
|
<span id="listener_checks_http" style="display: none;">
|
||||||
|
URI path for checking: {{ input('listener_checks_http_path', name='checks_http_path', value='/', title="URI for checking e.g. /check") }}
|
||||||
|
Domain name: {{ input('listener_checks_http_domain', name='checks_http_domain', placeholder='domain.com', title="Domain name for checking e.g. domain.com") }}
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="advance">
|
<tr class="advance">
|
||||||
|
@ -425,6 +430,11 @@
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
{{ select('backend_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
{{ select('backend_checks', name='health_check', values=checks, selected='', class='force_close') }}
|
||||||
<span id="backend_checks_note" class="tooltip tooltipTop"></span>
|
<span id="backend_checks_note" class="tooltip tooltipTop"></span>
|
||||||
|
<br />
|
||||||
|
<span id="backend_checks_http" style="display: none;">
|
||||||
|
URI path for checking: {{ input('backend_checks_http_path', name='checks_http_path', value='/', title="URI for checking e.g. /check") }}
|
||||||
|
Domain name: {{ input('backend_checks_http_domain', name='checks_http_domain', placeholder='domain.com', title="Domain name for checking e.g. domain.com") }}
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="advance">
|
<tr class="advance">
|
||||||
|
|
Before Width: | Height: | Size: 401 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 294 KiB |
Before Width: | Height: | Size: 287 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 340 KiB |
Before Width: | Height: | Size: 173 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 344 KiB |
Before Width: | Height: | Size: 477 KiB |
24
inc/add.js
|
@ -989,7 +989,8 @@ $( function() {
|
||||||
});
|
});
|
||||||
var tcp_note = 'The check is valid when the server answers with a <b>SYN/ACK</b> packet'
|
var tcp_note = 'The check is valid when the server answers with a <b>SYN/ACK</b> packet'
|
||||||
var ssl_note = 'The check is valid if the server answers with a valid SSL server <b>hello</b> message'
|
var ssl_note = 'The check is valid if the server answers with a valid SSL server <b>hello</b> message'
|
||||||
var httpchk_note = 'The check is valid if the server answers with a status code of <b>2xx</b> or <b>3xx</b>'
|
var httpchk_note = 'The check is valid if the server answers with a status code of <b>2xx</b> or <b>3xx</b>. You can ' +
|
||||||
|
'add a page for checking and Domain name'
|
||||||
var ldap_note = 'The check is valid if the server response contains a successful <b>resultCode</b>.\n' +
|
var ldap_note = 'The check is valid if the server response contains a successful <b>resultCode</b>.\n' +
|
||||||
'<p>You must configure the LDAP servers according to this check to allow anonymous binding. ' +
|
'<p>You must configure the LDAP servers according to this check to allow anonymous binding. ' +
|
||||||
'You can do this with an IP alias on the server side that allows only HAProxy IP addresses to bind to it.</p>'
|
'You can do this with an IP alias on the server side that allows only HAProxy IP addresses to bind to it.</p>'
|
||||||
|
@ -1027,7 +1028,6 @@ $( function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$( "#backend_checks" ).on('selectmenuchange',function() {
|
$( "#backend_checks" ).on('selectmenuchange',function() {
|
||||||
|
|
||||||
if ($( "#backend_checks option:selected" ).val() == "") {
|
if ($( "#backend_checks option:selected" ).val() == "") {
|
||||||
$("#backend_checks_note").html('')
|
$("#backend_checks_note").html('')
|
||||||
}
|
}
|
||||||
|
@ -1059,6 +1059,26 @@ $( function() {
|
||||||
$("#backend_checks_note").html('')
|
$("#backend_checks_note").html('')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$( "#listener_checks" ).on('selectmenuchange',function() {
|
||||||
|
if ($("#listener_checks").val() == 'option httpchk') {
|
||||||
|
$("#listener_checks_http").show();
|
||||||
|
$("#listener_checks_http_path").attr('required', 'true');
|
||||||
|
} else {
|
||||||
|
$("#listener_checks_http").hide();
|
||||||
|
$("#listener_checks_http_path").removeAttr('required');
|
||||||
|
$("#listener_checks_http_domain").removeAttr('required');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$( "#backend_checks" ).on('selectmenuchange',function() {
|
||||||
|
if ($("#backend_checks").val() == 'option httpchk') {
|
||||||
|
$("#backend_checks_http").show();
|
||||||
|
$("#backend_checks_http_path").attr('required', 'true');
|
||||||
|
} else {
|
||||||
|
$("#backend_checks_http").hide();
|
||||||
|
$("#backend_checks_http_path").removeAttr('required');
|
||||||
|
$("#backend_checks_http_domain").removeAttr('required');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
function resetProxySettings() {
|
function resetProxySettings() {
|
||||||
$('[name=port]').val('');
|
$('[name=port]').val('');
|
||||||
|
|