mirror of https://github.com/Aidaho12/haproxy-wi
parent
d975d3cd10
commit
d1e931d8d1
|
@ -866,7 +866,7 @@ def open_port_firewalld(cfg, serv, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
firewalld_commands += 'sudo firewall-cmd --reload -q'
|
firewalld_commands += 'sudo firewall-cmd --reload -q'
|
||||||
logging(serv, ' Next ports have been opened: ' + ports + ' has opened ')
|
logging(serv, ' Next ports have been opened: ' + ports)
|
||||||
return firewalld_commands
|
return firewalld_commands
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,3 +59,39 @@
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
with_items: [ "3000", "9090" ]
|
with_items: [ "3000", "9090" ]
|
||||||
|
|
||||||
|
- name: Ensure group "grafana" exists
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: grafana
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add the Grafana user
|
||||||
|
user:
|
||||||
|
name: grafana
|
||||||
|
shell: /sbin/nologin
|
||||||
|
groups: grafana
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
- name: Create a directory if it does not exist
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
owner: grafana
|
||||||
|
with_items:
|
||||||
|
- /var/lib/grafana
|
||||||
|
- /var/log/grafana
|
||||||
|
- /etc/grafana
|
||||||
|
|
||||||
|
- name: Create grafana.ini
|
||||||
|
file:
|
||||||
|
path: /etc/grafana/grafana.ini
|
||||||
|
owner: grafana
|
||||||
|
group: grafana
|
||||||
|
mode: '0644'
|
||||||
|
state: touch
|
||||||
|
|
||||||
|
- name: Restart service Grafana, in all cases
|
||||||
|
service:
|
||||||
|
name: grafana-server
|
||||||
|
state: restarted
|
32
app/sql.py
32
app/sql.py
|
@ -553,16 +553,11 @@ def delete_uuid(uuid):
|
||||||
|
|
||||||
|
|
||||||
def delete_old_uuid():
|
def delete_old_uuid():
|
||||||
cursor = conn.cursor()
|
query = UUID.delete().where((UUID.exp < funct.get_data('regular')) | (UUID.exp.is_null(True)) )
|
||||||
if mysql_enable == '1':
|
query1 = Token.delete().where((Token.exp < funct.get_data('regular')) | (Token.exp.is_null(True)) )
|
||||||
sql = """ delete from uuid where exp < now() or exp is NULL """
|
|
||||||
sql1 = """ delete from token where exp < now() or exp is NULL """
|
|
||||||
else:
|
|
||||||
sql = """ delete from uuid where exp < datetime('now') or exp is NULL"""
|
|
||||||
sql1 = """ delete from token where exp < datetime('now') or exp is NULL"""
|
|
||||||
try:
|
try:
|
||||||
cursor.execute(sql)
|
query.execute()
|
||||||
cursor.execute(sql1)
|
query1.execute()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
funct.out_error(e)
|
funct.out_error(e)
|
||||||
|
|
||||||
|
@ -1110,25 +1105,28 @@ def select_waf_servers_metrics_for_master():
|
||||||
|
|
||||||
|
|
||||||
def select_waf_servers_metrics(uuid):
|
def select_waf_servers_metrics(uuid):
|
||||||
cursor = conn.cursor()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user_group = User.get(User.username == get_user_name_by_uuid(uuid))
|
user_group = User.get(User.username == get_user_name_by_uuid(uuid))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
funct.out_error(e)
|
funct.out_error(e)
|
||||||
else:
|
else:
|
||||||
if user_group.groups == '1':
|
if user_group.groups == '1':
|
||||||
sql = """ select servers.ip from servers left join waf as waf on waf.server_id = servers.id
|
query = Waf.select(Server.ip).join(Server, on=(Waf.server_id == Server.server_id)).where(
|
||||||
where servers.enable = 1 and waf.metrics = '1' """
|
(Server.enable == 1) &
|
||||||
|
(Waf.metrics == 1)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
sql = """ select servers.ip from servers left join waf as waf on waf.server_id = servers.id
|
query = Waf.select(Server.ip).join(Server, on=(Waf.server_id == Server.server_id)).where(
|
||||||
where servers.enable = 1 and waf.metrics = '1' and servers.groups like '%{group}%' """.format(group=user_group.groups)
|
(Server.enable == 1) &
|
||||||
|
(Waf.metrics == 1) &
|
||||||
|
(Server.groups == user_group.groups)
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
cursor.execute(sql)
|
query_res = query.execute()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
funct.out_error(e)
|
funct.out_error(e)
|
||||||
else:
|
else:
|
||||||
return cursor.fetchall()
|
return query_res
|
||||||
|
|
||||||
|
|
||||||
def select_waf_metrics(serv, **kwargs):
|
def select_waf_metrics(serv, **kwargs):
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
'rdp-cookie':'rdp-cookie', 'uri':'uri', 'uri whole':'uri whole', 'static-rr': 'static-rr',
|
'rdp-cookie':'rdp-cookie', 'uri':'uri', 'uri whole':'uri whole', 'static-rr': 'static-rr',
|
||||||
'url_param userid':'url_param userid'} %}
|
'url_param userid':'url_param userid'} %}
|
||||||
{% set checks = dict() %}
|
{% set checks = dict() %}
|
||||||
{% set checks = {'':'Choose custom health check','option tcp-check':'Check a TCP Port',
|
{% set checks = {'':'Choose a custom health check','option tcp-check':'Check a TCP Port',
|
||||||
'option ssl-hello-chk':'Check a SSL Port','option httpchk':'Check a HTTP service',
|
'option ssl-hello-chk':'Check a SSL Port','option httpchk':'Check a HTTP service',
|
||||||
'option ldap-check':'Check a LDAP service', 'option mysql-check':'Check a MySql Service',
|
'option ldap-check':'Check a LDAP service', 'option mysql-check':'Check a MySql Service',
|
||||||
'option pgsql-check':'Check a PgSQL Service', 'option redis-check': 'Check a Redis Service',
|
'option pgsql-check':'Check a PgSQL Service', 'option redis-check': 'Check a Redis Service',
|
||||||
|
@ -40,15 +40,15 @@
|
||||||
<table class="add-table">
|
<table class="add-table">
|
||||||
<caption><h3>Add listen</h3></caption>
|
<caption><h3>Add listen</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select a server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="serv">
|
<select required name="serv" id="serv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will re-configured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="5" class="add-note addName alert-info">
|
<td rowspan="5" class="add-note addName alert-info">
|
||||||
A "listen" section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.
|
A "listen" section defines a complete proxy with its frontend and backend parts combined in one section. It is generally useful for TCP-only traffic.
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
{{ input('ip', placeholder="Any", size='15') }}<b>:</b>
|
{{ input('ip', placeholder="Any", size='15') }}<b>:</b>
|
||||||
{{ input('listen-port', name='port', type="number", title="Port for bind listen", placeholder="8080", size='5', required='required') }}
|
{{ input('listen-port', name='port', type="number", title="Port for bind listen", placeholder="8080", size='5', required='required') }}
|
||||||
<div class="tooltip tooltipTop">
|
<div class="tooltip tooltipTop">
|
||||||
The IP address for the bind listener, <b>if empty, will be assigned to all IP addresses</b>. <br />
|
If the IP-address for the listener is empty, it will listen on all IP addresses. <br />
|
||||||
Start typing IP or press down button. If you are using <b>VRRP, leave the IP field blank</b>. If you assign a VRRP IP, the slave server will not start
|
Start typing IP or press down button. If you are using <b>VRRP, leave the IP field blank</b>. If you assign a VRRP IP, the slave server will not start
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -289,15 +289,15 @@
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add frontend</h3></caption>
|
<caption><h3>Add frontend</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select a server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="serv2">
|
<select required name="serv" id="serv2">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will re-configured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="5" class="add-note addName alert-info">
|
<td rowspan="5" class="add-note addName alert-info">
|
||||||
A "frontend" section describes a set of listening sockets accepting client connections.
|
A "frontend" section describes a set of listening sockets accepting client connections.
|
||||||
|
@ -322,7 +322,7 @@
|
||||||
<input type="text" name="ip" id="ip1" size="15" placeholder="Any" class="form-control"><b>:</b>
|
<input type="text" name="ip" id="ip1" size="15" placeholder="Any" class="form-control"><b>:</b>
|
||||||
<input type="number" name="port" required title="Port for bind frontend" placeholder="8080" class="form-control">
|
<input type="number" name="port" required title="Port for bind frontend" placeholder="8080" class="form-control">
|
||||||
<div class="tooltip tooltipTop">
|
<div class="tooltip tooltipTop">
|
||||||
The IP address for the bind listener, <b>if empty, will be assigned to all IP addresses</b>. <br />
|
If the IP-address for the frontend is empty, it will listen on all IP addresses. <br />
|
||||||
Start typing IP or press down button. If you are using <b>VRRP, leave the IP field blank</b>. If you assign a VRRP IP, the slave server will not start
|
Start typing IP or press down button. If you are using <b>VRRP, leave the IP field blank</b>. If you assign a VRRP IP, the slave server will not start
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -465,15 +465,15 @@
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add backend</h3></caption>
|
<caption><h3>Add backend</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select a server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="serv3">
|
<select required name="serv" id="serv3">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will reconfigured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure the master server, the slave server will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="4" class="add-note addName alert-info">
|
<td rowspan="4" class="add-note addName alert-info">
|
||||||
A "backend" section describes a set of servers to which the proxy will connect to forward incoming connections.
|
A "backend" section describes a set of servers to which the proxy will connect to forward incoming connections.
|
||||||
|
@ -678,7 +678,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select required name="serv" id="serv5">
|
<select required name="serv" id="serv5">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -701,7 +701,7 @@
|
||||||
<tr style="width: 50%;">
|
<tr style="width: 50%;">
|
||||||
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
||||||
<select required id="serv4">
|
<select required id="serv4">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -733,7 +733,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select required id="serv_for_lets">
|
<select required id="serv_for_lets">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -866,15 +866,15 @@
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Add Userlist</h3></caption>
|
<caption><h3>Add Userlist</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select a server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="userlist_serv">
|
<select required name="serv" id="userlist_serv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="4" class="add-note addName alert-info">
|
<td rowspan="4" class="add-note addName alert-info">
|
||||||
It is possible to control access to frontend/backend/listen sections or to
|
It is possible to control access to frontend/backend/listen sections or to
|
||||||
|
@ -928,15 +928,15 @@
|
||||||
<table>
|
<table>
|
||||||
<caption><h3>Existing UserList</h3></caption>
|
<caption><h3>Existing UserList</h3></caption>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select a server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="existing_userlist_serv">
|
<select required name="serv" id="existing_userlist_serv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="ui-button ui-widget ui-corner-all" title="Add Userlist" onclick="showUserlists()">Show Userlist</a>
|
<a class="ui-button ui-widget ui-corner-all" title="Add Userlist" onclick="showUserlists()">Show Userlist</a>
|
||||||
|
@ -965,12 +965,12 @@
|
||||||
<td class="addName">Select server: </td>
|
<td class="addName">Select server: </td>
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
<select required name="serv" id="peers_serv">
|
<select required name="serv" id="peers_serv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<div class="tooltip tooltipTop"><b>Note:</b> If you reconfigure Master server, Slave will reconfigured automatically</div>
|
<div class="tooltip tooltipTop"><b>Note:</b> If you re-configure Master server, Slave will be re-configured automatically</div>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="4" class="add-note addName alert-info">
|
<td rowspan="4" class="add-note addName alert-info">
|
||||||
The peers section enables the replication of stick table data between two or more HAProxy instances.
|
The peers section enables the replication of stick table data between two or more HAProxy instances.
|
||||||
|
@ -1038,7 +1038,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select required name="serv-black-list" id="serv-black-list">
|
<select required name="serv-black-list" id="serv-black-list">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
<option value="all">ALL</option>
|
<option value="all">ALL</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
|
@ -1067,7 +1067,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select required name="serv-white-list" id="serv-white-list">
|
<select required name="serv-white-list" id="serv-white-list">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
<option value="all">ALL</option>
|
<option value="all">ALL</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding20" style="width: 40%;">
|
<td class="padding20" style="width: 40%;">
|
||||||
Choose server for backup
|
Select a server for backup
|
||||||
<span class="need-field">*</span>
|
<span class="need-field">*</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select autofocus required name="backup-server" id="backup-server">
|
<select autofocus required name="backup-server" id="backup-server">
|
||||||
<option disabled>Choose server</option>
|
<option disabled>------</option>
|
||||||
{% for s in servers %}}
|
{% for s in servers %}}
|
||||||
<option value="{{ s.2 }}">{{ s.1 }}</option>
|
<option value="{{ s.2 }}">{{ s.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="haproxy_exp_addserv" id="haproxy_exp_addserv">
|
<select autofocus required name="haproxy_exp_addserv" id="haproxy_exp_addserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="nginx_exp_addserv" id="nginx_exp_addserv">
|
<select autofocus required name="nginx_exp_addserv" id="nginx_exp_addserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="node_exp_addserv" id="node_exp_addserv">
|
<select autofocus required name="node_exp_addserv" id="node_exp_addserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<select autofocus required name="serv" id="{{ select_id }}">
|
<select autofocus required name="serv" id="{{ select_id }}">
|
||||||
<option disabled>Choose server</option>
|
<option disabled>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
{% if select.2 == serv %}
|
{% if select.2 == serv %}
|
||||||
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="nettools_icmp_server_from" id="nettools_icmp_server_from">
|
<select autofocus required name="nettools_icmp_server_from" id="nettools_icmp_server_from">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
<option value="localhost">Roxy-WI</option>
|
<option value="localhost">Roxy-WI</option>
|
||||||
{% for server in servers %}
|
{% for server in servers %}
|
||||||
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="nettools_telnet_server_from" id="nettools_telnet_server_from">
|
<select autofocus required name="nettools_telnet_server_from" id="nettools_telnet_server_from">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
<option value="localhost">Roxy-WI</option>
|
<option value="localhost">Roxy-WI</option>
|
||||||
{% for server in servers %}
|
{% for server in servers %}
|
||||||
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="nettools_nslookup_server_from" id="nettools_nslookup_server_from">
|
<select autofocus required name="nettools_nslookup_server_from" id="nettools_nslookup_server_from">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
<option value="localhost">Roxy-WI</option>
|
<option value="localhost">Roxy-WI</option>
|
||||||
{% for server in servers %}
|
{% for server in servers %}
|
||||||
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
<option value="{{ server.2 }}">{{ server.1 }}</option>
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
$( "#nettools_telnet_form" ).on("click", ":submit", function(e){
|
$( "#nettools_telnet_form" ).on("click", ":submit", function(e){
|
||||||
$('#ajax-nettools').html('');
|
$('#ajax-nettools').html('');
|
||||||
var frm = $('#nettools_telnet_form');
|
var frm = $('#nettools_telnet_form');
|
||||||
if($('#nettools_telnet_server_from option:selected').val() == 'Choose server') {
|
if($('#nettools_telnet_server_from option:selected').val() == '------') {
|
||||||
toastr.warning('Choose a server From');
|
toastr.warning('Choose a server From');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
$( "#nettools_nslookup_form" ).on("click", ":submit", function(e){
|
$( "#nettools_nslookup_form" ).on("click", ":submit", function(e){
|
||||||
$('#ajax-nettools').html('');
|
$('#ajax-nettools').html('');
|
||||||
var frm = $('#nettools_nslookup_form');
|
var frm = $('#nettools_nslookup_form');
|
||||||
if($('#nettools_nslookup_server_from option:selected').val() == 'Choose server') {
|
if($('#nettools_nslookup_server_from option:selected').val() == '------') {
|
||||||
toastr.warning('Choose a server From');
|
toastr.warning('Choose a server From');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@
|
||||||
$( "#nettools_icmp_form" ).on("click", ":submit", function(e){
|
$( "#nettools_icmp_form" ).on("click", ":submit", function(e){
|
||||||
$('#ajax-nettools').html('');
|
$('#ajax-nettools').html('');
|
||||||
var frm = $('#nettools_icmp_form');
|
var frm = $('#nettools_icmp_form');
|
||||||
if($('#nettools_icmp_server_from option:selected').val() == 'Choose server') {
|
if($('#nettools_icmp_server_from option:selected').val() == '------') {
|
||||||
toastr.warning('Choose a server From');
|
toastr.warning('Choose a server From');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="" method="post" id="maxconnform">
|
<form action="" method="post" id="maxconnform">
|
||||||
<select autofocus required name="serv" id="maxconn_select">
|
<select autofocus required name="serv" id="maxconn_select">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="" method="post" id="runtimeapiip">
|
<form action="" method="post" id="runtimeapiip">
|
||||||
<select autofocus required name="ip_select" id="ip_select">
|
<select autofocus required name="ip_select" id="ip_select">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -171,7 +171,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="" method="post" id="runtimeapitable">
|
<form action="" method="post" id="runtimeapitable">
|
||||||
<select autofocus required name="table_serv_select" id="table_serv_select">
|
<select autofocus required name="table_serv_select" id="table_serv_select">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="" method="post" id="runtimeapilist">
|
<form action="" method="post" id="runtimeapilist">
|
||||||
<select autofocus required name="list_serv_select" id="list_serv_select">
|
<select autofocus required name="list_serv_select" id="list_serv_select">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<form action="" method="post" id="runtimeapisessions">
|
<form action="" method="post" id="runtimeapisessions">
|
||||||
<select autofocus required name="sessions_serv_select" id="sessions_serv_select">
|
<select autofocus required name="sessions_serv_select" id="sessions_serv_select">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="haproxyaddserv" id="haproxyaddserv">
|
<select autofocus required name="haproxyaddserv" id="haproxyaddserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="nginxaddserv" id="nginxaddserv">
|
<select autofocus required name="nginxaddserv" id="nginxaddserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
<select autofocus required name="geoipserv" id="geoipserv">
|
<select autofocus required name="geoipserv" id="geoipserv">
|
||||||
<option disabled selected>Choose server</option>
|
<option disabled selected>------</option>
|
||||||
{% for select in servers %}
|
{% for select in servers %}
|
||||||
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<form style="padding-left: 5px;" action="viewsttats.py" method="post">
|
<form style="padding-left: 5px;" action="viewsttats.py" method="post">
|
||||||
<input type="hidden" id="service" value="{{service}}" />
|
<input type="hidden" id="service" value="{{service}}" />
|
||||||
<select autofocus required name="serv" id="serv">
|
<select autofocus required name="serv" id="serv">
|
||||||
<option disabled>Choose server</option>
|
<option disabled>------</option>
|
||||||
{% for select in selects %}
|
{% for select in selects %}
|
||||||
{% if select.2 == serv %}
|
{% if select.2 == serv %}
|
||||||
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% for s in servers %}
|
{% for s in servers %}
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<canvas id="s_{{s.0}}" role="img"></canvas>
|
<canvas id="s_{{s.ip}}" role="img"></canvas>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div id="dialog-confirm" style="display: none;">
|
<div id="dialog-confirm" style="display: none;">
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
<script>
|
<script>
|
||||||
function showWafMetrics() {
|
function showWafMetrics() {
|
||||||
{% for s in servers %}
|
{% for s in servers %}
|
||||||
getWafChartData('{{s.0}}');
|
getWafChartData('{{s.ip}}');
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
}
|
||||||
showWafMetrics();
|
showWafMetrics();
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
let metrics = new Promise(
|
let metrics = new Promise(
|
||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
{% for s in servers %}
|
{% for s in servers %}
|
||||||
getWafChartData('{{s.0}}')
|
getWafChartData('{{s.ip}}')
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
});
|
});
|
||||||
metrics.then();
|
metrics.then();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Fail2Ban haproxy-wi filter
|
# Fail2Ban roxy-wi filter
|
||||||
#
|
#
|
||||||
|
|
||||||
[Definition]
|
[Definition]
|
||||||
|
@ -13,5 +13,5 @@ failregex = from <HOST> user: .* failed log in for: .*
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
|
|
||||||
# Author: Pavel Loginov
|
# Author: Pavel Loginov
|
||||||
# For project: haproxy-wi.org
|
# For project: roxy-wi.org
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
[haproxy-wi]
|
|
||||||
enabled = true
|
|
||||||
filter = haproxy-wi
|
|
||||||
port = http,https
|
|
||||||
action = iptables[name=haproxy-wi, port=https, protocol=tcp]
|
|
||||||
logpath = /var/www/haproxy-wi/log/haproxy-wi-*.log
|
|
||||||
findtime = 600
|
|
||||||
bantime = 600
|
|
||||||
maxretry = 2
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
[roxy-wi]
|
||||||
|
enabled = true
|
||||||
|
filter = roxy-wi
|
||||||
|
port = http,https
|
||||||
|
action = iptables[name=roxy-wi, port=https, protocol=tcp]
|
||||||
|
logpath = /var/www/haproxy-wi/log/roxy-wi-*.log
|
||||||
|
findtime = 600
|
||||||
|
bantime = 600
|
||||||
|
maxretry = 2
|
|
@ -1001,7 +1001,7 @@ $( function() {
|
||||||
$('#add-userlist-group').click(function() {
|
$('#add-userlist-group').click(function() {
|
||||||
$('#userlist-groups').append(add_userlist_group_var);
|
$('#userlist-groups').append(add_userlist_group_var);
|
||||||
});
|
});
|
||||||
var add_peer_var = '<br /><input name="servers_name" required title="Peer name" size=14 placeholder="haproxyN" class="form-control">' +
|
var add_peer_var = '<br /><input name="servers_name" required title="Peer name" size=14 placeholder="haproxyN" class="form-control">: ' +
|
||||||
'<input name="servers" title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control second-server">: ' +
|
'<input name="servers" title="Backend IP" size=14 placeholder="xxx.xxx.xxx.xxx" class="form-control second-server">: ' +
|
||||||
'<input name="server_port" required title="Backend port" size=3 placeholder="yyy" class="form-control second-server add_server_number" type="number">'
|
'<input name="server_port" required title="Backend port" size=3 placeholder="yyy" class="form-control second-server add_server_number" type="number">'
|
||||||
$('[name=add-peer-input]').click(function() {
|
$('[name=add-peer-input]').click(function() {
|
||||||
|
|
Loading…
Reference in New Issue