feat: add GET /api/instance-info endpoint
Implement new public endpoint that returns device name and version without authentication required. The auth exemption was already in place from task 4.
This commit is contained in:
@@ -498,6 +498,17 @@ async def update_settings(request: Request) -> dict:
|
||||
return patch_settings(body)
|
||||
|
||||
|
||||
@app.get("/api/instance-info")
|
||||
async def instance_info() -> dict:
|
||||
"""Return this instance's display name and version.
|
||||
|
||||
Public endpoint (no auth required) — used by remote instances to
|
||||
discover peer names and verify reachability.
|
||||
"""
|
||||
settings = load_settings()
|
||||
return {"name": settings["device_name"], "version": app.version}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# WebSocket proxy — bridges browser to ttyd (eliminates Caddy dependency)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user