You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(nodepool): create transcode nodes and their keys from the API servers' configuration - #4654
Related issue: N/A (discussion #4594)
Validation tasks: none changed. The change reaches #1177 C1 and #1178 C1/C3: registering a node in the admin UI and running without any node configuration behave as before.
Other clients: N/A (node administration exists only in the web admin, which this pull request updates)
A transcode node can't be set up from deployment configuration alone. Since #4499 a node declares its own name, URL and settings from SILO_NODE_*, but its row still has to exist and its key still has to be issued in the admin UI before it gets any work. A Kubernetes or Compose deployment therefore needs a manual step for every new node.
This change lets the API servers create transcode nodes and their keys from their own configuration. With SILO_TRANSCODE_NODES (inline JSON) or SILO_TRANSCODE_NODES_FILE (YAML or JSON) set, each API server creates every listed node that has no row yet, at startup and before it loads its node pools. A node then needs only SILO_CORE_URL and SILO_NODE_KEY.
Document. Same shape and reader as SILO_PLUGINS (feat(plugins): install and configure official plugins from the environment #4602). The YAML, file and secret-file helpers moved from internal/plugins into a small shared package, internal/provisiondoc. A key is always a fromFile or fromEnv reference, never inline. Field names match exactly, and errors never repeat a value or an unknown field's name. The node id comes from the key (snk1_<id>_…), so the operator chooses it. silo node-key generate --id <n> prints a key.
Startup pass. One transaction holds the transcode URL lock and an EXCLUSIVE lock on stream_nodes, which also waits for admin edits that hold a row lock. It decides every entry before writing anything, and it moves the id sequence with ALTER SEQUENCE … RESTART, which rolls back with the transaction. A refusal or a failed pass therefore leaves the table and the id sequence unchanged. API servers that start together apply the document one at a time.
Created: a listed id with no row becomes an enabled transcode node with the declared name, URL and key. The id must be above every id the sequence has handed out, so a deleted node's id is never reused. The URL must not belong to another node.
Unchanged or rotated: a node the configuration already owns is left alone when the key matches, and takes the new key when it doesn't.
Adopted: a transcode node that already holds the declared key is taken over.
Refused: the id belongs to a proxy, a keyless node, or a node with a different key from the admin UI. The API server stops with a message naming the entry.
The name and URL are used only when the row is created. After that, the node's own SILO_NODE_* declaration or the admin UI owns them.
Ownership. The new column stream_nodes.deployment_managed records which nodes the configuration owns. While it is set, issuing a key and deleting the node return 409 with the new problem type node_deployment_managed. Both checks run in the database write, so every API server refuses the same way. A document that no longer lists a node, including nodes: {}, hands the node back to the admin UI with its key. Leaving both variables unset changes nothing.
API. Node rows gain deployment_managed, and the node capabilities gain deployment_nodes. docs/admin-api.md is updated.
Web admin. A managed node shows "Key set by the server's deployment configuration" and has no Rotate key action. Its Delete button looks disabled but stays focusable, and pressing it shows why it can't be deleted and that the API servers must restart. The strings are in silo-translations#109 and feat(jellycompat): BoxSet collections, genre-by-name, and airtight ABS media exclusion #115 (both merged), and the web app is pinned to release 2026.11.20-0aeb75c.
Docs.docs/architecture/transcode-nodes.md gains a "Declared nodes" section. .env.example, docs/update-to-1.0.md, omnibus-image.md and worker-http-protocol.md are updated.
Like the env settings from #4498, every API server needs the same document; if they differ, the last one to start wins. I chose that over a revision scheme for rolling deploys. A Kubernetes rollout restarts each API server with the current Secret, so the newest document still ends up applied.
Validation
Go: build, gofmt, go mod tidy -diff, go vet ./..., make lint-changed, make lint-router-recovery and make test-go pass.
Postgres: make test-db-pins (pins and contracts) passes on a freshly migrated database, including the provisioning tests, which are registered in scripts/ci/db-contracts.txt. The backup tests that skip without PostgreSQL client tools were rerun with them and pass. Breaking the guard against taking over another node's row makes the provisioning test fail. The review round added two Postgres tests that fail on the earlier code: one deadlocked against an admin edit's row lock, and in the other a retry after a failed pass refused its own ids.
Web: lint, format check, build, budget check pass. make test-web passed 3033 of 3035. The two timeouts are in files this change does not touch (collections selection, the player's range source), and both pass when rerun alone.
Contracts and hygiene: every verify-* target in CONTRIBUTING passes. I ran actionlint and ShellCheck at the pinned versions directly.
End to end on a sandbox with a proxy, an admin-keyed transcode node and a second transcode node configured only by SILO_CORE_URL and SILO_NODE_KEY:
Listing the admin-keyed node's id with a different key stopped the API server with a message and changed nothing.
A new id was created at startup, and its node came up healthy with no admin action.
Issuing it a key returns 409 node_deployment_managed. Deleting it returns 428 without If-Match and 409 with it.
In the web app, the managed node's Delete button takes keyboard focus, and Enter or a click shows the reason without opening the delete dialog. The admin-keyed node's Delete still opens its confirmation.
After the review round, the Go packages this touches, the contract and hygiene checks, web lint, format and typecheck, and the node web tests pass again. CI runs the full suites.
The page has desktop and phone-width captures of the Stream Nodes page, showing a managed node next to an admin-keyed one, plus the API results and the gate run.
Risks
Migration adds a boolean NOT NULL DEFAULT false column to stream_nodes. That's a fast metadata-only change.
A bad document stops API server startup on purpose. A node the operator listed should not be left without a usable key while the server reports healthy.
Removing a node from the document keeps its key, and the admin UI manages it again. To revoke a key, rotate it in the secret store or issue a new one in the admin UI after the release.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code, OpenAI Codex and Antigravity (council review through T3 Code), GitHub CLI
Council: Sol and Neon, 2 rounds, reviewed the plan
Adversarial review: Sol and Neon reviewed the design twice before implementation. Round one rejected nodes creating their own rows, because of races and an unsafe pending-key state, which led to API servers creating the rows. Round two led to storing ownership in the database and checking it in each write, the table lock with the decide-then-write order, never reusing a deleted id, provisioning before the first pool load, and a dedicated problem type for the 409. A suggestion to add revisions for API servers with different documents was declined in favor of the feat(config): set server settings from environment variables #4498 rule. Admin-created proxies skip the URL check other node writes get; that gap predates this change and is left for a follow-up.
Add deployment-configuration provisioning for transcode nodes
API servers can now declare transcode nodes and their keys via SILO_TRANSCODE_NODES or SILO_TRANSCODE_NODES_FILE; on startup, provisionTranscodeNodes in cmd/silo/node_provisioning.go creates nodes, rotates keys, adopts matching rows, and releases undeclared ones in one transaction
New silo node-key generate --id <n> CLI command produces node keys for declaration. Node IDs are capped at the PostgreSQL integer limit (MaxNodeID)
Deployment-managed nodes reject admin key issuance and deletion with a new 409 node_deployment_managed problem; the admin UI hides these actions. Node responses gain a deployment_managed field and capabilities gain deployment_nodes
YAML/JSON document parsing and bounded file reads are shared via a new provisiondoc package, reused by the plugins provision loader
Risk: startup now fails (log.Fatalf) on declaration read or provisioning errors. Migration 20261120021200_add_stream_node_deployment_managed.sql adds a non-null deployment_managed column. Provisioning refuses to reuse previously allocated IDs or conflicting URLs, so check declaration IDs against existing nodes
…rvers' configuration
API servers read SILO_TRANSCODE_NODES (JSON) or SILO_TRANSCODE_NODES_FILE
(YAML or JSON) and, at startup, create each listed transcode node with the
key the document references, so a node needs no admin step. A new
deployment_managed column records which rows the configuration owns; the
admin API refuses to issue a key for or delete such a node with the new
node_deployment_managed problem. `silo node-key generate --id <n>` prints a
key.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).
The change adds API-server configuration for provisioning transcode nodes, including startup application and managed-node restrictions. It updates the admin API and UI, adds a node-key generation command, and revises related documentation and locale catalogs.
Declarations can be read from inline JSON or a JSON/YAML file. Parsing validates node fields and key references. Shared bounded file-reading and YAML conversion utilities replace corresponding local plugin helpers.
API-server startup applies declarations before loading node pools and publishes a pool-change event when state changes. The CLI adds silo node-key generate --id. Setup and architecture documentation describes configuration and startup behavior.
Managed-node API and administration UI internal/apiv2/*, contracts/api/v2/openapi.json, docs/admin-api.md, web/src/api/types.ts, web/src/api/v2/schema.ts, web/src/hooks/queries/admin/nodes.ts, web/src/pages/AdminNodes.tsx
The API exposes managed-node status and a capability flag, and returns a 409 problem for prohibited operations. The UI displays managed status, disables key and delete controls, and shows server conflict messages.
Localized node and playback messages .silo-translations, web/src/locales/keys.ts, web/src/locales/*.json
Locale catalogs add managed-node messages, recent-playback activity messages, and an unconfirmed playback-message notice. The generated message-key union and translation metadata are updated.
Declarative node provisioning has a few edge-case defects that should be fixed before merge. A case-variant "Nodes" member can release all managed nodes. A failed startup can leave the sequence advanced so the same configuration is refused afterwards. A mistyped key reference can put a node key into logs. Provisioning can also deadlock with a concurrent admin edit or delete. The rest of the change looks sound.
Security architecture risk: Moderate · up to 4bb3f
An interrupted provisioning pass can consume configured node IDs without creating their rows. Subsequent API-server starts using the unchanged declaration then fail, potentially blocking a deployment until operators repair the identity and key configuration. The inspected admin key and deletion paths otherwise preserve deployment ownership controls.
Retained concerns
Medium · reliability · inferred: Provisioning cannot reliably recover with the same declaration after a post-setval rollback. apply advances the identity sequence before inserting and committing node rows. If application fails or the API process is interrupted afterward, row changes roll back but the sequence advance survives. On repetition, identityWatermark includes that advance and create rejects the now-consumed declared IDs. Every API server applying that declaration consequently fails startup until operator intervention. The table locks and decide-before-write planning prevent competing writes and validation-time partial application, but do not restore this recovery invariant.
Security review details
Security Blast Radius
inferred — The new authority applies across the transcode-node rows in the shared database: deployment configuration can create identities, replace managed credentials, and release omitted ownership. The retained recovery concern can block all restarting API servers applying the affected declaration, while already-running servers are not directly stopped by that failed startup transaction. No unprivileged request path to controlling the declaration was established in the inspected scope.
Trust Boundaries and Controls
observed — The inspected key-issuance path remains behind authentication, viewer-access, and acting-admin gates. Router wiring connects the API service adapter to Repository.IssueNodeKey, which enforces NOT deployment_managed in the credential-writing UPDATE. The adapter propagates refusal before refresh or publication, and the API maps it to the deployment-managed problem. This resolves the supplied uncertainty about caller-side enforcement.
Resilience and Maintainability Implications
inferred — The sequence watermark preserves the no-ID-reuse policy after failed provisioning, but cannot distinguish an interrupted creation from a retired identity. This fails closed against identity reuse while sacrificing automatic startup recovery with the same declaration. Successful repeated application with matching managed keys is otherwise a no-change operation.
Hardening Proposals
proposed — Introduce durable provisioning identity or reservation state that distinguishes an interrupted creation from a retired node, allowing safe repetition without weakening the no-ID-reuse guarantee. Define recovery explicitly for interruption between sequence advancement and row commit.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(nodepool): create transcode nodes and their keys from the API servers' configuration" matches the main change. The changeset adds startup provisioning of transcode nodes and their keys…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description matches the changeset. It explains the problem (transcode nodes need manual admin setup), and it describes the fix: API servers provision nodes and keys from SILO_TRANSCODE_NODES or SI…
Full details: Title check
Explanation
The title "feat(nodepool): create transcode nodes and their keys from the API servers' configuration" matches the main change. The changeset adds startup provisioning of transcode nodes and their keys from SILO_TRANSCODE_NODES or SILO_TRANSCODE_NODES_FILE, implemented in internal/nodepool/provision.go and cmd/silo/node_provisioning.go, along with the deployment_managed ownership flag. The title is concise, specific, and follows a conventional commit format.
Full details: Description check
Explanation
The description matches the changeset. It explains the problem (transcode nodes need manual admin setup), and it describes the fix: API servers provision nodes and keys from SILO_TRANSCODE_NODES or SILO_TRANSCODE_NODES_FILE. It also covers the deployment_managed ownership flag, the 409 node_deployment_managed refusal, the web admin changes, the docs, and validation steps. These all match the files in the raw summary.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Exercise YAML redaction through SILO_TRANSCODE_NODES_FILE.
This fixture goes through inline, which rejects YAML before the YAML decoder runs. The assertion cannot catch a regression in YAML-file error redaction. Write the fixture to a temporary file and check that ReadNodeProvisioning rejects it without including key7 in the error.
Move the operator setup procedure to the user manual.
Move the YAML setup example, key-delivery instructions and rotation restart procedure to the manual. Keep the transaction, ownership and implementation contracts here, with a link to the manual. This keeps operator procedures in one maintained location.
As per coding guidelines, “Guides for installing, configuring, operating, or troubleshooting Silo belong in the user manual.”
Source: Coding guidelines
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a4625cef-46db-4190-b542-d0365323e291
Commits
Reviewing files that changed from the base of the PR and between 232ebad and 4bb3fb9.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
- Take an EXCLUSIVE lock on stream_nodes: SHARE ROW EXCLUSIVE admitted an
admin edit's SELECT ... FOR UPDATE, and the two deadlocked when both wrote
the row.
- Move the id sequence with ALTER SEQUENCE ... RESTART, which rolls back with
a failed pass; setval left the ids burned and the retry refused them.
- Match declaration field names exactly and never name an unknown one in an
error; refuse a fractional YAML apiVersion that yaml.v3 rounds to 1.
- Keep the managed node's Delete button focusable and show its reason when
pressed; the reason names the API server restart (silo-translations#115).
- Describe both variables and the unset case in the API, and correct the
upgrade docs: an existing node is adopted with an admin-issued key.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The architecture section keeps the invariants (last API server wins, a
declared key changes at the next start, ALTER SEQUENCE needs the owning role
that runs migrations); rotation and adoption steps belong to the manual. The
upgrade guide says a new id must be above every id handed out, and the
deployment_nodes capability describes release and the unset case.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Resolve merge conflicts with #4654 in docs/architecture/transcode-nodes.md
and internal/plugins/provision_document.go, and delegate
internal/provisiondoc's ReadFile and ReadSecretFile to internal/envutil so
both provisioning documents and _FILE variables share one file reader.
#4665 landed as a squash with one more commit (74d5ebe), so its files take
main's version. internal/plugins/provision_document.go keeps main's
provisiondoc reader from #4654 and this branch's four document variables and
ai_providers section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enhancementNew feature or requestgoPull requests that update go codejavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/XXL1000–2999 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A (discussion #4594)
Validation tasks: none changed. The change reaches #1177 C1 and #1178 C1/C3: registering a node in the admin UI and running without any node configuration behave as before.
Other clients: N/A (node administration exists only in the web admin, which this pull request updates)
A transcode node can't be set up from deployment configuration alone. Since #4499 a node declares its own name, URL and settings from
SILO_NODE_*, but its row still has to exist and its key still has to be issued in the admin UI before it gets any work. A Kubernetes or Compose deployment therefore needs a manual step for every new node.This change lets the API servers create transcode nodes and their keys from their own configuration. With
SILO_TRANSCODE_NODES(inline JSON) orSILO_TRANSCODE_NODES_FILE(YAML or JSON) set, each API server creates every listed node that has no row yet, at startup and before it loads its node pools. A node then needs onlySILO_CORE_URLandSILO_NODE_KEY.Approach
SILO_PLUGINS(feat(plugins): install and configure official plugins from the environment #4602). The YAML, file and secret-file helpers moved frominternal/pluginsinto a small shared package,internal/provisiondoc. A key is always afromFileorfromEnvreference, never inline. Field names match exactly, and errors never repeat a value or an unknown field's name. The node id comes from the key (snk1_<id>_…), so the operator chooses it.silo node-key generate --id <n>prints a key.EXCLUSIVElock onstream_nodes, which also waits for admin edits that hold a row lock. It decides every entry before writing anything, and it moves the id sequence withALTER SEQUENCE … RESTART, which rolls back with the transaction. A refusal or a failed pass therefore leaves the table and the id sequence unchanged. API servers that start together apply the document one at a time.SILO_NODE_*declaration or the admin UI owns them.stream_nodes.deployment_managedrecords which nodes the configuration owns. While it is set, issuing a key and deleting the node return 409 with the new problem typenode_deployment_managed. Both checks run in the database write, so every API server refuses the same way. A document that no longer lists a node, includingnodes: {}, hands the node back to the admin UI with its key. Leaving both variables unset changes nothing.deployment_managed, and the node capabilities gaindeployment_nodes.docs/admin-api.mdis updated.2026.11.20-0aeb75c.docs/architecture/transcode-nodes.mdgains a "Declared nodes" section..env.example,docs/update-to-1.0.md,omnibus-image.mdandworker-http-protocol.mdare updated.Like the env settings from #4498, every API server needs the same document; if they differ, the last one to start wins. I chose that over a revision scheme for rolling deploys. A Kubernetes rollout restarts each API server with the current Secret, so the newest document still ends up applied.
Validation
go mod tidy -diff,go vet ./...,make lint-changed,make lint-router-recoveryandmake test-gopass.make test-db-pins(pins and contracts) passes on a freshly migrated database, including the provisioning tests, which are registered inscripts/ci/db-contracts.txt. The backup tests that skip without PostgreSQL client tools were rerun with them and pass. Breaking the guard against taking over another node's row makes the provisioning test fail. The review round added two Postgres tests that fail on the earlier code: one deadlocked against an admin edit's row lock, and in the other a retry after a failed pass refused its own ids.make test-webpassed 3033 of 3035. The two timeouts are in files this change does not touch (collections selection, the player's range source), and both pass when rerun alone.verify-*target in CONTRIBUTING passes. I ran actionlint and ShellCheck at the pinned versions directly.SILO_CORE_URLandSILO_NODE_KEY:node_deployment_managed. Deleting it returns 428 withoutIf-Matchand 409 with it.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4654/
The page has desktop and phone-width captures of the Stream Nodes page, showing a managed node next to an admin-keyed one, plus the API results and the gate run.
Risks
boolean NOT NULL DEFAULT falsecolumn tostream_nodes. That's a fast metadata-only change.Checklist
AI Disclosure
claude-opus-5-5,gpt-6.2-sol,gemini-4-neon🤖 Generated with Claude Code
Note
Add deployment-configuration provisioning for transcode nodes
SILO_TRANSCODE_NODESorSILO_TRANSCODE_NODES_FILE; on startup,provisionTranscodeNodesin cmd/silo/node_provisioning.go creates nodes, rotates keys, adopts matching rows, and releases undeclared ones in one transactionsilo node-key generate --id <n>CLI command produces node keys for declaration. Node IDs are capped at the PostgreSQL integer limit (MaxNodeID)409 node_deployment_managedproblem; the admin UI hides these actions.Noderesponses gain adeployment_managedfield and capabilities gaindeployment_nodesprovisiondocpackage, reused by the plugins provision loaderlog.Fatalf) on declaration read or provisioning errors. Migration 20261120021200_add_stream_node_deployment_managed.sql adds a non-nulldeployment_managedcolumn. Provisioning refuses to reuse previously allocated IDs or conflicting URLs, so check declaration IDs against existing nodesMacroscope summarized 9d93a6d.