Pavel Loginov 2020-12-05 10:55:34 +06:00
parent a278c059f3
commit c6ae39619d
16 changed files with 46 additions and 13 deletions

View File

@ -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
32. Manage OpenVPN3 as client via HAProxy-WI
![alt text](image/haproxy-wi-metrics.png "Merics")
![alt text](https://haproxy-wi.org/inc/images/haproxy-wi-metrics.png "Merics")
# Install
@ -63,7 +63,7 @@ Web interface(user-friendly web GUI, alerting, monitoring and secure) for managi
# OS support
HAProxy-WI was tested on EL7, EL8 and all scripts too. Debian/Ubuntu OS support at 'beta' stage, may work not correct
![alt text](image/haproxy-wi-admin-area.png "Admin area")
![alt text](https://haproxy-wi.org/inc/images/smon_dashboard.png "SMON area")
# 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)
![alt text](image/haproxy-wi-overview.png "Overview page")
![alt text](https://haproxy-wi.org/inc/images/haproxy-wi_overview.png "Overview page")
# 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)
![alt text](image/haproxy-wi-admin-area.png "Admin area")
![alt text](https://haproxy-wi.org/inc/images/haproxy_overview.png "HAProxy server overview page")
![alt text](image/haproxy-wi-logs.png "View logs page")
![alt text](https://haproxy-wi.org/inc/images/add.png "Add proxy page")

View File

@ -24,7 +24,7 @@ try:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
group = cookie.get('group')
user_group = group.value
except:
except Exception:
pass
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"
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:
ip = form.getvalue('ip')
@ -180,14 +183,14 @@ if form.getvalue('mode') is not None:
send_proxy_param = 'send-proxy'
else:
send_proxy_param = ''
except:
except Exception:
send_proxy_param = ''
try:
if backup[i] == '1':
backup_param = 'backup'
else:
backup_param = ''
except:
except Exception:
backup_param = ''
servers_split += " server {0} {0}:{1}{2} {3} {4} \n".format(server,
server_port[i],
@ -242,7 +245,7 @@ if form.getvalue('new_userlist') is not None:
for user in users:
try:
group = ' groups '+userlist_user_group[i]
except:
except Exception:
group = ''
new_users_list += " user "+user+" insecure-password " + passwords[i] + group + "\n"
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('</div>')
except:
except Exception:
pass

View File

@ -106,6 +106,11 @@
<td class="addOption">
{{ select('listener_checks', name='health_check', values=checks, selected='', class='force_close') }}
<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>
</tr>
<tr class="advance">
@ -425,6 +430,11 @@
<td class="addOption">
{{ select('backend_checks', name='health_check', values=checks, selected='', class='force_close') }}
<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>
</tr>
<tr class="advance">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 KiB

View File

@ -989,7 +989,8 @@ $( function() {
});
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 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' +
'<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>'
@ -1027,7 +1028,6 @@ $( function() {
}
});
$( "#backend_checks" ).on('selectmenuchange',function() {
if ($( "#backend_checks option:selected" ).val() == "") {
$("#backend_checks_note").html('')
}
@ -1059,6 +1059,26 @@ $( function() {
$("#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() {
$('[name=port]').val('');