From 308870a33946886abf63f800e3cd9f47fdb7116c Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Wed, 25 May 2022 21:54:12 +0300 Subject: [PATCH] v6.0.2.0 Changelog: https://roxy-wi.org/changelog.py#6_0_2 --- app/options.py | 36 ++++++++++++++++++++---------------- app/sql.py | 9 +++++---- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/options.py b/app/options.py index d572cac2..e6634476 100644 --- a/app/options.py +++ b/app/options.py @@ -2129,7 +2129,7 @@ if form.getvalue('get_ldap_email'): except Exception: print('error: user not found') finally: - l.unbind() + ldap_bind.unbind() if form.getvalue('change_waf_mode'): waf_mode = form.getvalue('change_waf_mode') @@ -2864,9 +2864,11 @@ if form.getvalue('lets_domain'): else: proxy_serv = '' - commands = ["chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " haproxy_dir=" + haproxy_dir + - " DOMAIN=" + lets_domain + " EMAIL=" + lets_email + " SSH_PORT=" + ssh_port + " SSL_PATH=" + ssl_path + - " HOST=" + serv + " USER=" + ssh_user_name + " PASS='" + ssh_user_password + "' KEY=" + ssh_key_name] + commands = [ + "chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " haproxy_dir=" + haproxy_dir + + " DOMAIN=" + lets_domain + " EMAIL=" + lets_email + " SSH_PORT=" + ssh_port + " SSL_PATH=" + ssl_path + + " HOST=" + serv + " USER=" + ssh_user_name + " PASS='" + ssh_user_password + "' KEY=" + ssh_key_name + ] output, error = funct.subprocess_execute(commands[0]) @@ -3029,10 +3031,12 @@ if form.getvalue('geoip_install'): os.system("cp scripts/%s ." % script) - commands = ["chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " SSH_PORT=" + ssh_port + - " UPDATE=" + str(geoip_update) + " maxmind_key=" + maxmind_key + " haproxy_dir=" + haproxy_dir + - " HOST=" + str(serv) + " USER=" + str(ssh_user_name) + " PASS=" + str(ssh_user_password) + - " KEY=" + str(ssh_key_name)] + commands = [ + "chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " SSH_PORT=" + ssh_port + + " UPDATE=" + str(geoip_update) + " maxmind_key=" + maxmind_key + " haproxy_dir=" + haproxy_dir + + " HOST=" + str(serv) + " USER=" + str(ssh_user_name) + " PASS=" + str(ssh_user_password) + + " KEY=" + str(ssh_key_name) + ] output, error = funct.subprocess_execute(commands[0]) @@ -3538,12 +3542,12 @@ if form.getvalue('awseditworkspace'): print('ok') if ( - form.getvalue('awsprovisining') or - form.getvalue('awseditingprovisining') or - form.getvalue('doprovisining') or - form.getvalue('doeditprovisining') or - form.getvalue('gcoreprovisining') or - form.getvalue('gcoreeditgprovisining') + form.getvalue('awsprovisining') + or form.getvalue('awseditingprovisining') + or form.getvalue('doprovisining') + or form.getvalue('doeditprovisining') + or form.getvalue('gcoreprovisining') + or form.getvalue('gcoreeditgprovisining') ): funct.check_user_group() @@ -3955,8 +3959,8 @@ if form.getvalue('loadopenvpn'): stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client") if ( - (stdout[0] != 'package openvpn3-client is not installed' and stderr != '/bin/sh: rpm: command not found') and - stdout[0] != 'E: No packages found' + (stdout[0] != 'package openvpn3-client is not installed' and stderr != '/bin/sh: rpm: command not found') + and stdout[0] != 'E: No packages found' ): cmd = "sudo openvpn3 configs-list |grep -E 'ovpn|(^|[^0-9])[0-9]{4}($|[^0-9])' |grep -v net|awk -F\" \" '{print $1}'|awk 'ORS=NR%2?\" \":\"\\n\"'" openvpn_configs, stderr = funct.subprocess_execute(cmd) diff --git a/app/sql.py b/app/sql.py index 2fbff02c..2cef00c7 100755 --- a/app/sql.py +++ b/app/sql.py @@ -1855,10 +1855,11 @@ def get_setting(param, **kwargs): else: for setting in query_res: if param in ( - 'nginx_stats_port', 'session_ttl', 'token_ttl', 'stats_port', 'haproxy_sock_port', 'ldap_type', - 'ldap_port', 'ldap_enable', 'log_time_storage', 'syslog_server_enable', 'smon_check_interval', - 'checker_check_interval', 'port_scan_interval', 'smon_keep_history_range', 'checker_keep_history_range', - 'portscanner_keep_history_range', 'checker_maxconn_threshold', 'apache_stats_port'): + 'nginx_stats_port', 'session_ttl', 'token_ttl', 'stats_port', 'haproxy_sock_port', 'ldap_type', + 'ldap_port', 'ldap_enable', 'log_time_storage', 'syslog_server_enable', 'smon_check_interval', + 'checker_check_interval', 'port_scan_interval', 'smon_keep_history_range', 'checker_keep_history_range', + 'portscanner_keep_history_range', 'checker_maxconn_threshold', 'apache_stats_port' + ): return int(setting.value) else: return setting.value