Skip to content

feat(docker): add an omnibus image with bundled PostgreSQL, Redis, and Meilisearch - #3118

Merged
Quick104 merged 29 commits into
mainfrom
silo/review-aio-docker-image
Oct 28, 2026
Merged

Quick104 merged 29 commits into
mainfrom
silo/review-aio-docker-image

Conversation

@Quick104

@Quick104 Quick104 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #3105, through #3117, which this PR is stacked on
Validation tasks: none

Running Silo today takes the Compose stack: separate Silo, PostgreSQL, and Redis containers, plus Meilisearch if you want it, which an administrator then connects by hand in the admin UI. That is more than a household server on a NAS or a single small box needs, and app catalogs that expect one container per app have nothing to package. This PR adds an omnibus image: the regular Silo image plus PostgreSQL 18 with pgvector in one container, with Redis and Meilisearch bundled and off until ENABLE_REDIS or ENABLE_MEILISEARCH is set. CI publishes it beside the regular image under the same tags with an -aio suffix, except that its mutable tag is aio rather than latest until it is validated for every install. The regular image and docker-compose.yml don't change.

The image is @johnjcenapolis's work from their fork; their two commits are kept as they wrote them. The third commit fixes what review found and connects search through the environment variables #3117 adds.

Approach

  • Built on the regular image. CI builds omnibus/Dockerfile on the regular image of the same commit, after its manifest list is pushed. Both images run the same Silo binary, libvips, FFmpeg build, and GPU runtimes, and the omnibus Dockerfile adds only s6-overlay, PostgreSQL, Redis, and Meilisearch. The fork's version copied the binary onto Ubuntu 24.04. There, a binary built on Debian trixie ran against older libvips, glib, and Redis, and the FFmpeg and Intel runtime installs were maintained twice. Since the base changes on every build, the omnibus build uses no layer cache, so PostgreSQL and Debian security updates aren't held back (the problem fix(docker): pick up Debian security fixes and block untrusted libvips loaders #3053 fixed for the regular image).
  • One integrated node under s6-overlay. Each service runs as its own account and keeps its data under /config/<service>. PostgreSQL listens only on a Unix socket with peer authentication, so there is no database password. PUID/PGID set the account that runs Silo; the service accounts have fixed ids so /config keeps valid owners across image updates. Silo stops and drains before PostgreSQL's fast shutdown.
  • Search through the environment. With ENABLE_MEILISEARCH=true the image exports SILO_SEARCH_PROVIDER, SILO_MEILISEARCH_URL, and SILO_MEILISEARCH_API_KEY for the bundled instance, unless the deployment sets them itself. The fork wrote server_settings with psql instead; its path for turning Meilisearch off never ran (psql doesn't expand variables inside a DO block), so every default start logged a syntax error and search stayed on a stopped Meilisearch. Now, when the image chose the provider, the first start after Meilisearch is turned off sets it back to postgres once. From the next start the admin UI can change it again. Meilisearch search keeps its paging sessions in Redis, so turning on Meilisearch also starts the bundled Redis (the server-side limit is [bug] Meilisearch search answers 503 on servers without Redis #3130).
  • Clusters the image did not create. init-postgres already accepts a data directory moved in from another PostgreSQL container. It now rewrites pg_hba.conf on every start: the official image's file trusts every local connection, which here would let any account in the container sign in as the superuser. When a database's recorded glibc collation version differs from the running one, init-postgres-db rebuilds the indexes whose keys use a libc collation, plus every partial or expression index except vector ones (pg_index records no collation for a predicate or expression), and refreshes the version only after the rebuild, before Silo connects. A database that refuses connections keeps its recorded version and logs a warning. That covers a cluster from the Compose stack's pgvector/pgvector:pg18 (Debian 12, glibc 2.36; this image has 2.41) and every install at the image's next Debian bump.
  • Tuning. POSTGRES_TUNE defaults to auto only for the bundled cluster. The image used to set it for every container, so Silo rewrote a deployment's own database with ALTER SYSTEM.
  • Root never writes inside a service's directory. The init scripts run as root, and each service account can plant a symlink in its own directory under /config; the silo role, as cluster superuser, can run programs as the postgres account. /config stays root's and holds the image's markers, and files in a service directory are written as its account, so a planted link makes the write fail instead of redirecting it onto a file such as /etc/passwd.
  • Readiness checks, secrets, and restarts. Readiness checks run as the service's account, since s6 runs them as root with HOME in the service directory, where a .curlrc could direct root's curl. A FILE__ secret must resolve to a regular file outside /config that no service account owns and that group and others cannot write, in directories only root can change. Docker and Kubernetes secrets are root's, and a Compose file secret keeps its owner from the host. /run/silo-omnibus is emptied on every start. The PostgreSQL server holds a flock(2) lock on /config/.postgres.lock (root:postgres 0660, opened read-write, since NFS emulates flock with a POSIX lock that needs a writable descriptor) for its life and only then deletes a stale postmaster.pid, so a second container on the same /config cannot start another server on the data directory. Bundled Redis keeps an append-only file, forced even with a redis.conf.
  • Ownership on start. /config/silo is walked and handed to the silo account only when the account's ids differ from those the last walk recorded, or an entry in the top two levels is owned wrong. Local artwork can hold millions of files, and a 51 GB tree took over half a minute just to walk.
  • docker-compose.omnibus.yml reads the same .env as docker-compose.yml and pins the container ports, so PORT, JF_PORT, and ABS_PORT there stay host-side overrides.

docs/architecture/omnibus-image.md covers the build, start order, accounts, and the two versions an upgrade depends on (PG_MAJOR and the Meilisearch pin). The operator guide goes to the user manual instead of this repository.

Validation

  • Fork's published image, amd64 test host: reproduced the syntax error on every default start, and the provider staying meilisearch after Meilisearch was turned off.
  • This branch, amd64: built the regular image from feat(config): set Meilisearch and the Audiobookshelf port from the environment #3117's code and the omnibus on it, then ran five starts on one data directory. Default first boot is clean. Enabling Meilisearch and Redis stores the provider, the URL, and the encrypted key, and builds the index. Turning Meilisearch off returns search to PostgreSQL once and doesn't re-export it on the next start. A deployment-set URL wins. Shutdown is clean in 8.4 s.
  • Also on amd64: fixed data-directory owners and a colliding PUID refused; TZ, GPU device groups, peer-auth psql, and the en_US.UTF-8 collation; the compose file with PORT, JF_PORT, and ABS_PORT overridden in .env.
  • make verify-shellcheck, make verify-actionlint, make verify-local-paths: pass. No Go or web code changes in this PR's own commits.
  • The image fixes added after review, on amd64 against a regular image built from main: a fresh start exports POSTGRES_TUNE=auto with the 50% budget and writes a peer-only pg_hba.conf; with an external DATABASE_URL, POSTGRES_TUNE stays unset and the external cluster's postgresql.auto.conf stays empty. An empty data directory created ahead of the first start initializes, a valid cluster restored under another uid starts, a cluster of another major version is refused without its ownership changing, and a data directory copied from a pgvector/pgvector:pg18 container started healthy in 12 s with its trust rule replaced, its indexes rebuilt in postgres, silo, and template1, the collation version at 2.41, and its rows intact. With 200,000 root-owned files under /config/silo/artwork, the first start walked and chowned them all, the next skipped the walk, and a root-owned directory restored two levels down was walked again on the following start.
  • Planted links on amd64: silo cannot create anything in /config; with pg_hba.conf linked to /etc/passwd by the postgres account, or the Meilisearch master key linked to /etc/shadow, the write or read fails as that account, the container stops, and the target is unchanged. A symlink in place of /tmp/silo-transcode is replaced by a directory. A SILO_POSTGRES_TUNE_MEMORY_BUDGET_PERCENT set by the deployment is kept.
  • Review-round fixes, amd64: a .curlrc planted by the Meilisearch account wrote nothing as root; a second container on the same /config refused to start PostgreSQL while the first stayed healthy and kept its pid file, and the postgres account could not remove the lock; a hard kill restarted cleanly; a FIFO in place of PG_VERSION stopped startup with a version error instead of hanging; a redis.conf with appendonly no still ran with it on; a stale flag in /run/silo-omnibus did not survive a restart; a FILE__ source under /config was refused and a root-owned secret file loaded.
  • Second review round, arm64: a Compose-style secret owned by uid 1000 (mode 0600) loaded and Silo started healthy; the same file owned by the PUID account was refused. The lock is root:postgres 0660, an old root:root 0644 lock was fixed in place on restart, and a second container on the same /config was still refused. The silo account's home is now /nonexistent, so a PUID change walks /config/silo once instead of twice. Not tested on a real NFS mount.
  • Not run: an arm64 build (CI builds it on a native runner), hardware transcoding (the test host has a virtual GPU, and the regular image fails the same probe there), and the new CI jobs, which run only on main.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/omnibus-image/

Risks

Follow-ups:

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 says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted. The contributor's two commits are their own; the review fixes and the later image fixes were AI-generated and verified on a test host.
  • Adversarial review: no plan round ran before the fixes. A background adversarial review (gpt-6.1-sol) runs on this PR.

Note

Add all-in-one Silo Docker image with bundled PostgreSQL, Redis, and Meilisearch

  • Builds an omnibus image on top of the regular Silo image that adds PostgreSQL (with pgvector), optional Redis and Meilisearch, and s6-overlay service supervision with data under /config (Dockerfile).
  • Startup runs ordered s6 services: secret-file env loading, PUID/PGID user mapping with GPU group setup, config generation, PostgreSQL cluster and database init (including collation-change index rebuilds), then Silo. Redis and Meilisearch can be disabled in favor of external services.
  • Adds a reusable build workflow plus matrix build and manifest merge jobs publishing omnibus tags with an aio pointer (docker.yml, omnibus-build.yml).
  • Adds a single-service Compose file (docker-compose.omnibus.yml) and documentation for setup, tags, and operational constraints.
  • Behavioral Change: documented source-identity image tags now use the full commit SHA instead of the short SHA (docs/release-versioning.md); startup exits on invalid PUID, PostgreSQL major-version mismatch, or a held data-directory lock.

Macroscope summarized 9f83851.

Quick104 and others added 5 commits October 26, 2026 20:13
…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]>
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T19:28:11.445023Z 9f83851 New commits
🔒 Security Review ✅ Completed 2026-10-28T19:31:17.745011Z 9f83851 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

This PR adds an omnibus Silo image with bundled PostgreSQL and Redis, optional Meilisearch, and s6-based service management. It adds initialization and service scripts, workflows to build and publish architecture-specific images, a Compose deployment, and supporting documentation.

Changes: Omnibus image

Layer / File(s) Summary
Image foundation
omnibus/Dockerfile, omnibus/rootfs/etc/silo-omnibus/*
The Dockerfile installs PostgreSQL, Redis, s6-overlay, and Meilisearch for amd64 and arm64. The shared library provides runtime helpers, and the PostgreSQL configuration sets local socket and logging options.
Startup initialization
omnibus/rootfs/etc/s6-overlay/scripts/*, omnibus/rootfs/etc/s6-overlay/s6-rc.d/init-*, docs/architecture/omnibus-image.md
Initialization scripts process file-based environment values, configure the Silo account and service state, select bundled or external dependencies, and initialize PostgreSQL and the Silo database. The architecture documentation describes these configuration and startup behaviors.
Supervised services
omnibus/rootfs/etc/s6-overlay/s6-rc.d/svc-*
s6 services start Silo, PostgreSQL, Redis, and Meilisearch. The services include health checks, readiness notifications, and search-provider marker handling.
Image build and publishing
.github/workflows/docker.yml, .github/workflows/omnibus-build.yml
The workflows build omnibus images for both Linux architectures, merge their digest artifacts, and publish a manifest with -omnibus tags.
Compose deployment and usage
docker-compose.omnibus.yml, README.md, docs/release-versioning.md
The Compose configuration runs one omnibus container with configurable host ports, persistent storage, and an optional .env file. The README adds quick-start instructions, and the release documentation describes image tags.

Priority: Pending latest changes

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant DockerWorkflow as docker.yml
  participant OmnibusWorkflow as omnibus-build.yml
  participant Registry
  participant ManifestMerge as omnibus merge job
  DockerWorkflow->>OmnibusWorkflow: Build each Linux architecture
  OmnibusWorkflow->>Registry: Push image by digest
  OmnibusWorkflow->>DockerWorkflow: Upload digest artifact
  DockerWorkflow->>ManifestMerge: Start after required jobs succeed
  ManifestMerge->>Registry: Publish omnibus manifest tags
Loading

Possibly related issues

Possibly related PRs

Merge Risk: Low · up to ae27b

The omnibus image is mergeable with awareness of a narrow collation-repair gap. Databases using a custom C or POSIX collation could retain a stale index after a collation change.

Security architecture risk: Low · up to ae27b

The bundled image deliberately trades separate-container isolation for simpler deployment. Separate service accounts, local-only listeners, and restricted secret inheritance limit exposure, but bundled services share access to mounted paths subject to filesystem permissions. Migration and recovery require more than swapping images.

Retained concerns

  • Low · security · inferred: The new topology places bundled services in the same mount namespace as Silo's host-media mount. Unlike the separate PostgreSQL container, a compromised bundled database process can attempt to read mounted media wherever its Unix identity has permission. The read-only mount prevents writes, not disclosure. Separate accounts and secret filtering constrain this risk, and actual file access remains deployment-dependent; this is a containment tradeoff, not a verified exploit.
Security review details

Security Blast Radius

  • inferred — The changed containment boundary is one deployed omnibus node and its mounted data. Bundled-service compromise does not by itself establish root or host compromise, but shared mounts and networking permit lateral access attempts that separate containers previously constrained. Host permissions determine additional readable media.

Trust Boundaries and Controls

  • observed — Default network exposure is limited to Silo: PostgreSQL uses a Unix socket, Redis binds loopback, and Meilisearch defaults to loopback with a master key. PostgreSQL and Redis receive cleaned environments; Meilisearch receives only its MEILI_ settings plus the shared environment allowlist. The container-environment directory is restricted to root.

Resilience and Maintainability Implications

  • observed — Malformed or incompatible PostgreSQL version metadata is rejected before ownership changes. Recursive ownership repair is best-effort, however: its helper suppresses errors, while application initialization subsequently writes the ownership marker. That marker therefore does not prove every nested file was repaired; the observed consequence is potentially inaccessible restored data, not a demonstrated privilege bypass.

Hardening Proposals

  • proposed — Document omnibus as a shared filesystem trust zone, not equivalent isolation to the separate-container deployment. Include an explicit, backed-up migration checklist covering PostgreSQL layout, local artwork paths, and service-account access to host media.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely summarizes the primary change: adding an omnibus image with bundled PostgreSQL, Redis, and Meilisearch.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description clearly explains the omnibus Docker image, bundled services, CI workflows, Compose configuration, documentation, validation, and risks covered by the changeset.
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

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Oct 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8eef0a7865

ℹ️ 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".

Base automatically changed from silo/search-provider-abs-port-env-vars to main October 27, 2026 00:43
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/XL 500–999 added + deleted lines (all files); change volume, not priority. labels Oct 27, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review (gpt-6.1-sol, reviewed 8eef0a7)

Two additional findings are attached to the diff. The existing automated review already covers database credentials in startup logs and deleting the reset marker before Silo stores the provider.

Validated features: board lookup was unavailable; passed validation cases were not assessed.

AI disclosure: Reviewed with Codex (gpt-6.1-sol).

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]>
@silo-kody

silo-kody Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added size/XL 500–999 added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Oct 27, 2026
…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]>
@silo-kody

silo-kody Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Meilisearch can suppress people-search results when Redis is left off. init-config selects Meilisearch independently, but SearchContinuationCapabilities requires Redis-backed sessions; without them, /api/v2/catalog/search/capabilities errors and Web, Apple, and Android clients skip the people lookup. This affects the recorded Person C3 results on build 941, which do not cover the Meilisearch-without-Redis configuration.

Please ensure Redis session storage is available whenever Meilisearch is selected, or make the people-search capability independent of continuation storage. The listed C3 results need re-validation on the intended configuration after merge. For the tvOS and Android TV C6 navigation checks, the PR must explain why the validated path changes; those cases need re-validation after merge.

Affected results: #1144 C3 (Web); Silo-Server/silo-apple#307 C3 (iPhone and iPad), #308 C3 and C6 (tvOS); Silo-Server/silo-android#317 C3 (Android phone and tablet), #318 C3 and C6 (Android TV).

Suggested fix: No diff — the fix requires coordinating service wiring and/or API capability handling.

Validation tasks: changes #1144 C3; Silo-Server/silo-apple#307 C3; Silo-Server/silo-apple#308 C3, C6; Silo-Server/silo-android#317 C3; Silo-Server/silo-android#318 C3, C6.

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Do not refresh an unconnectable user database. · init-postgres-db:21-43

omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db:21-43
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Do not refresh an unconnectable user database.

ALLOW_CONNECTIONS false also applies to ordinary user databases. For such a database, this loop skips reindexing but still runs ALTER DATABASE ... REFRESH COLLATION VERSION. The next startup then sees no mismatch, so stale indexes remain. Queries that use those indexes can miss rows.

Refresh the version only after the reindex completes. This also defers intentionally unconnectable templates safely.

Suggested fix
   if [[ "$connectable" == t ]]; then
     log "the C library collation version changed; rebuilding the text indexes in database $db"
     psql_silo -d "$db" <<'SQL'
 SELECT DISTINCT format('REINDEX INDEX %s', s.indexrelid::regclass)
 FROM (SELECT indexrelid, indcollation[k] AS coll
       FROM pg_index, generate_subscripts(indcollation, 1) AS k) s
 JOIN pg_collation c ON c.oid = s.coll
 WHERE c.collprovider IN ('d', 'c') AND c.collname NOT IN ('C', 'POSIX')
 \gexec
 SQL
+    psql_silo -d postgres -v name="$db" <<<'ALTER DATABASE :"name" REFRESH COLLATION VERSION'
   fi
-  psql_silo -d postgres -v name="$db" <<<'ALTER DATABASE :"name" REFRESH COLLATION VERSION'
 done <<<"$changed"

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: d9742da7-ad15-4ffb-a2e3-b909135a37df
Commits

Reviewing files that changed from the base of the PR and between 2a75e27 and 4e34147.

Files selected for processing: 6
  • README.md
  • docs/architecture/omnibus-image.md
  • docs/release-versioning.md
  • omnibus/rootfs/etc/s6-overlay/scripts/init-config
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres
  • omnibus/rootfs/etc/silo-omnibus/lib.sh
Files skipped from review as they are similar to previous changes: 3
  • docs/release-versioning.md
  • README.md
  • docs/architecture/omnibus-image.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

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]>
@Quick104

Copy link
Copy Markdown
Contributor Author

@coderabbitai Re the outside-diff finding on init-postgres-db (refreshing the collation version of a database that does not accept connections): fixed in d6c3df7. The version is refreshed only after the rebuild; a database that refuses connections keeps its recorded version and logs a warning on each start, so the mismatch stays visible. Checked with a database set to ALLOW_CONNECTIONS false: it kept the old version and warned, while silo was rebuilt and refreshed.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd -H '^AGENTS\.md$' .
fd '^init-postgres-db$' omnibus
ast-grep outline omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db || true
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
for d in omnibus omnibus/rootfs omnibus/rootfs/etc omnibus/rootfs/etc/s6-overlay omnibus/rootfs/etc/s6-overlay/scripts; do
  if [ -f "$d/AGENTS.md" ]; then cat "$d/AGENTS.md"; fi
done
nl -ba omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db | sed -n '1,140p'

Length of output: 25370


@Quick104 Confirmed in omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db. Line 33–35 warns and skips databases that refuse connections. Line 46 refreshes the recorded version only after the rebuild succeeds.

This addresses the finding. I inspected the code but did not rerun your database check.


📝 I couldn't check this conversation for new learnings, so no new learning was saved.

You are interacting with an AI system.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


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: ee72baff-693b-4947-9c61-c6ed2221cc63
Commits

Reviewing files that changed from the base of the PR and between 4e34147 and d6c3df7.

Files selected for processing: 3
  • docs/architecture/omnibus-image.md
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db
Files skipped from review as they are similar to previous changes: 1
  • docs/architecture/omnibus-image.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

…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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


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: 1d956e2d-98d3-4709-8f25-c7ae83902660
Commits

Reviewing files that changed from the base of the PR and between d6c3df7 and ae27b50.

Files selected for processing: 2
  • docs/architecture/omnibus-image.md
  • omnibus/rootfs/etc/s6-overlay/scripts/init-postgres-db
Files skipped from review as they are similar to previous changes: 1
  • docs/architecture/omnibus-image.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Quick104 and others added 3 commits October 27, 2026 13:10
…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]>
Quick104 and others added 2 commits October 28, 2026 10:29
…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]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants