Skip to content

fix(blobstore): recognize local artwork storage reached through a linked path - #3177

Merged
Quick104 merged 38 commits into
mainfrom
silo/omnibus-artwork-identity
Oct 28, 2026
Merged

Quick104 merged 38 commits into
mainfrom
silo/omnibus-artwork-identity

Conversation

@Quick104

@Quick104 Quick104 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

A Silo install that stores artwork on local disk cannot start on the omnibus image (#3118). Silo records local artwork storage by its directory path, with symlinks in the parent directories resolved, and refuses to start when that changes. The regular image keeps its state at /var/lib/silo; the omnibus image makes /var/lib/silo a link to /config/silo. So a catalog the regular image recorded as local|/var/lib/silo/artwork resolves to local|/config/silo/artwork on the omnibus image, though it is the same directory, and startup stops with "use the managed storage transition". Local disk is the Compose stack's default, so this blocks moving most existing installs to the omnibus image. S3 artwork is unaffected.

This PR is the second in a stack: #3118 (the image), this, then node support, the migration script, and the default Compose switch.

Approach

  • blobstore.SameLocalRoot treats two local identities as one location when both resolve to the same root through blobstore.LocalIdentity: links in parent directories are followed, a link at the root's own name is not. That is the rule the store applies to its own root, and the one the transition overlap check uses, so startup and transitions agree.
  • A filesystem store opened on the directory a catalog recorded under another path keeps reporting the recorded identity, and the artwork.storage_identity row is left as it is. Trickplay manifests, delivery scopes, and sweep checkpoints are keyed by that string, and a rollback to an image that still uses /var/lib/silo must keep opening it.
  • Storage transitions and the reconcile task compare the same way. Without that, naming the active directory by its other path was accepted as a transition onto itself, a target inside the active directory did not count as overlapping it, and a private-only transition rewrote the artwork identity.
  • When they compare a target or the configured location with the active store, they use the directory that store opened (blobstore.Location), not its recorded path resolved again. A link on the recorded path retargeted while the server runs would otherwise make a new directory look like the active one, so a transition could skip its copy and the reconcile task could sweep and certify against the wrong directory.

docs/architecture/blob-storage.md records the rule.

Validation

  • New tests in internal/blobstore (open keeps the recorded identity for a linked root; a link moved to another directory is refused) and internal/storagetransition (same directory by another path rejected as unchanged; target inside an aliased root rejected as overlap; private-only transition keeps the aliased artwork identity), and a recorded root replaced by a link to the configured directory is refused; a transition and a reconcile run after the recorded path's link is retargeted compare with the directory the store opened (internal/storagetransition, internal/taskmanager/tasks). Each fails without the fix.
  • go test for internal/blobstore, internal/storagetransition, internal/taskmanager/tasks: pass. make lint-changed: 0 issues.
  • End to end on amd64: an install of the current Compose stack with a recorded local artwork identity, moved to the omnibus image built from this stack, starts healthy with the identity row unchanged and its artwork served.

Evidence

No user-visible change. Test runs and results:

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3177/

Risks

  • NewFilesystem creates the configured directory before the comparison, so a recorded root whose path now leads to the configured directory opens even if that directory was missing, as an empty artwork store. A recorded root that resolves anywhere else, including one that is itself a link, is still refused. Two paths that reach one directory without a link, such as a bind mount, don't match.
  • An API server on the regular image and one on the omnibus image against the same database both work only when each reaches the same directory; that was already required.

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; OpenAI Codex CLI for adversarial review
  • Model(s): claude-opus-5-5; gpt-6-astra (review)
  • Involvement: AI-assisted
  • Adversarial review: two gpt-6-astra passes over the whole stack, read-only. The first found the transition overlap and private-only identity rewrite above; both are fixed with tests. The re-check marked both resolved.

Note

Fix blobstore to recognize local artwork storage reached through a linked path

  • Local filesystem stores keep the recorded identity when opened through a different parent path that resolves to the same root. blobstore.openRecorded compares resolved roots via the new blobstore.SameLocalRoot helper before rejecting an identity mismatch, in open.go
  • Adds blobstore.Location and blobstore.Filesystem.Identity so callers can compare where a store is opened, not just its recorded identity, in filesystem.go
  • Storage transitions treat a target that resolves to the active store's opened directory as the active store rather than a distinct target, and namespace-overlap checks resolve local roots before comparing, in service.go
  • ReconcileArtworkCacheTask now receives the store's opened location via WithLocation from main.go and its stale-store check accepts configured paths that resolve to that location
  • Behavioral Change: a recorded root that is itself a symlink, or a parent link retargeted to another directory, is still rejected; opening a local store through a different path no longer rewrites the recorded identity setting

Macroscope summarized 5efa762.

Quick104 and others added 29 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]>
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]>
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]>
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@silo-triage silo-triage Bot added the stacked Base is another open PR; merge in stack order named in the body label Oct 27, 2026
Quick104 and others added 3 commits October 28, 2026 10:22
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]>

@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: cbab5754-b766-4ebc-85b7-930f31c9724d
Commits

Reviewing files that changed from the base of the PR and between 0c875e0 and c0129fc.

Files selected for processing: 9
  • docs/architecture/blob-storage.md
  • docs/architecture/omnibus-image.md
  • internal/blobstore/filesystem.go
  • internal/blobstore/open.go
  • internal/blobstore/open_test.go
  • internal/storagetransition/operational_test.go
  • internal/storagetransition/service.go
  • internal/storagetransition/service_test.go
  • internal/taskmanager/tasks/reconcile_artwork_cache.go

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

Comment thread internal/blobstore/filesystem.go Resolved
Quick104 and others added 2 commits October 28, 2026 15:25
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]>
Base automatically changed from silo/review-aio-docker-image to main October 28, 2026 21:56
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/L 200–499 added + deleted lines (all files); change volume, not priority. labels Oct 28, 2026
…identity

# Conflicts:
#	docs/architecture/omnibus-image.md
@silo-triage silo-triage Bot added size/L 200–499 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 28, 2026
@silo-kody

silo-kody Bot commented Oct 28, 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 ❌

Comment thread internal/storagetransition/service.go Resolved
…opened

A filesystem store keeps the identity recorded under a link, and transitions
compared targets with that path by resolving it again. If the link was
pointed at another directory while the server ran, a transition to that
directory resolved as the active store: it skipped the artwork copy and
committed settings naming the new directory while the files stayed in the
old one. blobstore.Location returns the directory a local store opened,
through its wrappers, and transitions compare with that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 28, 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 ❌
⚠️ 2 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

@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: 1c0bf4d289

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

…pened

The reconcile task compared the configured artwork location with the
store's recorded identity resolved again. A link on that recorded path
retargeted while the process runs made a new configured directory match,
so the sweep ran against the directory the store opened and could certify
an identity that now names another directory.

The task now takes the store's location (blobstore.Location) and compares
settings with it, as storage transitions do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 28, 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 ❌

@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.

Caution

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

⚠️ Outside diff range comments (1)

Major · Compare the configured identity with the opened location. · reconcile_artwork_cache.go:338

internal/taskmanager/tasks/reconcile_artwork_cache.go:338
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Compare the configured identity with the opened location.

When the retained identity P uses a parent alias retargeted from A to B, blobstore.SameLocalRoot(identity, t.identity) can accept configured identity B, although the reconciler still operates on the store opened at A. The previous exact comparison rejected this mismatch.

Pass blobstore.Location(deps.Blobs.Assets) to the task and compare it with the configured identity. Keep t.identity for catalog certification. Use the opened location for the equality shortcut so an equal retained identity cannot bypass the check.

Suggested fix
 type ReconcileArtworkCacheTask struct {
 	runner   ArtworkReconcileRunner
 	settings ArtworkReconcileSettingsStore
 	branding BrandingAssetReconciler
 	identity string
+	location string
 	pool     *pgxpool.Pool
 }

 func NewReconcileArtworkCacheTask(runner ArtworkReconcileRunner, settings ArtworkReconcileSettingsStore, branding BrandingAssetReconciler, identity string, pools ...*pgxpool.Pool) *ReconcileArtworkCacheTask {
+	return NewReconcileArtworkCacheTaskWithLocation(runner, settings, branding, identity, identity, pools...)
+}
+
+func NewReconcileArtworkCacheTaskWithLocation(runner ArtworkReconcileRunner, settings ArtworkReconcileSettingsStore, branding BrandingAssetReconciler, identity, location string, pools ...*pgxpool.Pool) *ReconcileArtworkCacheTask {
 	var pool *pgxpool.Pool
 	if len(pools) > 0 {
 		pool = pools[0]
 	}
-	return &ReconcileArtworkCacheTask{runner: runner, settings: settings, branding: branding, identity: identity, pool: pool}
+	return &ReconcileArtworkCacheTask{runner: runner, settings: settings, branding: branding, identity: identity, location: location, pool: pool}
 }

-	if known && identity != t.identity && !blobstore.SameLocalRoot(identity, t.identity) {
+	if known && identity != t.location && !blobstore.SameLocalRoot(identity, t.location) {
 		return ErrArtworkReconcileStaleStore
 	}
-			reconcileArtwork := tasks.NewReconcileArtworkCacheTask(
+			reconcileArtwork := tasks.NewReconcileArtworkCacheTaskWithLocation(
 				metadata.NewArtworkCacheReconciler(deps.DB, deps.Blobs.Assets),
 				settingsRepo,
 				brandingReconciler,
 				identity,
+				blobstore.Location(deps.Blobs.Assets),
 				deps.DB,
 			)

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: 829e8e47-bf4c-45fa-a4d1-8e44e5e63304
Commits

Reviewing files that changed from the base of the PR and between 363d5f4 and 1c0bf4d.

Files selected for processing: 5
  • internal/blobstore/fence.go
  • internal/blobstore/filesystem.go
  • internal/blobstore/open.go
  • internal/storagetransition/operational_test.go
  • internal/storagetransition/service.go

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

An exact match with the recorded identity skipped the location check, so a
configured identity equal to that recorded path passed even when the store
had opened somewhere else.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104

Copy link
Copy Markdown
Contributor Author

CodeRabbit's outside-diff note on reconcile_artwork_cache.go:338: c5713e7 already passes blobstore.Location(deps.Blobs.Assets) to the task (WithLocation) and compares the configured location with it. The equality shortcut still compared with the recorded identity; 5efa762 compares it with the opened location too, so an exact match with the recorded path no longer skips the check.

@silo-kody

silo-kody Bot commented Oct 28, 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 ❌

@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: d5715e89-61bb-49e8-bcb2-dfbbdbfaeab4
Commits

Reviewing files that changed from the base of the PR and between 1c0bf4d and 5efa762.

Files selected for processing: 3
  • cmd/silo/main.go
  • internal/taskmanager/tasks/reconcile_artwork_cache.go
  • internal/taskmanager/tasks/reconcile_artwork_cache_test.go

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

@Quick104
Quick104 merged commit 5444ec6 into main Oct 28, 2026
30 checks passed
@Quick104
Quick104 deleted the silo/omnibus-artwork-identity branch October 28, 2026 23:16
Quick104 added a commit that referenced this pull request Oct 28, 2026
#3118 and #3177 landed as squash commits; this keeps main and applies only
this branch's own changes on top.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: compat Breaks a supported client or server path priority: P2 Limited scope, workaround exists, or polish size/L 200–499 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