Repository navigation
feat(omnibus): run proxy and transcode nodes on the omnibus image - #3178
Conversation
…vironment SILO_SEARCH_PROVIDER, SILO_MEILISEARCH_URL and SILO_MEILISEARCH_API_KEY, when set, win over the stored search settings on every start of an API server. Each value is normalized the way an admin save is, the ones that differ are stored in one batch through the encrypting settings store, and the keys are reported as managed by the environment, so the admin Search page locks them and saves of them are refused. ABS_PORT moves the Audiobookshelf listener the way JF_PORT moves the Jellyfin one, defaulting to 13378. The Compose files pin it inside the container, since .env uses ABS_PORT for the host side of the mapping. Closes #3105 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without the protected-credential status the Search page cannot tell which fields the environment sets, so a save of one could be refused. Disable the search engine, URL and API key fields and say to reload, as the General page does for Redis. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d Meilisearch The regular image needs two to four containers. The omnibus image runs Silo and PostgreSQL 18 with pgvector in one Ubuntu 24.04 container under s6-overlay, with Redis and Meilisearch bundled but off until ENABLE_REDIS or ENABLE_MEILISEARCH is set. Each service runs as its own user and keeps its data under /config/<service>; PUID and PGID map the silo user. The Silo binary and Node.js runtime are copied from the regular image of the same build, so nothing is compiled twice and both images run the same Silo. The Docker workflow builds the omnibus after the regular manifest is pushed and tags it with the same tags plus an -omnibus suffix. Enabling Meilisearch seeds the three catalog search settings before Silo starts, so search runs on Meilisearch without admin steps; disabling it switches the provider back to PostgreSQL. The image refuses to open a data directory from another PostgreSQL major version and explains the dump and restore path.
…llow MEILI_HTTP_ADDR A PUID equal to another account's uid made the kernel report that account's name for Silo's processes, so PostgreSQL peer authentication failed with a message that did not name the cause. Check before remapping and say which account holds the uid. The seeded Meilisearch URL was a fixed loopback address, so a deployment that set MEILI_HTTP_ADDR got a provider pointing at the wrong port. Derive the URL from the same variable the server reads, in both the enable and disable paths.
…nvironment Build the omnibus image on the regular Silo image of the same commit instead of Ubuntu 24.04. The Silo binary is built on Debian trixie, so on Ubuntu it ran against older libvips, glib, and Redis, and the FFmpeg and Intel runtime installs were duplicated. The base now changes on every build, so the build drops its layer cache, which would otherwise have held back PostgreSQL and Debian security updates. Service accounts get fixed ids so /config keeps valid owners across image updates. Connect search through SILO_SEARCH_PROVIDER, SILO_MEILISEARCH_URL, and SILO_MEILISEARCH_API_KEY instead of writing server_settings with psql. The old disable path never ran: psql does not expand variables inside a DO block, so every default start logged a syntax error and search stayed on a stopped Meilisearch. A marker now moves search back to PostgreSQL once when the bundle is turned off. Pin PORT, JF_PORT, and ABS_PORT in docker-compose.omnibus.yml, since .env values are host-side overrides; mount data under SILO_DATA_ROOT like docker-compose.yml. Lower Meilisearch's log level, drop extension setup the migrations already do, and move the operator guide out of the repo docs, keeping the contributor notes in docs/architecture/omnibus-image.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A data directory the image did not create, such as one moved from the Compose stack's postgres container, had no include_dir line, so the socket-only listener and System V shared memory never applied: it listened on every interface and used POSIX shared memory under Docker's 64 MB /dev/shm. init-postgres now adds the line whenever it is missing. Moving that directory is still not the way to migrate: the Compose stack's pgvector image runs an older glibc, so PostgreSQL reports a collation version mismatch. The architecture note now says so instead of claiming text sorts the same in both, and restores the paragraph an earlier edit cut short. The major-version refusal message no longer points at the removed docs/omnibus-image.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e search marker PostgreSQL, Redis, and Meilisearch were started with the whole container environment, and /run/s6/container_environment was world-readable, so SQL run as the superuser silo role (COPY ... FROM PROGRAM) could read SECRET_KEY and decrypt every stored credential. The Compose stack's postgres container never has it. Each bundled service now starts with only PATH, HOME, TZ, and its own MEILI_* variables, and the environment directory is root-only. An external DATABASE_URL was printed in full, password included, by the startup summary. It now says only "external". The search marker was deleted before Silo had stored the PostgreSQL provider, so a start that failed first lost the switch back. A small service now deletes it once Silo answers its health check. It does not hold up start or stop. A provider the deployment sets itself now retires the marker, so removing that override later doesn't reset search to PostgreSQL. Files below a mounted transcode or download directory kept the owner of an earlier PUID or of the Compose stack's root-run Silo; both trees are now handed to the silo account like /config/silo. Co-Authored-By: Claude Opus 5.5 <[email protected]>
svc-search-marker polled ${PORT:-8080}, but Silo also reads PORT from
/config/silo/.env when the container doesn't set it. With the port only in
that file, the probe never succeeded, the marker stayed, and every start
forced search back to PostgreSQL. lib.sh's silo_port resolves the port in
Silo's order: the container's PORT, then the file, then 8080.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…chosen Silo's Meilisearch search keeps its paging sessions in Redis. With the bundled Meilisearch on and Redis left off, the default, the v2 search capabilities endpoint and paged searches answered 503 search_continuation_unavailable, and the clients skip people search when capabilities fail. ENABLE_MEILISEARCH=true, or SILO_SEARCH_PROVIDER= meilisearch, now also starts the bundled Redis unless REDIS_URL points elsewhere. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A /config/redis/redis.conf replaced every Redis setting, so one that moved the port or listened on a Unix socket left the readiness check polling 127.0.0.1:6379 forever and Silo, which depends on Redis, never started. The file now replaces only the persistence and logging defaults; the listener stays on the command line, which overrides the file, matching the readiness check and REDIS_URL. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo trims and lowercases SILO_SEARCH_PROVIDER, so MEILISEARCH or a padded value selects Meilisearch, but init-config compared the raw value and left the bundled Redis off for those. Normalize it the same way first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r-image Co-Authored-By: Claude Opus 5.5 <[email protected]>
The image set POSTGRES_TUNE=auto for every container, so pointing it at a deployment's own database made Silo rewrite that database's settings with ALTER SYSTEM, which the regular image never does unasked. init-config now defaults POSTGRES_TUNE to auto, with the 50% memory budget, only when it starts the bundled cluster, and leaves any value the deployment sets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres already accepts a data directory this image did not create, such as one moved from another PostgreSQL container, and adds the line that loads its settings. It left that directory's pg_hba.conf alone, and the official image's file trusts every local connection, so any account in the container could sign in as the superuser over the socket. The image now writes the same rules initdb gives a cluster it creates: peer on the socket, scram-sha-256 on loopback. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hange Each database records the glibc collation version it was built under, and a text index sorted under another version can miss rows. A cluster from the Compose stack's pgvector image (Debian 12, glibc 2.36) has one under this image's 2.41, and so will every install the next time this image moves to a newer Debian release. Before Silo starts, init-postgres-db now rebuilds the indexes on libc collations in each database whose recorded version differs, then refreshes the version. template0 records none and is skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-config walked all of /config/silo on every start to hand it to the silo account. With local artwork that is millions of files: a 51 GB artwork tree takes over half a minute just to walk. The walk now runs when the account's ids differ from those recorded by the last walk, or when an entry in the top two levels is owned wrong, as a restored or copied-in directory is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mits Record that the image owns pg_hba.conf, how init-postgres-db handles a C library change (replacing the advice to move clusters with pg_dump), the ownership marker, that GPU devices owned by group 0 stay closed to the non-root Silo account (unprivileged LXC needs a device group on the host), and that local artwork recorded under another image's /var/lib/silo does not open through this image's link. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The init scripts run as root, and each service account owns its directory under /config, so the account can plant a symlink anywhere in it. Root then followed those links: the ownership marker in /config/silo, pg_hba.conf, postgresql.conf, and conf.d in the PostgreSQL data directory, the Meilisearch master key, and the search marker could each redirect a root write or chown onto a file such as /etc/passwd. The silo role is the cluster superuser and can run programs as the postgres account, so a compromised Silo reaches all of them. /config now stays root's and holds the two markers. Files in a service's directory are written, read, and changed as that account (write_as and append_as in lib.sh), and a symlink left in place of the /tmp working directories is removed before root recreates them. A planted link now makes the write fail and the container stop instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo reads POSTGRES_TUNE_MEMORY_BUDGET_PERCENT before SILO_POSTGRES_TUNE_MEMORY_BUDGET_PERCENT, so exporting the image's default of 50 for the bundled cluster overrode a budget the deployment set under the prefixed name. The default now applies only when neither is set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tings The workflows publish the full commit SHA as a tag for both images, not a short one, so the release-versioning table and the README named a tag that does not exist. The README's omnibus note also says to remove search settings in a reused .env that point at a separate Meilisearch, since the image keeps any it finds there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Writing the data directory as the postgres account broke two starts that worked before. An empty /config/postgres/data, such as a bind mount, failed because mkdir refused an existing directory; and a cluster restored under another uid with mode 0700 failed because postgres could not read its PG_VERSION before the ownership repair. The fresh path now creates the directory if needed, hands it to postgres, and sets its mode. PG_VERSION is read as root before anything changes ownership, so a cluster refused for its version keeps its owner, and only a version number is ever printed. A data directory or PG_VERSION that is itself a symlink is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres-db skipped the index rebuild for a database that does not accept connections but still refreshed its recorded collation version, so the next start saw no mismatch and the stale indexes stayed. The refresh now runs only after a rebuild; such a database keeps its recorded version and logs a warning on each start. template0 records no version and is unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n change pg_index.indcollation describes an index's keys, not its predicate or expressions, so a partial index on a non-text key with a text ordering or case-mapping predicate escaped the rebuild while the version refresh hid the mismatch. The rebuild now also covers every partial or expression index except vector ones (hnsw, ivfflat), whose keys are not text and which are slow to rebuild. On a 77 GB catalog that adds 132 indexes and 1.2 GB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…build The rebuild skipped every collation named C or POSIX, but a user-defined libc collation can take either name in another schema with a real locale, so indexes on it kept their old order while the version refresh hid the mismatch. Only pg_catalog's C and POSIX are skipped now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Readiness checks ran as root with HOME in the service's directory, so a .curlrc planted by the meilisearch account could make root's curl write files or send SECRET_KEY elsewhere. Checks now run as the service's account, and curl skips config files. Silo's .env and PostgreSQL's postgresql.conf are read as their accounts too. A FILE__ variable could name a file a service account controls, which could be a link to the protected SECRET_KEY file. Sources must now resolve to a root-owned regular file outside /config, in directories only root can change. init-postgres deleted postmaster.pid on every start, which also removed the guard against a second container on the same /config starting another server on the data directory. The server now holds a flock(2) lock for its life, and the pid file is deleted only while nothing holds it. /run/silo-omnibus is emptied on every start, so a flag from the previous start of the same container cannot outlive its setting, and bundled Redis keeps an append-only file, since a snapshot alone can restore a playback session older than its revocation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s reach The lock that keeps a second container off the data directory lived in /config/postgres, which the postgres account owns, so that account could replace the file and let another server lock a new one. And init-postgres released the lock before deleting postmaster.pid, leaving a window for another start. The lock file now lives in root-owned /config, and svc-postgres deletes a stale pid file only once it holds the lock it keeps for the server's life. PG_VERSION is read without following a link or blocking on a FIFO, and any PG_VERSION, not only a nonempty regular one, counts as an existing cluster. Bundled Redis keeps its append-only file even with a redis.conf, since command-line options override the file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cation Local artwork storage is identified by its root resolved through symlinks in its parent directories, and startup refuses a store whose identity differs from the recorded one. The omnibus image reaches Silo's state through a /var/lib/silo link to /config/silo, so a catalog the regular image recorded as local|/var/lib/silo/artwork resolves to local|/config/silo/artwork there and refused to start, though it is the same directory. When the recorded and configured roots are the same existing directory, the filesystem store now keeps reporting the recorded identity and the row is left as it is: trickplay manifests, delivery scopes, and sweep checkpoints are keyed by it, and a rollback to an image that uses the recorded path must still open it. The reconcile task's stale-store check and storage transitions compare settings-derived local identities the same way, so naming the active directory by its other path is no longer accepted as a transition onto itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Once a filesystem store keeps the identity recorded under another path to its directory, two transition checks compared path strings that no longer named where the root is. A target inside the active directory, written by its resolved path, did not count as overlapping it, so a migrate-all transition could copy its own output. And execution reopened the artwork target by its resolved path, so a private-only transition treated unchanged artwork as moved and committed the new path as the artwork identity. Overlap now compares roots with existing symlinks resolved, and execution uses the active store when the target names its directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The omnibus image ran only an integrated node, so a deployment with proxy or transcode nodes still needed the regular image and the multi-container stack. With MODE=proxy or MODE=transcode the image now requires DATABASE_URL and REDIS_URL, starts none of its bundled services, and warns about any ENABLE_* variable it ignores; Silo already keeps migrations and PostgreSQL tuning to the primary modes. A main server shares its bundled PostgreSQL and Redis with nodes when ENABLE_NODE_ACCESS=true: PostgreSQL listens on every interface and admits the silo role from the network with POSTGRES_PASSWORD, and Redis binds every interface behind REDIS_PASSWORD. Silo itself stays on the socket and loopback, and turning it off removes the listener and rule, clears the role password, and puts Redis back on loopback. Files in the PostgreSQL data directory are written as the postgres account. docker-compose.node.yml runs a node; docker-compose.node-access.yml layers node access onto the main server's compose file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With node access on, init-postgres wrote the network rule before PostgreSQL started, but init-postgres-db set the silo role's password only afterwards. After POSTGRES_PASSWORD was rotated, the old password worked from the network in between, and a session opened then outlived the change. pg_hba.conf now starts without the network rule; init-postgres-db adds it and reloads the configuration once the password is set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Re-check the omnibus deployment path for #1177 C1–C3 and #1178 C1–C2. The recorded results use the regular multi-container stack; #3178 adds distinct omnibus startup and external PostgreSQL/Redis connectivity, while the node-pool, admin API/UI, cap, and failover logic is unchanged. Those records still cover the existing stack, but not this new path. #1178 C3 (ordinary single-node setup) is unchanged because node access remains opt-in. The #2292 reports referenced by #1177 C3 and #1178 C2 already include revalidation; this PR does not address that finding. Suggested PR-body line: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Re-check the multi-node cases against the omnibus deployment path. The existing result evidence exercises the prior multi-node setup; this PR adds a separate node deployment path with remote PostgreSQL/Redis and a network-access overlay. Registration, cap planning, failover, and Activity logic are unchanged, and the 11-minute stop grace matches the existing optional transcode service, so this is a minor integration re-check for #1177 C1–C3 and #1178 C1–C2. #1178 C3 does not need a re-check: Suggested follow-up: Re-run those five cases using the omnibus node path after merge; no code diff is indicated. Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
SameLocalRoot used os.Stat, which follows a link at the root's own name. A store refuses a linked root, and LocalIdentity resolves only parent directories, so a recorded root replaced by a link to where it moved was accepted at startup while the transition overlap check still saw two locations. A transition into a subfolder of the moved directory then copied into the live artwork directory. SameLocalRoot now compares both roots resolved by LocalIdentity, the rule the store and resolvedLocalRoot already use. A linked parent, such as the omnibus image's /var/lib/silo link to /config/silo, still matches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…k read-write FILE__ secrets: accept a regular file owned by root or by any uid that is not a service account's (silo at PUID, postgres, redis, meilisearch), as long as group and others cannot write it. A non-swarm Compose file secret keeps its host owner, so the root-only rule refused it and Silo crash-looped without SECRET_KEY. The directory, /config, and state-dir checks are unchanged. PostgreSQL lock: create /config/.postgres.lock root:postgres 0660, fix an existing file in place, and open it read-write in init-postgres and svc-postgres. NFS emulates flock(2) with a POSIX lock, which needs a writable descriptor for an exclusive lock. Give the silo account the home /nonexistent so usermod -u no longer re-owns /config/silo before init-config walks it, and make the doc describe when svc-search-marker deletes the search marker. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 11f9921bf1
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
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:
603b8286-a9f6-49ec-a29e-cb53dd24d349
Files selected for processing: 8-
docker-compose.node-access.ymldocker-compose.node.ymldocs/architecture/omnibus-image.mdomnibus/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/runomnibus/rootfs/etc/s6-overlay/scripts/init-configomnibus/rootfs/etc/s6-overlay/scripts/init-postgresomnibus/rootfs/etc/s6-overlay/scripts/init-postgres-dbomnibus/rootfs/etc/silo-omnibus/postgresql.omnibus.conf
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
ENABLE_NODE_ACCESS publishes the bundled Redis, which does not start when REDIS_URL names another one, so nodes pointed at the published port fail. Warn as the external PostgreSQL case already does, and say in the node Compose file that its grace period has to follow SILO_NODE_DRAIN_TIMEOUT. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Publish the omnibus image's mutable tag as aio instead of latest-omnibus, and its fixed tags as build-N-aio and <sha>-aio, so testers follow one channel that later takes over latest once it works for every install. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: changes #1177 C1–C3 and #1178 C1–C2 (the omnibus node path needs its own run; all cases not yet run); #1178 C3 unchanged, since node access is opt-in
The omnibus image (#3118) runs only one integrated server. A deployment with proxy or transcode nodes, or one whose main server has to serve nodes on other hosts, still needs the regular image and the multi-container Compose stack, so the omnibus image cannot become the one image everyone runs.
Third in the stack: #3118, the artwork identity fix, this, the migration script, the default Compose switch.
Approach
MODE=proxyorMODE=transcodethe image requiresDATABASE_URLandREDIS_URL, starts none of its bundled services, and warns about anyENABLE_*it ignores. Silo already keeps migrations and PostgreSQL tuning to the primary modes, so a node never changes the shared database's schema or settings.docker-compose.node.ymlruns one.ENABLE_NODE_ACCESS=true(set bydocker-compose.node-access.yml, which publishes 5432 and 6379 onNODE_ACCESS_HOST) makes the bundled PostgreSQL listen on every interface and admit thesilorole from the network withPOSTGRES_PASSWORD, and makes Redis bind every interface behindREDIS_PASSWORD(letters, digits,._~-, since it goes into a URL). Silo on the main server stays on the socket and loopback. Turning it off removes the listener and the network rule, clears the role's password, and puts Redis back on loopback.postgres, following feat(docker): add an omnibus image with bundled PostgreSQL, Redis, and Meilisearch #3118's rule that root never writes inside a service account's directory. The Redis password file lives in root-owned/run/silo-omnibus.Nodes sign in as the cluster superuser and the connections are not encrypted, as with the current Compose stack; the overlay and docs say to publish the ports on a trusted network only. A narrower node role and TLS can follow.
Validation
silo, thepostgresdatabase is refused from the network, and Redis answersNOAUTHwithout the password. With node access off again: no listener file, no network rule, no role password, Redis off.make verify-shellcheck,make verify-actionlint,make verify-local-paths: pass.Evidence
No user-visible change. Test runs and results:
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3178/
Risks
NODE_ACCESS_HOSTmust be set explicitly;0.0.0.0is not prevented.Checklist
AI Disclosure
Note
Add omnibus Docker image with bundled PostgreSQL, Redis, and Meilisearch
FILE__*variables with ownership checks, and PostgreSQL cluster init/validation. Services run as dedicated accounts with readiness checks and s6 dependencies.aiomanifest (docker.yml, omnibus-build.yml).blobstore.SameLocalRootso alias paths count as the same store (filesystem.go, service.go, reconcile_artwork_cache.go).init-postgres-dbcontains a stray+token between the table name and WHERE clause; with psql stop-on-error, the script exits before completing the collation rebuild. Also, external modes now requireDATABASE_URLandREDIS_URLand exit without starting bundled services.Macroscope summarized b25ffda.