From f9e22171de54427b202865c489522deb06ea5364 Mon Sep 17 00:00:00 2001 From: gilesb Date: Wed, 7 Jan 2026 19:40:59 +0000 Subject: [PATCH] feat: add L1_PUBLIC_URL config for many-to-many L1/L2 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .env.example | 3 +++ server.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 128f15b..d58eee8 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,8 @@ # L1 Server Configuration +# This L1 server's public URL (sent to L2 when publishing) +L1_PUBLIC_URL=https://l1.artdag.rose-ash.com + # L2 server URL (for authentication and publishing) L2_SERVER=https://artdag.rose-ash.com diff --git a/server.py b/server.py index 7bb8cb0..5ccd17f 100644 --- a/server.py +++ b/server.py @@ -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('
Not logged in
') - # 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 )