fix(serve): close the developer dashboard when a config reload removes its key

This commit is contained in:
imSp4rky
2026-11-26 13:40:04 -07:00
parent 34ce5e5ae8
commit 7bba51910d
5 changed files with 55 additions and 8 deletions
+5 -3
View File
@@ -161,7 +161,7 @@ is the [REST API](../../dev/rest-api/index.md) section. These are the config key
| `tiers` | dict | `{}` | Named settings that `users` entries reference by name (see below). |
| `services` | list | *(unset)* | Global service allowlist. Omit to allow all. |
| `remote_only` | bool | `false` | Expose only the remote service session endpoints (health, services, search, session) and disable the rest of the REST API. |
| `dashboard` | dict | *(unset)* | Developer dashboard: `key` is the API key for the read-only `/api/dashboard/` endpoints (status, remote sessions, remote session logs, jobs, keys, services, health, logs, SSE events). Unset leaves those routes unregistered. See [dashboard endpoints](../../dev/rest-api/dashboard.md). |
| `dashboard` | dict | *(unset)* | Developer dashboard: `key` is the API key for the read-only `/api/dashboard/` endpoints (status, remote sessions, remote session logs, jobs, keys, services, health, logs, SSE events). Unset leaves those routes unregistered, and a reload that removes the key makes them answer `404`. See [dashboard endpoints](../../dev/rest-api/dashboard.md). |
| `session_ttl` | int (s) | `300` | Seconds a remote session can stay idle before it expires. A remote client sends keep-alive requests to its remote session during a download, so the remote session does not expire during a long download. |
| `max_sessions` | int or null | `100` | Maximum concurrent remote sessions; at the cap the server evicts the oldest remote session of the API key that holds the most. Set it to `null` or `0` for no limit, which is also what `/api/dashboard/status` then reports, so a dashboard can tell "no cap" from a cap that happens to sit at the default. |
| `history_limit` | int | `100` | How many finished jobs to retain in history. |
@@ -188,8 +188,10 @@ list.
`tiers`, `services` and device lists in one step. Open CDM sessions and remote sessions
continue; an API key you removed gets `401` on its next request. A file that does not parse
or validate keeps the running settings and logs the reason. A change to `remote_only`,
`services_refresh_interval`, the first PlayReady device, or any command-line flag needs
a restart, and the log says so. A new `global_speed_limit` applies to jobs that start after the
`services_refresh_interval`, the first PlayReady device, a `dashboard.key` on a server that
started without one, or any command-line flag needs a restart, and the log says so. A reload
that removes `dashboard.key` closes the dashboard: its routes answer `404` and an open
`/api/dashboard/events` connection ends. A new `global_speed_limit` applies to jobs that start after the
reload; running jobs keep their share. Windows has no `SIGHUP`: restart the server there.
`server_cdm` decides whether the server runs the CDM licensing for that API key. Set it to