feat(security): enforce ADR 0005 hosting boundary segregation strictly to family/
This commit is contained in:
@@ -475,7 +475,8 @@ def generate_dashboard_html(engine: DatastoreEngine) -> str:
|
||||
"name": "Moritz Health",
|
||||
"short_name": "Health",
|
||||
"description": "Persönliches Dashboard für Kalorienbilanz, Ernährung und Garmin-Fitness von Moritz.",
|
||||
"start_url": "/moritz.html",
|
||||
"start_url": "/family/moritz.html",
|
||||
"scope": "/family/",
|
||||
"display": "standalone",
|
||||
"background_color": "#f8fafc",
|
||||
"theme_color": "#ffffff",
|
||||
@@ -1089,23 +1090,22 @@ def main():
|
||||
print("Building Moritz Health Dashboard from DuckDB...")
|
||||
html = generate_dashboard_html(engine)
|
||||
|
||||
# 1. Save locally to knowledge-wiki/public/moritz.html (and also nutrition.html for legacy compatibility)
|
||||
wiki_public = data_dir.parent / "public"
|
||||
wiki_public.mkdir(parents=True, exist_ok=True)
|
||||
out_file = Path(args.output_file) if args.output_file else (wiki_public / "moritz.html")
|
||||
# 1. Save locally strictly to knowledge-wiki/public/family/moritz.html (and nutrition.html)
|
||||
wiki_public_family = data_dir.parent / "public" / "family"
|
||||
wiki_public_family.mkdir(parents=True, exist_ok=True)
|
||||
out_file = Path(args.output_file) if args.output_file else (wiki_public_family / "moritz.html")
|
||||
out_file.write_text(html, encoding="utf-8")
|
||||
print(f"✅ Saved locally: {out_file}")
|
||||
|
||||
# Also keep public/family/nutrition.html in sync
|
||||
family_nutrition = wiki_public / "family" / "nutrition.html"
|
||||
if family_nutrition.parent.is_dir():
|
||||
family_nutrition.write_text(html, encoding="utf-8")
|
||||
print(f"✅ Synced locally: {family_nutrition}")
|
||||
family_nutrition = wiki_public_family / "nutrition.html"
|
||||
family_nutrition.write_text(html, encoding="utf-8")
|
||||
print(f"✅ Synced locally: {family_nutrition}")
|
||||
|
||||
# 2. Upload to S3 hosting
|
||||
# 2. Upload strictly to protected S3 hosting under /family/
|
||||
if not args.skip_upload:
|
||||
try:
|
||||
url = publish_to_s3(html, key="moritz.html")
|
||||
url = publish_to_s3(html, key="family/moritz.html")
|
||||
print(f"🚀 Published successfully to: {url}")
|
||||
# Also publish to /family/nutrition.html for backwards compatibility
|
||||
publish_to_s3(html, key="family/nutrition.html")
|
||||
|
||||
Reference in New Issue
Block a user