fix: safe service name for path, nginx hint scope error
This commit is contained in:
+5
-5
@@ -139,11 +139,11 @@ def parse_nginx_config_dump(raw_text, service_ports, service_domain_hints):
|
|||||||
for hint in service_domain_hints:
|
for hint in service_domain_hints:
|
||||||
if hint in server_name:
|
if hint in server_name:
|
||||||
score += 80
|
score += 80
|
||||||
# wildcard *.domain
|
# wildcard *.domain
|
||||||
if hint.startswith("*."):
|
if hint.startswith("*."):
|
||||||
domain = hint.lstrip("*.")
|
domain = hint.lstrip("*.")
|
||||||
if domain in server_name:
|
if domain in server_name:
|
||||||
score += 80
|
score += 80
|
||||||
|
|
||||||
if score > 0:
|
if score > 0:
|
||||||
related.append({
|
related.append({
|
||||||
|
|||||||
+2
-1
@@ -150,7 +150,8 @@ def do_discovery():
|
|||||||
|
|
||||||
os.makedirs(_ARCHIVE_DIR, exist_ok=True)
|
os.makedirs(_ARCHIVE_DIR, exist_ok=True)
|
||||||
stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
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)
|
save_manifest(manifest, manifest_path)
|
||||||
state.set_stage("SOURCE_MANIFEST_REVIEW", manifest_path=manifest_path)
|
state.set_stage("SOURCE_MANIFEST_REVIEW", manifest_path=manifest_path)
|
||||||
info(f"Этап discovery завершён. Manifest: {manifest_path}")
|
info(f"Этап discovery завершён. Manifest: {manifest_path}")
|
||||||
|
|||||||
Reference in New Issue
Block a user