mirror of https://github.com/Aidaho12/haproxy-wi
parent
27024cc58a
commit
308870a339
|
@ -2129,7 +2129,7 @@ if form.getvalue('get_ldap_email'):
|
||||||
except Exception:
|
except Exception:
|
||||||
print('error: user not found')
|
print('error: user not found')
|
||||||
finally:
|
finally:
|
||||||
l.unbind()
|
ldap_bind.unbind()
|
||||||
|
|
||||||
if form.getvalue('change_waf_mode'):
|
if form.getvalue('change_waf_mode'):
|
||||||
waf_mode = form.getvalue('change_waf_mode')
|
waf_mode = form.getvalue('change_waf_mode')
|
||||||
|
@ -2864,9 +2864,11 @@ if form.getvalue('lets_domain'):
|
||||||
else:
|
else:
|
||||||
proxy_serv = ''
|
proxy_serv = ''
|
||||||
|
|
||||||
commands = ["chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " haproxy_dir=" + haproxy_dir +
|
commands = [
|
||||||
" DOMAIN=" + lets_domain + " EMAIL=" + lets_email + " SSH_PORT=" + ssh_port + " SSL_PATH=" + ssl_path +
|
"chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " haproxy_dir=" + haproxy_dir
|
||||||
" HOST=" + serv + " USER=" + ssh_user_name + " PASS='" + ssh_user_password + "' KEY=" + ssh_key_name]
|
+ " 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])
|
output, error = funct.subprocess_execute(commands[0])
|
||||||
|
|
||||||
|
@ -3029,10 +3031,12 @@ if form.getvalue('geoip_install'):
|
||||||
|
|
||||||
os.system("cp scripts/%s ." % script)
|
os.system("cp scripts/%s ." % script)
|
||||||
|
|
||||||
commands = ["chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " SSH_PORT=" + ssh_port +
|
commands = [
|
||||||
" UPDATE=" + str(geoip_update) + " maxmind_key=" + maxmind_key + " haproxy_dir=" + haproxy_dir +
|
"chmod +x " + script + " && ./" + script + " PROXY=" + proxy_serv + " SSH_PORT=" + ssh_port
|
||||||
" HOST=" + str(serv) + " USER=" + str(ssh_user_name) + " PASS=" + str(ssh_user_password) +
|
+ " UPDATE=" + str(geoip_update) + " maxmind_key=" + maxmind_key + " haproxy_dir=" + haproxy_dir
|
||||||
" KEY=" + str(ssh_key_name)]
|
+ " 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])
|
output, error = funct.subprocess_execute(commands[0])
|
||||||
|
|
||||||
|
@ -3538,12 +3542,12 @@ if form.getvalue('awseditworkspace'):
|
||||||
print('ok')
|
print('ok')
|
||||||
|
|
||||||
if (
|
if (
|
||||||
form.getvalue('awsprovisining') or
|
form.getvalue('awsprovisining')
|
||||||
form.getvalue('awseditingprovisining') or
|
or form.getvalue('awseditingprovisining')
|
||||||
form.getvalue('doprovisining') or
|
or form.getvalue('doprovisining')
|
||||||
form.getvalue('doeditprovisining') or
|
or form.getvalue('doeditprovisining')
|
||||||
form.getvalue('gcoreprovisining') or
|
or form.getvalue('gcoreprovisining')
|
||||||
form.getvalue('gcoreeditgprovisining')
|
or form.getvalue('gcoreeditgprovisining')
|
||||||
):
|
):
|
||||||
funct.check_user_group()
|
funct.check_user_group()
|
||||||
|
|
||||||
|
@ -3955,8 +3959,8 @@ if form.getvalue('loadopenvpn'):
|
||||||
stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client")
|
stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(stdout[0] != 'package openvpn3-client is not installed' and stderr != '/bin/sh: rpm: command not found') and
|
(stdout[0] != 'package openvpn3-client is not installed' and stderr != '/bin/sh: rpm: command not found')
|
||||||
stdout[0] != 'E: No packages 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\"'"
|
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)
|
openvpn_configs, stderr = funct.subprocess_execute(cmd)
|
||||||
|
|
|
@ -1855,10 +1855,11 @@ def get_setting(param, **kwargs):
|
||||||
else:
|
else:
|
||||||
for setting in query_res:
|
for setting in query_res:
|
||||||
if param in (
|
if param in (
|
||||||
'nginx_stats_port', 'session_ttl', 'token_ttl', 'stats_port', 'haproxy_sock_port', 'ldap_type',
|
'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',
|
'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',
|
'checker_check_interval', 'port_scan_interval', 'smon_keep_history_range', 'checker_keep_history_range',
|
||||||
'portscanner_keep_history_range', 'checker_maxconn_threshold', 'apache_stats_port'):
|
'portscanner_keep_history_range', 'checker_maxconn_threshold', 'apache_stats_port'
|
||||||
|
):
|
||||||
return int(setting.value)
|
return int(setting.value)
|
||||||
else:
|
else:
|
||||||
return setting.value
|
return setting.value
|
||||||
|
|
Loading…
Reference in New Issue