Pavel Loginov 3 years ago
parent cbdf25f711
commit 7c39d4d394

@ -12,6 +12,7 @@ def is_ip_or_dns(server_from_request: str) -> str:
if ('roxy-wi' in server_from_request or
'fail2ban' in server_from_request or
'prometheus' in server_from_request or
'all' in server_from_request or
'grafana-server' in server_from_request):
return server_from_request
if re.match(ip_regex, server_from_request):

@ -79,4 +79,5 @@
daemon_reload: yes
state: started
enabled: yes
force: no
force: yes
ignore_errors: yes

@ -740,16 +740,21 @@ def get_slack_by_id(slack_id):
def get_dick_permit(**kwargs):
import http.cookies
import os
if kwargs.get('username'):
grp = kwargs.get('group_id')
else:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
group = cookie.get('group')
grp = group.value
try:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
group = cookie.get('group')
grp = group.value
except Exception as e:
print('error: ' + str(e))
if kwargs.get('token'):
token = kwargs.get('token')
else:
token = ''
only_group = kwargs.get('only_group')
disable = 'enable = 1'
haproxy = ''

Loading…
Cancel
Save