docs: add automated compose documentation generation pipeline
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys,re,shutil
|
||||
from pathlib import Path
|
||||
srcg,srcd,out=sys.argv[1],sys.argv[2],sys.argv[3]
|
||||
outp=Path(out)
|
||||
outp.mkdir(parents=True,exist_ok=True)
|
||||
for src in [Path(srcg),Path(srcd)]:
|
||||
for f in src.rglob('*'):
|
||||
if not f.is_file(): continue
|
||||
rel=f.relative_to(src)
|
||||
dest=outp/src.name/rel
|
||||
dest.parent.mkdir(parents=True,exist_ok=True)
|
||||
txt=f.read_text(errors='ignore')
|
||||
txt=re.sub(r'\b[a-zA-Z0-9.-]+\.lan\.ddnsgeek\.com\b','<internal-domain>',txt)
|
||||
txt=re.sub(r'\b(?:10\.\d{1,3}\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3})\b','<private-ip>',txt)
|
||||
txt=re.sub(r'(?i)\b(password|token|api_key|secret)\s*[:=]\s*[^\s\n]+',r'\1=<redacted>',txt)
|
||||
txt=re.sub(r'(?m)^([A-Z0-9_]*(?:PASSWORD|TOKEN|API_KEY|SECRET)[A-Z0-9_]*)\s*[:=]\s*.*$',r'\1=<redacted>',txt)
|
||||
dest.write_text(txt)
|
||||
Reference in New Issue
Block a user