Changelog: https://roxy-wi.org/changelog#6_3_0
pull/355/head
Pavel Loginov 2022-11-17 13:03:32 +03:00
parent f7de094a4f
commit ec0718f01f
5 changed files with 8 additions and 17 deletions

View File

@ -12,7 +12,6 @@ os.chdir(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(sys.path[0], '/var/www/haproxy-wi/app/'))
import modules.db.sql as sql
import modules.config.config as config_mod
import modules.roxywi.common as roxywi_common
_error_auth = '403 Auth before'
@ -186,13 +185,6 @@ def add_acl(haproxy_id):
return api_funct.add_acl(haproxy_id)
@route('/haproxy/<haproxy_id>/acl', method=['DELETE'])
def add_acl(haproxy_id):
if not check_login(required_service=1):
return dict(error=_error_auth)
return api_funct.del_acl(haproxy_id)
@route('/<service>/<server_id>', method=['GET'])
@route('/<service>/<server_id:int>', method=['GET'])
def callback(server_id, service):
@ -227,7 +219,7 @@ def service_config_show(server_id, service):
if not check_login(required_service=required_service):
return dict(error=_error_auth)
config_path = request.headers.get('config-file')
return api_config_mod.get_config(server_id, service=service, config_path=config_path)
return api_funct.get_config(server_id, service=service, config_path=config_path)
@route('/<service>/<server_id>/config', method=['POST'])

View File

@ -6,6 +6,7 @@ from jinja2 import Environment, FileSystemLoader
import modules.db.sql as sql
import modules.common.common as common
import modules.config.config as config_mod
import modules.roxy_wi_tools as roxy_wi_tools
import modules.roxywi.auth as roxywi_auth
import modules.roxywi.common as roxywi_common

View File

@ -2,6 +2,7 @@
import sys
import distro
from jinja2 import Environment, FileSystemLoader
import modules.db.sql as sql
import modules.common.common as common
@ -9,9 +10,6 @@ import modules.server.server as server_mod
import modules.roxywi.auth as roxywi_auth
import modules.roxywi.common as roxywi_common
from jinja2 import Environment, FileSystemLoader
import modules.roxywi.common as roxywi_common
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('hapservers.html')

View File

@ -77,7 +77,7 @@ def send_cookie(login):
try:
user_name = sql.get_user_name_by_uuid(user_uuid)
roxywi_roxywi_common.logging('Roxy-WI server', f' user: {user_name}, group: {user_group} login', roxywi=1)
roxywi_common.logging('Roxy-WI server', f' user: {user_name}, group: {user_group} login', roxywi=1)
except Exception:
pass
print("Content-type: text/html\n")
@ -103,7 +103,7 @@ def send_cookie(login):
else:
sql.insert_user_name(user_name)
except Exception as e:
roxywi_roxywi_common.logging('Cannot update subscription: ', str(e), roxywi=1)
roxywi_common.logging('Cannot update subscription: ', str(e), roxywi=1)
sys.exit()
@ -117,9 +117,9 @@ def ban():
c["ban"]["Secure"] = "True"
c["ban"]["expires"] = expires.strftime("%a, %d %b %Y %H:%M:%S GMT")
try:
roxywi_roxywi_common.logging('Roxy-WI server', f'{login} failed log in', roxywi=1, login=1)
roxywi_common.logging('Roxy-WI server', f'{login} failed log in', roxywi=1, login=1)
except Exception:
roxywi_roxywi_common.logging('Roxy-WI server', ' Failed log in. Wrong username', roxywi=1)
roxywi_common.logging('Roxy-WI server', ' Failed log in. Wrong username', roxywi=1)
print(c.output())
print("Content-type: text/html\n")
print('ban')

View File

@ -290,7 +290,7 @@ def keepalived_master_install():
hostname = sql.get_hostname_by_server_ip(master)
firewall = 1 if server_mod.is_service_active(master, 'firewalld') else 0
sql.add_server(
hostname + '-VIP', IP, group_id, '1', '1', '0', cred_id, ssh_settings['port'], f'VRRP IP for {master}',
hostname + '-VIP', vrrp_ip, group_id, '1', '1', '0', cred_id, ssh_settings['port'], f'VRRP IP for {master}',
haproxy, nginx, '0', firewall
)
os.remove(script)