feat: add L1_PUBLIC_URL config for many-to-many L1/L2 support

- Add L1_PUBLIC_URL environment variable
- UI publish sends L1 URL to L2 so it knows where to fetch run data
- Update .env.example with new config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-07 19:40:59 +00:00
parent 223568df3f
commit f9e22171de
2 changed files with 6 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ from tasks import render_effect
# L2 server for auth verification
L2_SERVER = os.environ.get("L2_SERVER", "http://localhost:8200")
L2_DOMAIN = os.environ.get("L2_DOMAIN", "artdag.rose-ash.com")
L1_PUBLIC_URL = os.environ.get("L1_PUBLIC_URL", "http://localhost:8100")
# Cache directory (use /data/cache in Docker, ~/.artdag/cache locally)
CACHE_DIR = Path(os.environ.get("CACHE_DIR", str(Path.home() / ".artdag" / "cache")))
@@ -1298,11 +1299,11 @@ async def ui_publish_run(run_id: str, request: Request, output_name: str = Form(
if not token:
return HTMLResponse('<div class="error">Not logged in</div>')
# Call L2 to publish the run
# Call L2 to publish the run, including this L1's public URL
try:
resp = http_requests.post(
f"{L2_SERVER}/registry/record-run",
json={"run_id": run_id, "output_name": output_name},
json={"run_id": run_id, "output_name": output_name, "l1_server": L1_PUBLIC_URL},
headers={"Authorization": f"Bearer {token}"},
timeout=10
)