Improve docs pipeline with generated topology diagrams

This commit is contained in:
beatz174-bit committed 2026-05-13 09:08:47 +10:00
1 parent 22b3659cdf
commit 9d79f828e4
18 files changed
+7690 -110

No files matched your search

+29 -6
View File
@@ -20,27 +20,50 @@ def sanitize_text(content: str) -> str:
content = re.sub(r'(?m)^([A-Z0-9_]*(?:PASSWORD|TOKEN|API_KEY|SECRET)[A-Z0-9_]*)\s*[:=]\s*.*$', r'\1=<redacted>', content)
return content
for name in ['compose-inventory.md', 'traefik-routes.md', 'prometheus-rules.md']:
src = src_generated / name
if src.exists():
(out_dir / name).write_text(sanitize_text(src.read_text(errors='ignore')))
svg_src = src_diagrams / 'docker-compose.svg'
if svg_src.exists():
(out_dir / 'docker-compose.svg').write_text(sanitize_text(svg_src.read_text(errors='ignore')))
for svg_name in ['docker-compose.svg', 'physical-topology.svg', 'docker-traefik-dynu.svg']:
src = src_diagrams / svg_name
if src.exists():
(out_dir / svg_name).write_text(sanitize_text(src.read_text(errors='ignore')))
(out_dir / 'index.md').write_text(
"""# Public Infrastructure Summary
This folder contains sanitized documentation generated from the infrastructure repository.
This documentation is generated from the infrastructure repository. Sensitive values are redacted.
Sensitive values such as internal domain names, private IP addresses, tokens, passwords, and secrets are redacted.
## Infrastructure diagrams
### Physical / virtual topology
![Physical topology](physical-topology.svg)
### Docker, Traefik and Dynu routing
![Docker Traefik Dynu](docker-traefik-dynu.svg)
## Documents
- [Diagrams](diagrams.md)
- [Compose Inventory](compose-inventory.md)
- [Traefik Routes](traefik-routes.md)
- [Prometheus Rules](prometheus-rules.md)
- [Docker Compose Diagram](docker-compose.svg)
"""
)
(out_dir / 'diagrams.md').write_text(
"""# Infrastructure diagrams
## Physical / virtual topology
![Physical topology](physical-topology.svg)
## Docker, Traefik and Dynu routing
![Docker Traefik Dynu](docker-traefik-dynu.svg)
"""
)