[SPRINT-V1][B] oauth2-proxy в Git: 18 прокси экспортированы в deploy/ctNNN/*.compose.yml (без секретов); реестр: SSO 19 доменов
This commit is contained in:
1 parent
108a53b9db
commit
d5c0ebc094
13 files changed
+730
-188
No files matched your search
@@ -108,6 +108,18 @@ def costs(hostlist):
|
||||
return out
|
||||
|
||||
|
||||
OAUTH_PORTS = set()
|
||||
|
||||
|
||||
def collect_oauth_ports(services_list):
|
||||
"""Порты хостов, на которых слушают oauth2-proxy (для детекта SSO)."""
|
||||
global OAUTH_PORTS
|
||||
for sv in services_list:
|
||||
if sv["name"].startswith("oauth2-proxy") and sv.get("ports"):
|
||||
OAUTH_PORTS.update(sv["ports"])
|
||||
return OAUTH_PORTS
|
||||
|
||||
|
||||
def domains():
|
||||
"""Домены из nginx: server_name + proxy_pass (хост и VPS)."""
|
||||
seen, out = set(), []
|
||||
@@ -125,6 +137,12 @@ def domains():
|
||||
if "oauth2" not in u]
|
||||
ssl = "ssl_certificate" in block
|
||||
auth = ("auth_request" in block) or ("oauth2" in block.lower())
|
||||
if not auth and ups:
|
||||
try:
|
||||
up_port = int(ups[0].rsplit(":", 1)[-1].split("/")[0])
|
||||
auth = up_port in OAUTH_PORTS
|
||||
except Exception:
|
||||
pass
|
||||
for n in names[0].split():
|
||||
n = n.strip()
|
||||
if not n or n in ("_", "localhost") or "$" in n or n in seen:
|
||||
@@ -159,6 +177,7 @@ def main():
|
||||
os.makedirs(OUT, exist_ok=True)
|
||||
h = hosts()
|
||||
s = services(h)
|
||||
collect_oauth_ports(s)
|
||||
d = domains()
|
||||
c = costs(h)
|
||||
e = dependencies(h, s, d)
|
||||
|
||||
Reference in new issue
Block a user