mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-23 19:38:06 -04:00
A bit of refactoring
This commit is contained in:
@@ -25,11 +25,10 @@ def find_apps():
|
||||
continue
|
||||
file = open(file_path, "r")
|
||||
content = file.read()
|
||||
match_proxy(content, file_path, apps)
|
||||
match_auth(apps, auths)
|
||||
match_proxy(apps, auths, content, file_path)
|
||||
return apps, auths
|
||||
|
||||
def match_proxy(content, file_path, apps):
|
||||
def match_proxy(apps, auths, content, file_path):
|
||||
results = re.finditer(PROXY_REGEX, content)
|
||||
for result in results:
|
||||
params = result.groupdict()
|
||||
@@ -39,12 +38,9 @@ def match_proxy(content, file_path, apps):
|
||||
if file_path.startswith("/config/nginx/site-confs/") or file_path.endswith(".conf"):
|
||||
file_path = "auto-proxy" if file_path.startswith("/etc/nginx/http.d/") else file_path
|
||||
apps[app].add(file_path)
|
||||
match_auth(auths, app, file_path, content)
|
||||
|
||||
def match_auth(apps, auths):
|
||||
for app, file_paths in apps.items():
|
||||
for file_path in file_paths:
|
||||
file = open(file_path, "r")
|
||||
content = file.read()
|
||||
def match_auth(auths, app, file_path, content):
|
||||
if re.findall(AUTHELIA_REGEX, content):
|
||||
auths[app][file_path] = "Authelia"
|
||||
elif re.findall(AUTHENTIK_REGEX, content):
|
||||
|
||||
Reference in New Issue
Block a user