Repository navigation
feat(docker): support starting Silo without root through the silo entrypoint - #3338
Conversation
…rypoint The image's s6 init needs root, so a container started with user: stopped at usermod. Keep Silo's own checks in the binary so the image can be run with entrypoint ["silo"] as an unprivileged uid: - Silo refuses MODE=proxy or transcode without NODE_URL instead of guessing one from its listen port; init-config no longer checks it. - The Jellyfin Web installer keeps npm's cache in its install workspace, since HOME is / for a uid with no passwd entry. - init-envfile stops a non-root start with a pointer to the silo entrypoint. - docs/architecture/omnibus-image.md describes starting without root and the rule that init scripts only do container work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Bootstrap node URL validation internal/config/bootstrap.go, internal/config/bootstrap_test.go |
LoadBootstrap rejects proxy and transcode modes when NODE_URL is empty. Tests cover these modes and modes that do not require the URL. |
Startup and documented node identity omnibus/rootfs/etc/s6-overlay/scripts/init-config, cmd/silo/main.go, docs/admin-api.md, docs/architecture/omnibus-image.md |
Omnibus initialization no longer checks NODE_URL. Silo reads the variable directly and rejects proxy and transcode modes without it. The documentation describes the requirement and node URL matching. |
Direct non-root startup
| Layer / File(s) | Summary |
|---|---|
Non-root entrypoint and setup omnibus/rootfs/etc/s6-overlay/scripts/init-envfile, docs/architecture/omnibus-image.md, docker-compose.advanced.yml |
init-envfile exits when run as a non-root user. The container comment and omnibus documentation describe starting Silo directly without root and list the effects of bypassing the init scripts. |
Web component install cache
| Layer / File(s) | Summary |
|---|---|
Workspace-local npm cache internal/jellycompat/web_component.go |
The default command runner is created after the temporary workspace and sets npm_config_cache to a directory inside it. The runner retains command execution and error handling. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Possibly related PRs
- Silo-Server/silo-server#3180: Changes the omnibus deployment’s non-root startup contract, which this PR also updates.
- Silo-Server/silo-server#3279: Requires
NODE_URLfor proxy and transcode modes ininit-config; this PR moves validation intoconfig.LoadBootstrap. - Silo-Server/silo-server#3319: Documents the omnibus root-required
/initpath and node URL requirement, both of which this PR updates.
Suggested labels: bug, impact: usability, needs-review, size/S
Suggested reviewers: rhainland, darthshadow
Merge Risk: 
Low · up to a5d2f
-
Non-root Compose deployments may fail until the documentation clearly explains the required service-level entrypoint and user settings.
Security architecture risk: 
Low · up to a5d2f
-
Non-root startup reduces required privileges, and node identity checks now apply consistently to direct startup. Operators must supply secrets, writable storage, and external services when bypassing container initialization. No introduced security vulnerability was established.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The changed startup boundary is selected through deployment-owned entrypoint, uid, and environment configuration, not a newly added request-controlled selector. Its immediate scope is the configured Silo process, writable storage, and supplied database and Redis connections. Deployment control-plane authorization is outside the available evidence.
Trust Boundaries and Controls
- observed — Direct startup skips the init layer’s root-validated FILE__ secret-file handling rather than weakening that validation. The documented contract requires secrets to be supplied through application configuration, and bootstrap continues to reject a missing or short SECRET_KEY. No alternate secret authority is introduced by the changed code.
Resilience and Maintainability Implications
- observed — The cache change preserves the installer’s existing operation locking, staged publication, and deferred workspace cleanup on returning success, failure, or cancellation paths. Repeated installations receive separate workspaces. Abrupt process termination and existing activation-recovery limitations are not repaired by this PR, but the cache change does not alter those transitions.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 4 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bae8fa216
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ployment The architecture doc kept a deployment checklist for starting without root; operator guides belong in the user manual. Keep the init-versus-binary rule and what code must not assume, and link siloserver.org for the steps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This PR changes operator-visible startup and installer behavior, but the Evidence section says there is no user-visible change. Please add before-and-after terminal captures (with the image/build or commit identified) showing: the non-root omnibus start’s new actionable refusal; a proxy or transcode start without Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
There was a problem hiding this comment.
Actionable comments posted: 3

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:
350d5530-7b01-4a65-ac51-a64b9b4a584b
Files selected for processing: 9-
cmd/silo/main.godocker-compose.advanced.ymldocs/admin-api.mddocs/architecture/omnibus-image.mdinternal/config/bootstrap.gointernal/config/bootstrap_test.gointernal/jellycompat/web_component.goomnibus/rootfs/etc/s6-overlay/scripts/init-configomnibus/rootfs/etc/s6-overlay/scripts/init-envfile
Files with no reviewable changes: 1-
- omnibus/rootfs/etc/s6-overlay/scripts/init-config
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
…-check URL The main server checks a node's health at its registered stream_nodes URL, which can differ from NODE_URL. Also say a deployment that sets user: must set the entrypoint to silo itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
Related issue: N/A
Validation tasks: none. #1177 C1–C3 ran nodes on this image, which already refused a node without
NODE_URL. The Jellyfin Web installer change is on the path of #1246 C1, which has not been run.Since Silo ships as one image, a deployment that runs PostgreSQL in its own container can no longer run Silo's container as an unprivileged user. The image starts s6-overlay's
/init, whose first steps remap thesiloaccount and re-own directories, sodocker run --user 1000:1000 --cap-drop ALL --security-opt no-new-privileges …stops withusermod: cannot lock /etc/passwd. A user running the separate-container layout reported this as a security downgrade from the old base image and suggested the fix this change takes: keep Silo's own behavior out of the init scripts and document startingsiloas the entrypoint.Two things stood in the way. A proxy or transcode node without
NODE_URLwas refused only byinit-config; Silo itself guessed a URL from its listen port, which gives two nodes on one port the same identity. And the Jellyfin Web installer let npm cache underHOME, which is/for a uid with no passwd entry, so an install failed withEACCES.Approach
MODE=proxyorMODE=transcodewithoutNODE_URLinconfig.LoadBootstrap, next to the existingSECRET_KEYcheck. The listen-port fallback and the duplicate check ininit-configare removed.init-envfile, the first init script, stops a non-root start with a message that says to startsilodirectly with an externalDATABASE_URL.docs/architecture/omnibus-image.mdgains "Starting without root": the rule that init scripts only do container work (accounts,/config, ownership, bundled services) while anything Silo needs lives in the binary, and what asilo-entrypoint start gives up (bundled services,PUID, ownership changes, GPU group discovery,FILE__secrets, supervision).docs/admin-api.mdand a comment indocker-compose.advanced.ymlfollow.An entrypoint wrapper that detected a non-root uid and ran Silo itself was tried first. It worked but put about 60 lines of shell, partly copying
init-config, into the image, and it did nothing for images built around the binary.Validation
make embed-stub,go build ./...,gofmt,go vet ./...,make lint-changed,make lint-router-recoverypass.make test-gopasses exceptinternal/api/handlersandinternal/ebookconvert, whose temp-directory permission checks reject the test host'sumask 002; both packages pass when rerun withumask 022. Web code is unchanged; the web gate was not run.make verify-shellcheck(ShellCheck 0.11.0) passes;make verify-local-pathspasses.--user 1000:1000, with and without--cap-drop ALL,no-new-privileges, and a/runtmpfs: prints the new message and exits 1.--entrypoint silo, uid 1000,--cap-drop ALL,no-new-privileges, external PostgreSQL,/configmount containingsilo: healthy in about 10 s. With an empty/configmount Silo does not start, because/var/lib/silolinks to the missing/config/silo; the doc says to create it.silo compat-web installin that container as uid 1000 withHOME=/: Jellyfin Web 12.1 installed. The same command on the publishedlatestfails withnpm error code EACCES.MODE=transcodewithoutNODE_URL: refused at startup with--entrypoint silo; under/initSilo exits and s6 restarts it every 5 s with the same message.Evidence
Operators see three changes at startup and install. Each was run against images built from this branch's first commit; the published
latest(built frommainat84cab92f3) was the before.--user 1000:1000and no entrypoint override. Before:usermod: cannot lock /etc/passwd; try again later.ands6-rc: warning: unable to start service init-adduser: command exited 1. After:Started as uid 1000, but this image's init needs root. To run without root, start silo directly (--entrypoint silo, or entrypoint: ["silo"] in Compose) with DATABASE_URL set to an external PostgreSQL.MODE=transcodewithoutNODE_URL. Before, from source: Silo started and loggedNODE_URL not set, using listen address. After: startup stops withbootstrap: MODE=transcode needs NODE_URL, ...; the wording after the comma changed in a later commit tothis node's own URL, which matches it to its entry on the main server.silo compat-web installas uid 1000 withHOME=/(entrypointsilo). Before:npm error code EACCES/npm error syscall mkdir. After: Jellyfin Web 12.1 installs.Risks
NODE_URLoutside this image, for example from the binary, now refuses to start instead of warning. Inside the image such a node already refused; it now restarts every 5 s with the error, as a badSECRET_KEYdoes, instead of stopping the container.HOMEbetween installs, so each install downloads its packages again.Silo-Server/siloserver.orgis drafted.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Support running Silo container without root via
siloentrypointconfig.LoadBootstrapnow returns an error when proxy or transcode mode starts without NODE_URL, replacing the check in theinit-configshell script (bootstrap.go, covered by new table-driven tests)cmd/silo/main.goremoves the localhost URL fallback and warning; startup relies on NODE_URL as requiredinit-envfileexits with a diagnostic when run as a non-root uid, before its existing setupnpm_config_cacheto a cache dir inside the temporary install workspace (web_component.go)Macroscope summarized a5d2fbe.