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:
@@ -1,5 +1,8 @@
|
|||||||
# L1 Server Configuration
|
# 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 URL (for authentication and publishing)
|
||||||
L2_SERVER=https://artdag.rose-ash.com
|
L2_SERVER=https://artdag.rose-ash.com
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ from tasks import render_effect
|
|||||||
# L2 server for auth verification
|
# L2 server for auth verification
|
||||||
L2_SERVER = os.environ.get("L2_SERVER", "http://localhost:8200")
|
L2_SERVER = os.environ.get("L2_SERVER", "http://localhost:8200")
|
||||||
L2_DOMAIN = os.environ.get("L2_DOMAIN", "artdag.rose-ash.com")
|
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 directory (use /data/cache in Docker, ~/.artdag/cache locally)
|
||||||
CACHE_DIR = Path(os.environ.get("CACHE_DIR", str(Path.home() / ".artdag" / "cache")))
|
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:
|
if not token:
|
||||||
return HTMLResponse('<div class="error">Not logged in</div>')
|
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:
|
try:
|
||||||
resp = http_requests.post(
|
resp = http_requests.post(
|
||||||
f"{L2_SERVER}/registry/record-run",
|
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}"},
|
headers={"Authorization": f"Bearer {token}"},
|
||||||
timeout=10
|
timeout=10
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user