diff --git a/app/create_db.py b/app/create_db.py
index 2e98e6e3..0b7b7928 100644
--- a/app/create_db.py
+++ b/app/create_db.py
@@ -181,7 +181,7 @@ def update_db_v_31(**kwargs):
sql.append("INSERT INTO settings (param, value, section, `desc`) values('server_state_file', '/etc/haproxy/haproxy.state', 'haproxy', 'Path to HAProxy state file');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('haproxy_sock', '/var/run/haproxy.sock', 'haproxy', 'Path to HAProxy sock file');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('haproxy_sock_port', '1999', 'haproxy', 'HAProxy sock port');")
- sql.append("INSERT INTO settings (param, value, section, `desc`) values('firewall_enable', '0', 'haproxy', 'If enable this option Haproxy-wi will be configure firewalld based on config port');")
+ sql.append("INSERT INTO settings (param, value, section, `desc`) values('firewall_enable', '0', 'main', 'If enable this option Haproxy-wi will be configure firewalld based on config port');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('apache_log_path', '/var/log/httpd/', 'logs', 'Path to Apache logs');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('ldap_enable', '0', 'ldap', 'If 1 ldap enabled');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('ldap_server', '', 'ldap', 'IP address ldap server');")
diff --git a/app/options.py b/app/options.py
index 53edec01..ec682411 100644
--- a/app/options.py
+++ b/app/options.py
@@ -1223,25 +1223,30 @@ if form.getvalue('bwlists_save'):
except IOError as e:
print('
Cat\'n save '+color+' list. %s
' % e)
- servers = sql.get_dick_permit()
path = sql.get_setting('haproxy_dir')+"/"+color
-
- for server in servers:
- funct.ssh_command(server[2], ["sudo mkdir "+path])
- funct.ssh_command(server[2], ["sudo chown $(whoami) "+path])
- error = funct.upload(server[2], path+"/"+bwlists_save, list, dir='fullpath')
+ servers = []
+ servers.append(serv)
+
+ MASTERS = sql.is_master(serv)
+ for master in MASTERS:
+ if master[0] != None:
+ servers.append(master[0])
+ for serv in servers:
+ funct.ssh_command(serv, ["sudo mkdir "+path])
+ funct.ssh_command(serv, ["sudo chown $(whoami) "+path])
+ error = funct.upload(serv, path+"/"+bwlists_save, list, dir='fullpath')
if error:
print('Upload fail: %s
' % error)
else:
- print('Edited '+color+' list was uploaded to '+server[1]+'
')
+ print('Edited '+color+' list was uploaded to '+serv+'
')
try:
- funct.logging(server[1], 'has edited '+color+' list '+bwlists_save, haproxywi=1, login=1)
+ funct.logging(serv, 'has edited '+color+' list '+bwlists_save, haproxywi=1, login=1)
except:
pass
if form.getvalue('bwlists_restart') == 'restart':
- funct.ssh_command(server[2], ["sudo systemctl restart haproxy"])
+ funct.ssh_command(serv, ["sudo systemctl restart haproxy"])
elif form.getvalue('bwlists_restart') == 'reload':
- funct.ssh_command(server[2], ["sudo systemctl reload haproxy"])
+ funct.ssh_command(serv, ["sudo systemctl reload haproxy"])
if form.getvalue('get_lists'):
diff --git a/app/templates/add.html b/app/templates/add.html
index c1f6e3c7..3ff63308 100644
--- a/app/templates/add.html
+++ b/app/templates/add.html
@@ -750,13 +750,20 @@ h3 {
- New black list
- | Exists black lists
- | New white list
- | Exists white lists
+ | Server for upload |
+ New black list |
+ Exists black lists |
-
+ |
+
+ |
+
Name: {{ input('new_blacklist_name') }}
|
@@ -765,7 +772,26 @@ h3 {
{{ list }}
{% endfor %}
-
+
+ |
+ {{ input('group', value=group, type='hidden') }}
+
+
+
+ Server for upload |
+ New white list |
+ Exists white lists |
+
+
+
+
+ |
+
Name: {{ input('new_whitelist_name') }}
|
@@ -775,12 +801,11 @@ h3 {
{% endfor %}
- {{ input('group', value=group, type='hidden') }}
+
In this section you can create and edit black and white lists. And after use them in the HAProxy configs or in the "Add proxy" pages
-
Note: Each new address must be specified from a new line
diff --git a/app/tools/checker_worker.py b/app/tools/checker_worker.py
index c0e06c28..e7f5bc99 100644
--- a/app/tools/checker_worker.py
+++ b/app/tools/checker_worker.py
@@ -74,7 +74,7 @@ def main(serv, port):
servername = servername.split(",")
realserver = servername[0]
server = servername[1]
- alert = "Backend: "+realserver[2:]+", server: "+server+" has changed status and is now "+ currentstat[i] + " at " + serv
+ alert = "Backend: "+realserver[2:]+", server: "+server+" has changed status to "+ currentstat[i] + " at " + serv
funct.telegram_send_mess(str(alert), ip=serv)
funct.logging("localhost", " "+alert, alerting=1)
firstrun = False
diff --git a/inc/add.js b/inc/add.js
index 7a643839..55e55d4e 100644
--- a/inc/add.js
+++ b/inc/add.js
@@ -1212,6 +1212,7 @@ function saveList(action, list, color) {
url: "options.py",
data: {
bwlists_save: list,
+ serv: $( "#serv-"+color+"-list option:selected" ).val(),
bwlists_content: $('#edit_lists').val(),
color: color,
group: $('#group').val(),