Changelog: https://roxy-wi.org/changelog#6_3_0
pull/355/head
Pavel Loginov 2022-11-17 13:18:04 +03:00
parent ec0718f01f
commit 0d9afd8f42
6 changed files with 13 additions and 15 deletions

View File

@ -66,7 +66,7 @@ def get_backends_from_config(server_ip: str, backends='') -> None:
format_cfg = 'cfg'
try:
cfg = configs_dir + roxywi_comon.get_files(configs_dir, format_cfg)[0]
cfg = configs_dir + roxywi_common.get_files(configs_dir, format_cfg)[0]
except Exception as e:
roxywi_common.logging('Roxy-WI server', str(e), roxywi=1)
try:
@ -89,7 +89,7 @@ def get_backends_from_config(server_ip: str, backends='') -> None:
print(line.split(' ')[1], end="<br>")
def change_ip_and_port():
def change_ip_and_port() -> None:
backend_backend = common.checkAjaxInput(form.getvalue('backend_backend'))
backend_server = common.checkAjaxInput(form.getvalue('backend_server'))
backend_ip = common.checkAjaxInput(form.getvalue('backend_ip'))
@ -97,11 +97,11 @@ def change_ip_and_port():
if form.getvalue('backend_ip') is None:
print('error: Backend IP must be IP and not 0')
sys.exit()
return
if form.getvalue('backend_port') is None:
print('error: The backend port must be integer and not 0')
sys.exit()
return
haproxy_sock_port = sql.get_setting('haproxy_sock_port')
@ -144,13 +144,13 @@ def change_ip_and_port():
config_mod.master_slave_upload_and_restart(serv, cfg, just_save='save')
def change_maxconn():
def change_maxconn() -> None:
frontend = common.checkAjaxInput(form.getvalue('maxconn_frontend'))
maxconn = common.checkAjaxInput(form.getvalue('maxconn_int'))
if form.getvalue('maxconn_int') is None:
print('error: Maxconn must be integer and not 0')
sys.exit()
return
haproxy_sock_port = sql.get_setting('haproxy_sock_port')

View File

@ -910,8 +910,7 @@ def get_dick_permit(**kwargs):
try:
cursor.execute(sql)
except Exception as e:
# out_error(e)
pass
out_error(e)
else:
return cursor.fetchall()
@ -1584,7 +1583,6 @@ def insert_new_waf_rule(rule_name: str, rule_file: str, rule_description: str, s
out_error(e)
else:
return last_id
def delete_waf_server(server_id):

View File

@ -1323,7 +1323,7 @@ if form.getvalue('install_grafana'):
if form.getvalue('haproxy_exp_install'):
import modules.service.exporter.installation as exp_installation
exp_installtion.haproxy_exp_installation()
exp_installation.haproxy_exp_installation()
if form.getvalue('nginx_exp_install') or form.getvalue('apache_exp_install'):
import modules.service.exporter.installation as exp_installation
@ -3721,8 +3721,8 @@ if form.getvalue('loadchecker'):
telegrams=telegrams,
groups=groups,
slacks=slacks,
user_status=user_status,
user_plan=user_plan,
user_status=user_subscription['user_status'],
user_plan=user_subscription['user_plan'],
haproxy_servers=haproxy_servers,
nginx_servers=nginx_servers,
apache_servers=apache_servers,

View File

@ -103,7 +103,7 @@ rendered_template = template.render(
h2=1, title="Working with HAProxy config sections", role=user_params['role'], action="sections.py", user=user_params['user'],
select_id="serv", serv=serv, aftersave=aftersave, config=config_read, cfg=cfg, selects=user_params['servers'],
stderr=stderr, error=error, start_line=start_line, end_line=end_line, section=section, sections=sections,
is_serv_protected=is_serv_protected,user_services=user_params['user_services'], token=user_params['token'],
is_serv_protected=is_serv_protected, user_services=user_params['user_services'], token=user_params['token'],
warning=warning, is_restart=is_restart
)
print(rendered_template)

View File

@ -17,7 +17,7 @@ service = form.getvalue('service')
try:
if serv is None:
first_serv = servers
first_serv = user_params['servers']
for i in first_serv:
serv = i[2]
break

View File

@ -61,7 +61,7 @@ elif waf_rule_id and form.getvalue('config') is None:
elif service == 'nginx':
config_path = sql.get_setting('nginx_dir')
config_file_name = comon.return_nice_path(config_path) + 'waf/rules/' + waf_rule_file
config_file_name = common.return_nice_path(config_path) + 'waf/rules/' + waf_rule_file
try:
conf = open(cfg, "r")
config_read = conf.read()