fix: safe service name for path, nginx hint scope error

This commit is contained in:
2026-05-22 20:19:29 +04:00
parent 99f4b109d5
commit 26398e2e4b
2 changed files with 7 additions and 6 deletions

View File

@@ -139,11 +139,11 @@ def parse_nginx_config_dump(raw_text, service_ports, service_domain_hints):
for hint in service_domain_hints:
if hint in server_name:
score += 80
# wildcard *.domain
if hint.startswith("*."):
domain = hint.lstrip("*.")
if domain in server_name:
score += 80
# wildcard *.domain
if hint.startswith("*."):
domain = hint.lstrip("*.")
if domain in server_name:
score += 80
if score > 0:
related.append({

View File

@@ -150,7 +150,8 @@ def do_discovery():
os.makedirs(_ARCHIVE_DIR, exist_ok=True)
stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
manifest_path = os.path.join(_ARCHIVE_DIR, f"{service_name}_{stamp}_manifest.json")
safe_name = service_name.replace("/", "_").replace(":", "_")
manifest_path = os.path.join(_ARCHIVE_DIR, f"{safe_name}_{stamp}_manifest.json")
save_manifest(manifest, manifest_path)
state.set_stage("SOURCE_MANIFEST_REVIEW", manifest_path=manifest_path)
info(f"Этап discovery завершён. Manifest: {manifest_path}")