From 2bf43e5d29f53ccba450106aa2323dcb70be4cc7 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Wed, 21 Jul 2021 10:57:58 +0600 Subject: [PATCH] v5.2.2.0 Changelog: https://haproxy-wi.org/changelog.py#5_2_2 --- app/funct.py | 18 +++++++------ app/options.py | 8 +++--- .../ansible/roles/haproxy/tasks/main.yml | 4 +-- app/templates/404.html | 12 ++++----- app/templates/500.html | 12 ++++----- app/templates/add.html | 14 +++++----- app/templates/admin.html | 18 +++++++------ app/templates/ajax/load_openvpn.html | 2 +- app/templates/ajax/nginx_stats.html | 2 +- app/templates/ha.html | 2 +- app/templates/include/admin_backup.html | 2 +- app/templates/include/admin_servers.html | 4 +-- app/templates/include/admin_ssh.html | 4 +-- app/templates/logs.html | 4 +-- app/templates/ovw.html | 10 +++---- app/templates/portscanner.html | 4 +-- app/templates/runtimeapi.html | 12 ++++----- app/templates/servers.html | 2 +- app/templates/waf.html | 26 ++++++------------- inc/users.js | 2 ++ 20 files changed, 79 insertions(+), 83 deletions(-) diff --git a/app/funct.py b/app/funct.py index e415ba99..ea2edda1 100644 --- a/app/funct.py +++ b/app/funct.py @@ -298,24 +298,26 @@ def ssh_connect(serv): else: ssh.connect(hostname=serv, port=ssh_port, username=ssh_user_name, password=ssh_user_password, timeout=11, banner_timeout=200) return ssh - except paramiko.AuthenticationException: - return 'Authentication failed, please verify your credentials' + except paramiko.AuthenticationException as e: + logging('localhost', ' ' + str(e), haproxywi=1) + print('error: Authentication failed, please verify your credentials') except paramiko.SSHException as sshException: - return 'error: Unable to establish SSH connection: %s ' % sshException + logging('localhost', ' ' + str(sshException), haproxywi=1) + print('error: Unable to establish SSH connection: %s ') % sshException except paramiko.PasswordRequiredException as e: logging('localhost', ' ' + str(e), haproxywi=1) - return 'error: %s ' % e + print('error: %s ') % e except paramiko.BadHostKeyException as badHostKeyException: logging('localhost', ' ' + str(badHostKeyException), haproxywi=1) - return 'error: Unable to verify server\'s host key: %s ' % badHostKeyException + print('error: Unable to verify server\'s host key: %s ') % badHostKeyException except Exception as e: logging('localhost', ' ' + str(e), haproxywi=1) if e == "No such file or directory": - return 'error: %s. Check ssh key' % e + print('error: %s. Check SSH key') % e elif e == "Invalid argument": - return 'error: Check the IP of the server' + print('error: Check the IP of the server') else: - return str(e) + print(str(e)) def get_config(serv, cfg, **kwargs): diff --git a/app/options.py b/app/options.py index 75ae1e4d..2fa2c152 100644 --- a/app/options.py +++ b/app/options.py @@ -807,7 +807,7 @@ if serv is not None and act == "showMap": node = "" line_new2 = [1, ""] i, k = 800, 800 - j, m = 0, 0 + j = 0 for line in conf: if line.startswith('listen') or line.startswith('frontend'): if "stats" not in line: @@ -854,9 +854,9 @@ if serv is not None and act == "showMap": backend_server_port = '' if j % 2 == 0: - G.add_node(line_new[0], pos=(k + 230, i - 335), label_pos=(k + 225, i - 180)) + G.add_node(line_new[0], pos=(k + 250, i - 335), label_pos=(k + 215, i - 180)) else: - G.add_node(line_new[0], pos=(k - 230, i - 0), label_pos=(k - 225, i + 180)) + G.add_node(line_new[0], pos=(k - 250, i - 0), label_pos=(k - 245, i + 180)) if line_new2[1] != "": G.add_edge(node, line_new[0], port=backend_server_port) @@ -1394,7 +1394,7 @@ if form.getvalue('installwaf'): if form.getvalue('update_haproxy_wi'): service = form.getvalue('service') - services = ['roxy-wi-checker', 'haproxy-wi', 'roxy-wi-keep_alive', 'roxy-wi-smon', 'roxy-wi-metrics'] + services = ['roxy-wi-checker', 'roxy-wi', 'roxy-wi-keep_alive', 'roxy-wi-smon', 'roxy-wi-metrics'] if service not in services: print('error: ' + service + ' is not part of Roxy-WI') sys.exit() diff --git a/app/scripts/ansible/roles/haproxy/tasks/main.yml b/app/scripts/ansible/roles/haproxy/tasks/main.yml index a30b6375..db6a02fb 100644 --- a/app/scripts/ansible/roles/haproxy/tasks/main.yml +++ b/app/scripts/ansible/roles/haproxy/tasks/main.yml @@ -28,7 +28,7 @@ - name: install HAProxy {{HAPVER}} on EL{{ansible_facts['distribution_major_version']}} yum: name: - - http://repo.haproxy-wi.org/haproxy-{{HAPVER}}.el{{ansible_facts['distribution_major_version']}}.x86_64.rpm + - http://repo.roxy-wi.org/haproxy-{{HAPVER}}.el{{ansible_facts['distribution_major_version']}}.x86_64.rpm - socat - rsyslog state: present @@ -44,7 +44,7 @@ - name: Try to install another HAProxy {{HAPVER}} on EL{{ansible_facts['distribution_major_version']}} yum: name: - - http://repo1.haproxy-wi.org/haproxy-{{HAPVER}}.el{{ansible_facts['distribution_major_version']}}.x86_64.rpm + - http://repo1.roxy-wi.org/haproxy-{{HAPVER}}.el{{ansible_facts['distribution_major_version']}}.x86_64.rpm - socat - rsyslog - bind-utils diff --git a/app/templates/404.html b/app/templates/404.html index 0950836e..e416adae 100644 --- a/app/templates/404.html +++ b/app/templates/404.html @@ -45,7 +45,7 @@
- + logo @@ -83,16 +83,16 @@
@@ -801,7 +801,7 @@
How to use pre saved option you can see in - + this video
@@ -856,7 +856,7 @@
How to use pre saved servers you can see in - + this video
@@ -952,7 +952,7 @@
How to use userlists you can read - + here
@@ -1019,7 +1019,7 @@
How to use peers you can read - + here
@@ -1084,7 +1084,7 @@
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. Read how to use it in this - article + article
@@ -90,17 +90,18 @@ Service - + Actions - Version - Description + Version + Description +
- You can read about services here + You can read about services here
@@ -115,18 +116,19 @@ Description +
Note: - For updating you have to use Roxy-WI RPM. How to start using repository read here + For updating you have to use Roxy-WI RPM. How to start using repository read here

If the Roxy-WI server uses a proxy to connect to the Internet, add the proxy settings to yum.conf

- Read more about updating in docs - and changelog + Read more about updating in docs + and changelog
diff --git a/app/templates/ajax/load_openvpn.html b/app/templates/ajax/load_openvpn.html index 0c260a4b..a9b5af5d 100644 --- a/app/templates/ajax/load_openvpn.html +++ b/app/templates/ajax/load_openvpn.html @@ -83,7 +83,7 @@

You do not have installed OpenVPN client. - Read hear + Read hear how to install OpenVPN client

{% endif %} \ No newline at end of file diff --git a/app/templates/ajax/nginx_stats.html b/app/templates/ajax/nginx_stats.html index 9cb33370..cb87f6b9 100644 --- a/app/templates/ajax/nginx_stats.html +++ b/app/templates/ajax/nginx_stats.html @@ -121,6 +121,6 @@ u:hover div.tips {visibility:visible;}
- You can read the description about statuses here + You can read the description about statuses here
{% endfor %} diff --git a/app/templates/ha.html b/app/templates/ha.html index 30c98024..3d1bb8ff 100644 --- a/app/templates/ha.html +++ b/app/templates/ha.html @@ -94,7 +94,7 @@
- Read How to create high available cluster + Read How to create high available cluster
{% if role <= 3 %} @@ -111,7 +111,7 @@
- You can read how it works here + You can read how it works here
@@ -157,7 +157,7 @@
- You can read how it works here + You can read how it works here
@@ -189,7 +189,7 @@
- You can read how it works here + You can read how it works here
@@ -221,7 +221,7 @@
- You can read how it works here + You can read how it works here
@@ -248,7 +248,7 @@
- You can read how it works here + You can read how it works here
{% endif %} diff --git a/app/templates/servers.html b/app/templates/servers.html index 67d85782..d2a72245 100644 --- a/app/templates/servers.html +++ b/app/templates/servers.html @@ -144,7 +144,7 @@
- Read the "how to" in this article + Read the "how to" in this article
diff --git a/app/templates/waf.html b/app/templates/waf.html index b4fd49a0..083f81e8 100644 --- a/app/templates/waf.html +++ b/app/templates/waf.html @@ -45,7 +45,7 @@ var hostnamea = [] {% for s in servers_all %} ip.push("{{s[2]}}"); - var host = "{{s[1]}}"; + var host = "{{s[2]}}"; host = host.replace(/\./g, '\\.'); hostnamea.push(host); {% endfor %} @@ -56,21 +56,11 @@ {% else %}
- - - - - + + + + + {% for s in servers_all %} - + {% endfor %}
- Server - - Actions - - WAF mode - - Metrics - - Manage rules - ServerActionsWAF modeMetricsManage rules @@ -78,7 +68,7 @@
@@ -129,7 +119,7 @@ });
- You can read the description and watch a video about WAF here + You can read the description and watch a video about WAF here
{% endif %} {% endif %} diff --git a/inc/users.js b/inc/users.js index 55c44bf4..07d42900 100644 --- a/inc/users.js +++ b/inc/users.js @@ -1844,6 +1844,8 @@ function checkSshConnect(ip) { success: function( data ) { if (data.indexOf('error:') != '-1') { toastr.error(data) + } else if(data.indexOf('failed') != '-1') { + toastr.error(data) } else { toastr.clear(); toastr.success('Connect is accepted');