From 9d961c3fc84a5fbd1ef45e3e47c5f227ae5ffb8b Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Sun, 4 Oct 2026 10:02:56 +0200 Subject: [PATCH] Say that the admin API wants its token, and that ctl runs with sudo Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 10 ++++++++++ docs/install.md | 14 ++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb96e7e..ee1470c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,16 @@ APIs change between minors without a deprecation period. add` makes the user; a node without it keeps running engines as root and the agent says so in its log. `supervisor.run_as` in agent.yaml names another user, or `root`. +- **The admin API wants a token.** It listened on loopback with no + authentication, so any process or user on the control plane could add a + model, upgrade the fleet, read the engines' keys or dump the heap through + pprof. Its `/api` and `/debug` paths now demand the token the server + writes, 0600, to its state directory (`/var/lib/llmgw/admin-token`) on + first start; `llmgw ctl`, the console and `node add` read it, so they run + with sudo, and `LLMGW_ADMIN_TOKEN` or `ctl --token-file` give it from + elsewhere. pprof is off unless `debug_pprof: true`. `admin_listen` off + loopback is refused unless `admin_remote: true`. The read-only dashboard + pages, `/metrics` and `/health` are unchanged. ### Everything that can be changed on a running cluster, from the console diff --git a/docs/install.md b/docs/install.md index d4caeb6..5bd4f6c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -184,7 +184,7 @@ forwarded headers right; both are attached to every release. ``` curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/health # 200 -llmgw ctl status +sudo llmgw ctl status ``` `ctl status` will report no nodes and no models, which is correct — nothing has @@ -196,9 +196,15 @@ password, change it, and issue yourself a key from the profile page. `/etc/llmgw/server.yaml` is yours from here on. Three things in it are worth knowing before you edit it: -- `admin_listen` is on loopback on purpose. It serves pprof, which can dump the - process heap, and API keys sit in that heap in plaintext. To see the dashboard - from elsewhere use `/admin` on the client port — do not move this listener. +- `admin_listen` is on loopback on purpose, and the server refuses any other + address unless `admin_remote: true`. Its API under `/api` adds models and + upgrades nodes, so it also wants a token: the server writes one, 0600, to + `/var/lib/llmgw/admin-token` the first time it starts, and `llmgw ctl` + reads it from there — which is why `llmgw ctl` runs with sudo. + `LLMGW_ADMIN_TOKEN` gives it from elsewhere. pprof, whose heap holds the API + keys requests presented, is off unless `debug_pprof: true`, and then behind + the token too. To see the dashboard from elsewhere use `/admin` on the + client port — do not move this listener. - `default_rpm`, `default_tpm` and `default_price` are what make limits and budgets mean anything. Without a price every request costs zero and a budget never binds; without the defaults, a project created without limits is