Commit 6a17c7f
authored
[cueweb/docs] Add per-facility connection health and runtime facility config (#2439)
## Related Issues
Main issue:
- #2016
Issues related to this PR:
- #2440
## Summarize your change.
[cueweb] Add per-facility connection health and runtime facility config
- [x] Build on the Cuebot Facility switcher with live per-facility
health and a runtime config admin screen, so each facility's gateway can
be monitored and re-pointed without a redeploy.
- [x] Per-facility health: app/api/facility/health probes every
configured facility's REST gateway in parallel and returns { name, ok,
latencyMs }. The header Cuebot Facility menu polls it every 30s
(use_facility_health),
shows a green/red dot per facility, and disables selecting a facility
whose gateway is down.
- [x] Runtime override store (lib/facility-store.ts): file-backed
per-facility gateway URL / JWT secret overrides plus an append-only
audit log. Layered over the env defaults by lib/facility-server.ts
(override > env > legacy), so an empty store reproduces the env-only
behavior exactly. Cached briefly to keep the per-request resolver off
the hot filesystem path; the JWT secret is written 0600 and never logged
or returned to clients.
- [x] Admin screen at /settings/facilities: edit each facility's gateway
URL and JWT secret at runtime (applied without redeploy) via a server
action, with a change-history table. Reachable from the "Manage
facilities…" item in the header facility menu.
- [x] Server/client split: move the gateway helpers (createJwtToken,
fetchObjectFromRestGateway, handleRoute) out of api_utils.ts into a
server-only app/utils/gateway_server.ts, and the override-aware
resolvers into lib/facility-server.ts. This keeps the filesystem-backed
store out of the client bundle (Next.js forbids node:fs in the client
graph, which api_utils is part of). All route handlers now import
handleRoute from gateway_server; lib/facility.ts stays pure/client-safe.
- [x] Document CUEWEB_FACILITY_STORE in .env.example (point it at a
mounted volume to persist overrides across container restarts).
[cueweb/docs] Document per-facility health and runtime facility config
Document the per-facility connection health + runtime config feature
across the CueWeb docs, and add the supporting screenshots.
- [x] quick-starts: the green/red health dot (30s poll, down = disabled)
and the Manage facilities... runtime admin screen +
CUEWEB_FACILITY_STORE persistence.
- [x] concepts: a "Per-facility health and runtime configuration"
subsection - the live health probe (reachability + latency only, down
facilities un-selectable) and the override model (resolution order
override > env > legacy default, file-backed store + audit log,
server-only credentials).
- [x] deploying-cueweb: document CUEWEB_FACILITY_STORE (mount a volume
to persist) and the runtime Manage-facilities screen + admin-gating
note.
- [x] other-guides + user-guide (user-facing): the Cuebot Facility menu
now shows a green/red health dot per facility (a down facility can't be
selected) and a "Manage facilities..." item; add a short how-to for the
admin screen (edit each facility's gateway URL / JWT secret at runtime,
change history, blank URL falls back to the default).
- [x] reference: add the CUEWEB_FACILITY_STORE env var; extend the
Cuebot Facility dropdown entry; add a GET /api/facility/health section
and a "Per-facility health and runtime config" section (resolution
order, override store, audit log, write serialization, fail-closed
authz).
- [x] tutorials: health-dot behavior in the switch step plus a
"Re-pointing a facility at runtime (admin)" walkthrough with the
manage-facilities screenshots and the admin-gating /
CUEWEB_FACILITY_STORE note.
- [x] developer-guide: add lib/facility-server.ts,
lib/facility-store.ts, app/utils/use_facility_health.ts,
app/utils/gateway_server.ts, app/settings/facilities/ and
api/facility/health/ to the file trees, plus an implementation note
(server/client split, store + audit, authz).
- [x] README: extend the Cuebot Facility entry with the per-facility
gateway pair, /api/facility/health polling + dot, and the Manage
facilities... screen.
## LLM usage disclosure
Parts of this solution's implementation were developed with assistance
from Claude Opus.1 parent 92f7ba7 commit 6a17c7f
113 files changed
Lines changed: 1258 additions & 262 deletions
File tree
- cueweb
- app
- __tests__/api/utils
- api
- allocation/getall
- comment/action
- delete
- save
- facility/health
- frame
- action
- createdependonframe
- createdependonjob
- createdependonlayer
- eat
- kill
- retry
- getframe
- group
- action
- reparentgroups
- reparentjobs
- getjobs
- health
- host
- action
- addtags
- lock
- rebootwhenidle
- reboot
- redirecttojob
- removetags
- unlock
- findhost
- getcomments
- gethosts
- getprocs
- job
- action
- addcomment
- addsubscriber
- createdependonframe
- createdependonjob
- createdependonlayer
- dropdepends
- eatframes
- getdepends
- getwhatdependsonthis
- killframes
- kill
- pause
- retryframes
- setautoeat
- setmaxcores
- setmaxretries
- setmincores
- setpriority
- unpause
- getcomments
- getframes
- getjobs
- getjob
- getlayers
- submit
- layer/action
- createdependonframe
- createdependonjob
- createdependonlayer
- createframebyframedepend
- eatframes
- kill
- retryframes
- setmincores
- limit
- action
- create
- delete
- rename
- setmaxvalue
- getall
- proc/action/unbook
- redirect/search
- service
- create
- delete
- getdefaultservices
- update
- show
- action
- createsubscription
- enablebooking
- enabledispatching
- setcommentemail
- setdefaultmaxcores
- setdefaultmincores
- createshow
- findshow
- getactiveshows
- getgroups
- getshows
- getsubscriptions
- stuck-frames
- subscription
- delete
- setburst
- setsize
- settings/facilities
- utils
- components/ui
- lib
- docs
- _docs
- concepts
- developer-guide
- getting-started
- other-guides
- quick-starts
- reference
- tutorials
- user-guides
- assets/images/cueweb
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments