Document the local router for open source and warn when it is not bound to loopback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
richarjiang
2026-09-24 10:08:09 +08:00
parent eae4df7d51
commit c4582ba810
3 changed files with 221 additions and 41 deletions

View File

@@ -81,6 +81,12 @@ def cmd_serve(_: argparse.Namespace) -> int:
print(f"laya-router {__version__} on {settings.base_url}", flush=True)
print(f"看板 {settings.base_url}/", flush=True)
if settings.host not in {"127.0.0.1", "localhost", "::1"}:
print(
f"警告: 服务绑定在 {settings.host},没有鉴权。看板和 /route 会暴露 prompt。请改回 127.0.0.1。",
file=sys.stderr,
flush=True,
)
uvicorn.run(
"laya_router.server:app",
host=settings.host,