2018-06-28 05:55:07 +00:00
{% extends "base.html" %}
{% block content %}
2019-10-25 07:18:57 +00:00
{% from 'include/input_macros.html' import input, checkbox, select %}
2019-10-05 20:41:07 +00:00
< style >
.container {
margin-right: 0;
}
< / style >
2018-06-28 05:55:07 +00:00
< script src = "/inc/users.js" > < / script >
2019-10-25 07:18:57 +00:00
{% include 'include/del_confirm.html' %}
2018-10-03 10:14:57 +00:00
< input type = "hidden" id = "new-group" name = "new-group" value = "{{ group }}" >
< input type = "hidden" id = "new-server-group-add" name = "new-server-group-add" value = "{{ group }}" >
2020-02-20 20:34:50 +00:00
< input type = "hidden" id = "new-sshgroup" name = "new-sshgroup" value = "{{ group }}" >
2020-08-07 15:14:59 +00:00
{{ input('new-telegram-group-add', type='hidden', value=group) }}
2018-06-28 05:55:07 +00:00
< div id = "tabs" >
< ul >
2020-08-03 13:31:51 +00:00
< li > < a href = "#users" title = "Servers: Manage users - HAProxy-WI" > Users< / a > < / li >
< li > < a href = "#servers" title = "Servers: Manage servers - HAProxy-WI" > Servers< / a > < / li >
< li > < a href = "#ssh" title = "Servers: Manage SSH credentials - HAProxy-WI" > SSH credentials< / a > < / li >
< li > < a href = "#checker" title = "Servers: Manage checker - HAProxy-WI" > Checker< / a > < / li >
2020-08-10 18:32:44 +00:00
< li > < a href = "#settings" title = "Admin area: Manage HAProxy-WI settings - HAProxy-WI" > Settings< / a > < / li >
2020-08-04 16:40:58 +00:00
< li > < a href = "#installproxy" title = "Servers: Proxy service installation - HAProxy-WI" > Proxy installation< / a > < / li >
< li > < a href = "#installmon" title = "Servers: Monitoring service installation - HAProxy-WI" > Monitoring installation< / a > < / li >
< li > < a href = "#backup" title = "Servers: Backup configs - HAProxy-WI" > Backup< / a > < / li >
2019-10-25 07:18:57 +00:00
{% include 'include/login.html' %}
2018-06-28 05:55:07 +00:00
< / ul >
2020-01-12 16:13:48 +00:00
< ul id = 'browse_histroy' > < / ul >
2018-09-28 16:10:01 +00:00
< div id = "users" >
< table class = "overview" id = "ajax-users" >
< tr class = "overviewHead" >
< td class = "padding10 first-collumn" > Login name< / td >
2020-08-07 15:14:59 +00:00
< td style = "width: 10%" > Password< / td >
< td style = "width: 10%" > Active< / td >
< td style = "width: 20%" > Email< / td >
< td style = "width: 100%" > Role< / td >
2018-09-28 16:10:01 +00:00
< td > < / td >
2019-02-04 06:37:41 +00:00
< td > < / td >
2018-09-28 16:10:01 +00:00
< / tr >
< tr >
{% for user in users %}
< tr id = "user-{{user.0}}" class = "{{ loop.cycle('odd', 'even') }}" >
2019-10-25 07:18:57 +00:00
{% include 'include/admin_users.html' %}
2018-09-28 16:10:01 +00:00
< td >
< select id = "role-{{user.0}}" name = "role-{{user.0}}" >
< option disabled selected > Choose role< / option >
{% for role in roles %}
{% if role.1 != "admin" %}
{% if user.4 == role.1 %}
< option value = "{{ role.1 }}" selected > {{ role.1 }}< / option >
{% else %}
< option value = "{{ role.1 }}" > {{ role.1 }}< / option >
{% endif %}
{% endif %}
{% endfor %}
< / select >
< / td >
2019-02-04 06:37:41 +00:00
< td >
< a class = "add" onclick = "cloneUser({{user.0}})" id = "clone-{{user.0}}" title = "Clone {{user.1}}" style = "cursor: pointer;" > < / a >
< / td >
2018-09-28 16:10:01 +00:00
< td >
< a class = "delete" onclick = "confirmDeleteUser({{user.0}})" title = "Delete user {{user.1}}" style = "cursor: pointer;" > < / a >
< / td >
< / tr >
{% endfor %}
< / table >
2018-10-04 04:07:32 +00:00
< br / > < span class = "add-button" title = "Add user" id = "add-user-button" > + Add< / span >
< br / > < br / >
2018-09-28 16:10:01 +00:00
< / div >
2018-06-28 05:55:07 +00:00
< div id = "servers" >
< table class = "overview" id = "ajax-servers" >
< tr class = "overviewHead" >
2020-08-07 15:14:59 +00:00
< th class = "padding10 first-collumn" style = "width: 15%" > Hostname< / th >
< th class = "ip-field" style = "width: 10%" > IP< / th >
< th class = "checkbox-head" style = "width: 5%" >
< span title = "SSH port" > Port< / span >
< / th >
< th class = "checkbox-head" style = "width: 5%" > Enable< / th >
< th class = "checkbox-head" style = "width: 5%" >
< span title = "Virtual IP, something like VRRP" > Virt< / span >
< / th >
< th class = "checkbox-head" style = "width: 5%" > HAProxy< / th >
< th class = "checkbox-head" style = "width: 5%" > Nginx< / th >
< th class = "slave-field" style = "width: 10%" >
< span title = "Actions with master config will automatically apply on slave" > Slave for< / span >
< / th >
< th class = "cred-field" style = "width: 15%" > Credentials< / th >
< th style = "width: 100%" > Description< / th >
< th > < / th >
< th > < / th >
2018-06-28 05:55:07 +00:00
< / tr >
{% set ssh_group = [] %}
{% for server in servers %}
{% do ssh_group.append(server.3) %}
2018-08-05 14:37:14 +00:00
< tr id = "server-{{server.0}}" class = "{{ loop.cycle('odd', 'even') }}" >
2020-08-07 15:14:59 +00:00
< td class = "padding10 first-collumn" style = "width: 15%" >
2020-04-06 16:38:58 +00:00
{% set id = 'hostname-' + server.0|string() %}
{{ input(id, value=server.1, size='10') }}
2018-06-28 05:55:07 +00:00
< / td >
< td >
2020-01-27 15:01:31 +00:00
< span id = "ip-{{server.0}}" style = "margin-right: 6px;" > {{server.2}}< / span >
2018-07-27 06:46:50 +00:00
< input type = "hidden" id = "servergroup-{{server.0}}" name = "servergroup-{{server.0}}" value = "{{ group }}" >
2018-06-28 05:55:07 +00:00
< / td >
2019-10-01 05:35:05 +00:00
< td >
2020-04-06 16:38:58 +00:00
{% set id = 'port-' + server.0|string() %}
{{ input(id, value=server.10, size='2') }}
2018-09-01 10:43:25 +00:00
< / td >
2019-10-25 07:18:57 +00:00
{% include 'include/admin_servers.html' %}
2018-06-28 05:55:07 +00:00
< / tr >
{% endfor %}
< / table >
< br / > < span class = "add-button" title = "Add server" id = "add-server-button" > + Add< / span >
2018-10-03 10:14:57 +00:00
< br / > < br / >
2020-02-21 18:05:21 +00:00
< div id = "checkSshConnect" > < / div >
2019-10-01 05:35:05 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read the description of all parameters < a href = "https://haproxy-wi.org/description.py?description=servers" title = "Servers description" target = "_blank" > here< / a >
2019-10-14 21:23:49 +00:00
or watch video < a href = "https://haproxy-wi.org/description.py?description=setup" title = "How to setup servers, group and SSH credentials" target = "_blank" > here< / a >
2019-10-01 05:35:05 +00:00
< / div >
2018-06-28 05:55:07 +00:00
< / div >
< div id = "ssh" >
< table id = "ssh_enable_table" class = "overview" >
< tr class = "overviewHead" style = "width: 50%;" >
< td class = "padding10 first-collumn" style = "width: 15%;" >
2019-10-02 06:35:34 +00:00
< span title = "It's just name alias. This alias will be userd in 'Servers' page for choose credentials" > Name< / span >
2018-06-28 05:55:07 +00:00
< / td >
< td class = "padding10 first-collumn" style = "width: 25%;" >
2019-10-02 06:35:34 +00:00
< span title = "If enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password" > SSH key< / span >
2018-06-28 05:55:07 +00:00
< / td >
2020-08-07 15:14:59 +00:00
< td style = "width: 100%;" >
2019-10-02 06:35:34 +00:00
< span title = "Enter SSH user name. If SSH key disabled, enter password for ssh user" > Credentials< / span >
2018-06-28 05:55:07 +00:00
< / td >
< td > < / td >
< / tr >
{% for ssh in sshs %}
2018-07-27 06:46:50 +00:00
{% if ssh.5|string() == group %}
2018-08-05 14:37:14 +00:00
< tr style = "width: 50%;" id = "ssh-table-{{ssh.0}}" class = "{{ loop.cycle('odd', 'even') }}" >
2018-06-28 05:55:07 +00:00
< td class = "first-collumn" >
2020-04-06 16:38:58 +00:00
{% set id = 'ssh_name-' + ssh.0|string() %}
{{ input(id, value=ssh.1, size='10') }}
2018-06-28 05:55:07 +00:00
< / td >
< td class = "first-collumn" valign = "top" style = "padding-top: 15px;" >
{% if ssh.2 == 1 %}
< label for = "ssh_enable-{{ssh.0}}" > Enable SSH key< / label > < input type = "checkbox" id = "ssh_enable-{{ssh.0}}" checked >
{% else %}
< label for = "ssh_enable-{{ssh.0}}" > Enable SSH key< / label > < input type = "checkbox" id = "ssh_enable-{{ssh.0}}" >
{% endif %}
< / td >
< td style = "padding-top: 15px;" >
< p >
2020-04-06 16:38:58 +00:00
{% set id = 'ssh_user-' + ssh.0|string() %}
2020-08-07 15:14:59 +00:00
{{ input(id, value=ssh.3, title='SSH user name') }}
2018-06-28 05:55:07 +00:00
< / p >
{% if ssh.2 == 1 %}
2020-08-07 15:14:59 +00:00
< input type = "password" id = "ssh_pass-{{ssh.0}}" class = "form-control" value = "" placeholder = "*****" style = "display: none;" autocomplete = "off" / >
2018-06-28 05:55:07 +00:00
{% else %}
2020-08-07 15:14:59 +00:00
< input type = "password" id = "ssh_pass-{{ssh.0}}" class = "form-control" value = "" placeholder = "*****" autocomplete = "off" / >
2018-06-28 05:55:07 +00:00
{% endif %}
< br >
< / td >
< td >
2020-08-04 16:40:58 +00:00
< a class = "delete" onclick = "confirmDeleteSsh({{ssh.0}})" title = "Delete this SSH credentials" style = "cursor: pointer;" > < / a >
2018-06-28 05:55:07 +00:00
< / td >
< / tr >
{% endif %}
{% endfor %}
< / table >
< br / > < span class = "add-button" title = "Add ssh" id = "add-ssh-button" > + Add< / span >
< br / > < br / >
< table id = "ssh_key" >
< tr class = "overviewHead" style = "width: 50%;" >
< td class = "padding10 first-collumn" style = "width: 25%;" > Upload SSH Key< / td >
< td >
2019-10-02 06:35:34 +00:00
< span title = "Private key. Note: The public key must be pre-installed on all servers to which you plan to connect" > Key< / span >
2018-06-28 05:55:07 +00:00
< / td >
< td > < / td >
< / tr >
< tr style = "width: 50%;" >
< td class = "first-collumn" valign = "top" style = "padding-top: 15px;" >
< select id = "ssh-key-name" >
< option disabled selected > Choose credentials< / option >
{% for ssh in sshs %}
2018-07-27 06:46:50 +00:00
{% if ssh.5|string() == group %}
2018-06-28 05:55:07 +00:00
< option value = {{ssh.1}} > {{ssh.1}}< / option >
{% endif %}
{% endfor %}
< / select >
< / td >
< td style = "padding-top: 15px;" >
< textarea id = "ssh_cert" cols = "50" rows = "5" > < / textarea > < br / > < br / >
2020-08-04 16:40:58 +00:00
< button id = "ssh_key_upload" title = "Upload ssh key" onclick = "uploadSsh()" > Upload< / button >
2018-06-28 05:55:07 +00:00
< / td >
< td > < / td >
< / tr >
< / table >
< div id = "ajax-ssh" > < / div >
2019-10-02 06:35:34 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read the description of all parameters < a href = "https://haproxy-wi.org/description.py?description=creds" title = "Servers description" target = "_blank" > here< / a >
2019-10-14 21:23:49 +00:00
or watch video < a href = "https://haproxy-wi.org/description.py?description=setup" title = "How to setup servers, group and SSH credentials" target = "_blank" > here< / a >
2019-10-02 06:35:34 +00:00
< / div >
2018-06-28 05:55:07 +00:00
< / div >
2018-07-25 05:25:27 +00:00
< div id = "checker" >
< table id = "checker_table" class = "overview" >
< tr class = "overviewHead" style = "width: 50%;" >
< td class = "padding10 first-collumn" style = "width: 25%;" >
2019-10-02 06:35:34 +00:00
< span title = "Token that gave you @father_bot" > Token< / span >
2018-07-25 05:25:27 +00:00
< / td >
2020-08-07 15:14:59 +00:00
< td style = "width: 100%;" > Chanel name< / td >
2018-07-25 05:25:27 +00:00
< td > < / td >
2020-08-04 16:40:58 +00:00
< td > < / td >
2018-07-25 05:25:27 +00:00
< / tr >
{% for telegram in telegrams %}
2018-07-27 06:46:50 +00:00
{% if telegram.3|string() == group %}
2018-08-05 14:37:14 +00:00
< tr style = "width: 50%;" id = "telegram-table-{{telegram.0}}" class = "{{ loop.cycle('odd', 'even') }}" >
2020-08-04 16:40:58 +00:00
< td class = "padding10 first-collumn" >
2020-04-06 16:38:58 +00:00
{% set id = 'telegram-token-' + telegram.0|string() %}
2020-08-07 15:14:59 +00:00
{{ input(id, value=telegram.1, size='30') }}
2018-07-25 05:25:27 +00:00
< / td >
< td >
2020-04-06 16:38:58 +00:00
{% set id = 'telegram-chanel-' + telegram.0|string() %}
{{ input(id, value=telegram.2) }}
2018-07-25 05:25:27 +00:00
< / td >
2020-08-04 16:40:58 +00:00
< td >
< a class = "add" onclick = "cloneTelegram({{telegram.0}})" id = "clone-{{telegram.0}}" title = "Clone {{telegram.2}}" style = "cursor: pointer;" > < / a >
< / td >
2018-07-25 05:25:27 +00:00
< td >
2018-09-28 10:35:44 +00:00
< a class = "delete" onclick = "confirmDeleteSsh({{telegram.0}})" style = "cursor: pointer;" > < / a >
2018-07-25 05:25:27 +00:00
< / td >
< / tr >
{% endif %}
{% endfor %}
< / table >
< br / > < span class = "add-button" title = "Telegram channel" id = "add-telegram-button" > + Add< / span >
< br / > < br / >
< div id = "ajax-telegram" > < / div >
2019-10-02 06:35:34 +00:00
< div class = "add-note addName alert-info" style = "width: inherit; margin-right: 15px;" >
You can read the description of all parameters < a href = "https://haproxy-wi.org/description.py?description=checker" title = "Servers description" target = "_blank" > here< / a >
< / div >
2018-07-25 05:25:27 +00:00
< / div >
2020-08-10 18:32:44 +00:00
< div id = "settings" >
{% include 'include/admin_settings.html' %}
< / div >
2020-06-01 16:13:28 +00:00
< div id = "installproxy" >
2019-10-21 06:00:16 +00:00
< table class = "overview" >
2020-02-05 08:15:57 +00:00
< caption > < h3 > Install HAProxy< / h3 > < / caption >
2019-10-21 06:00:16 +00:00
< tr class = "overviewHead" >
2019-11-28 16:39:24 +00:00
< td class = "padding10 first-collumn" > Current version< / td >
2020-03-27 21:16:04 +00:00
< td class = "padding10 first-collumn" style = "width: 30%;" > Available Versions< / td >
< td class = "padding10 first-collumn" style = "width: 30%;" > Server< / td >
2019-10-21 06:00:16 +00:00
< td > SYN flood protect< / td >
< td > < / td >
< / tr >
< tr >
2019-11-28 16:39:24 +00:00
< td id = "cur_hap_ver" class = "padding10 first-collumn" >
< / td >
2019-10-21 06:00:16 +00:00
< td class = "padding10 first-collumn" style = "width: 20%;" >
2019-10-25 07:18:57 +00:00
{% set values = dict() %}
2020-05-11 16:41:54 +00:00
{% set values = {'2.0.5-1':'2.0.5-1','2.0.6-1':'2.0.6-1', '2.0.7-1':'2.0.7-1', '2.0.9-1':'2.0.9-1', '2.0.11-1':'2.0.11-1', '2.0.12-1':'2.0.12-1', '2.0.13-1':'2.0.13-1', '2.0.14-1':'2.0.14-1'} %}
{{ select('hapver', values=values, selected='2.0.14-1', required='required') }}
2019-10-21 06:00:16 +00:00
< / td >
< td class = "padding10 first-collumn" >
< select autofocus required name = "haproxyaddserv" id = "haproxyaddserv" >
< option disabled selected > Choose server< / option >
{% for select in servers %}
< option value = "{{ select.2 }}" > {{ select.1 }}< / option >
{% endfor %}
< / select >
< / td >
< td >
2019-10-25 07:18:57 +00:00
{{ checkbox('syn_flood', title="Enable SYN flood protect", checked='checked') }}
2019-10-21 06:00:16 +00:00
< / td >
< td >
2020-08-04 16:40:58 +00:00
< span class = "ui-button ui-widget ui-corner-all" id = "install" title = "Install HAProxy" > Install< / span >
2019-10-21 06:00:16 +00:00
< / td >
< / tr >
< / table >
2020-02-05 08:15:57 +00:00
< table >
< caption > < h3 > Install Nginx< / h3 > < / caption >
< tr class = "overviewHead" >
< td class = "padding10 first-collumn" > Current version< / td >
2020-03-27 21:16:04 +00:00
< td class = "padding10 first-collumn" style = "width: 30%;" > Available Versions< / td >
< td class = "padding10 first-collumn" style = "width: 30%;" > Server< / td >
2020-02-05 08:15:57 +00:00
< td > SYN flood protect< / td >
< td > < / td >
< / tr >
< tr >
< td id = "cur_nginx_ver" class = "padding10 first-collumn" >
< / td >
< td class = "padding10 first-collumn" style = "width: 20%;" >
HAProxy-WI will try to install the latest Nginx version from official Nginx repository
< / td >
< td class = "padding10 first-collumn" >
< select autofocus required name = "nginxaddserv" id = "nginxaddserv" >
< option disabled selected > Choose server< / option >
{% for select in servers %}
< option value = "{{ select.2 }}" > {{ select.1 }}< / option >
{% endfor %}
< / select >
< / td >
< td >
{{ checkbox('nginx_syn_flood', title="Enable SYN flood protect", checked='checked') }}
< / td >
< td >
2020-08-04 16:40:58 +00:00
< span class = "ui-button ui-widget ui-corner-all" id = "nginx_install" title = "Install Nginx" > Install< / span >
2020-02-05 08:15:57 +00:00
< / td >
< / tr >
< / table >
2020-06-01 16:13:28 +00:00
< div id = "ajax" > < / div >
< / div >
2020-08-08 20:54:53 +00:00
2020-06-01 16:13:28 +00:00
< div id = "installmon" >
2020-08-08 20:54:53 +00:00
{% include 'include/mon_installation.html' %}
2019-10-21 06:00:16 +00:00
< / div >
2020-08-08 06:26:43 +00:00
2020-01-11 21:16:27 +00:00
< div id = "backup" >
2020-08-08 06:26:43 +00:00
{% include 'include/admin_backup.html' %}
2020-01-11 21:16:27 +00:00
< / div >
2018-06-28 05:55:07 +00:00
< / div >
2018-07-27 06:46:50 +00:00
< div id = "group_error" style = "display: none;" >
< div class = "alert alert-danger" >
2018-08-01 08:06:09 +00:00
< b > Do not edit this section if your group is "ALL"!< / b > Add first< a href = "users.py#groups" title = "Admin Area: Groups" > group< / a > or edit your own group at< a href = "users.py#users" title = "Admin Area: Users" > users< / a > page
2018-07-27 06:46:50 +00:00
< / div >
< / div >
2020-08-07 15:14:59 +00:00
{% include 'include/admins_dialogs.html' %}
2019-10-25 07:18:57 +00:00
{% include 'include/change_pass_form.html' %}
2018-07-27 06:46:50 +00:00
< script >
if($('#new-server-group-add').val() == 1) {
$('#group_error').css('display', 'block');
2018-10-03 10:14:57 +00:00
$('#add-user-button').css('display', 'none');
2018-07-27 06:46:50 +00:00
$('#add-server-button').css('display', 'none');
2019-10-04 16:58:47 +00:00
$('.passwordChange').css('display', 'none');
$('.add').css('display', 'none');
2018-07-27 06:46:50 +00:00
$('#add-ssh-button').css('display', 'none');
$('#ssh_key_upload').css('display', 'none');
$('#add-telegram-button').css('display', 'none');
2018-07-30 03:09:26 +00:00
$('input').css('color', 'rgba(0, 0, 0, 0.3)');
2018-07-27 06:46:50 +00:00
setTimeout(function() {
$("input[type=checkbox]").checkboxradio( "disable" );
$("select").selectmenu( "disable" );
2018-10-01 16:51:37 +00:00
$("button").button( "disable" );
2018-07-27 06:46:50 +00:00
$("input").attr( "readonly", "readonly" );
2018-09-28 10:35:44 +00:00
$('.delete').remove()
2019-10-21 06:00:16 +00:00
$('#hapver').selectmenu('enable');
$('#haproxyaddserv').selectmenu('enable');
2020-02-05 08:15:57 +00:00
$('#nginxaddserv').selectmenu('enable');
2020-03-27 21:16:04 +00:00
$('#haproxy_exp_addserv').selectmenu('enable');
$('#nginx_exp_addserv').selectmenu('enable');
2019-10-21 06:00:16 +00:00
$('#syn_flood').checkboxradio('enable');
2020-02-05 08:15:57 +00:00
$('#nginx_syn_flood').checkboxradio('enable');
2018-07-27 06:46:50 +00:00
}, 500 );
}
2019-10-01 05:35:05 +00:00
$( function() {
{% for user in users %}
$("#role-{{user.0}}" ).selectmenu({
width: 100
});
{% endfor %}
{% for server in servers %}
$("#slavefor-{{server.0}}" ).selectmenu({
width: 130
});
$("#credentials-{{server.0}}" ).selectmenu({
width: 150
});
{% endfor %}
2020-01-11 21:16:27 +00:00
{% for ssh in sshs %}
$("#sshgroup-{{ ssh.0}}" ).selectmenu({
width: 150
});
{% endfor %}
2019-10-01 05:35:05 +00:00
});
2018-07-27 06:46:50 +00:00
< / script >
2018-09-28 10:35:44 +00:00
< style >
.ui-selectmenu-button.ui-button {
2018-10-03 10:14:57 +00:00
width: 10em;
}
.checkbox {
width: 90px;
}
2018-09-28 10:35:44 +00:00
< / style >
2019-12-04 13:38:07 +00:00
{% endblock %}