Repository navigation
feat(config): set Meilisearch and the Audiobookshelf port from the environment - #3117
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]>
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:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Walkthrough
Merge Risk:
|
|
The evidence link covers the admin Search page (desktop before/after and the phone-width state with a variable unset), but it does not show these other visible effects:
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
There was a problem hiding this comment.
Actionable comments posted: 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:
8b54d70f-9fdd-43eb-9ab4-438a40287172
Files selected for processing: 14-
.env.examplecmd/silo/main.godocker-compose.dev.ymldocker-compose.ymldocs/admin-settings-api.mdinternal/catalog/encrypted_settings_repo_test.gointernal/catalog/search_env.gointernal/catalog/search_env_test.gointernal/config/bootstrap.gointernal/config/bootstrap_test.gointernal/config/config.gointernal/config/db_loader.gointernal/nodeconfig/watcher.goweb/src/pages/admin-settings/SearchSettings.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
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]>
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:
|
|
On the two gaps the evidence check named:
|
|
The protected-credential-status failure state in Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Problem
Closes #3105
Related issue: N/A
Validation tasks: none (no passed case in the Validation issues reaches this change; the board itself was not readable with the author's token)
Packaged deployments (Compose stacks, app catalogs such as TrueNAS, all-in-one images)
start Meilisearch next to Silo but cannot connect the two at deploy time. The provider,
URL and key exist only as admin settings, so every install needs a trip to the admin UI
after first start, or a script that writes
server_settingsrows before Silo runs. Untilthen Silo quietly stays on Postgres search. The Audiobookshelf listener is fixed at
13378, so a deployment on the host network, or one where 13378 is taken, cannot move it.
This adds
SILO_SEARCH_PROVIDER,SILO_MEILISEARCH_URLandSILO_MEILISEARCH_API_KEY,which behave like
SILO_TRUSTED_PROXIES, andABS_PORT, which behaves likeJF_PORT.Approach
way an admin save does: the provider must be
postgresormeilisearch, and the URLneeds an http or https scheme and a host. The values that differ from the stored ones
are written in one batch through the encrypting settings store before the search
provider is built, so the key rests encrypted under its existing setting name. An
invalid value stops startup with a message that names the variable.
managed_by_env, so saves of them are refused, and the adminSearch page disables those fields and names the variable. The page now waits for the
protected-credential status before it renders, as the General page does, so it never
takes an edit the server would refuse. If that status fails to load, the search engine,
URL and key fields stay disabled with a note to reload.
read per process, like
SILO_TRUSTED_PROXIESandREDIS_URL, so every API serversharing a database needs the same values;
.env.exampleanddocs/admin-settings-api.mdsay so.ABS_PORT(default 13378) moves the Audiobookshelf listener at startup and after configreloads. A listener disabled in settings stays disabled.
.envalready usesABS_PORTfor the host side of the Compose port mapping, and thesilo service loads
.env, so both Compose files now pinABS_PORT: "13378"inside thecontainer next to
PORTandJF_PORT.docker-compose.dev.ymldid not pinJF_PORTeither, so it gets that pin too.
The
/api/v2shapes do not change;managed_by_envcan now list three more keys. Apple,Android and Jellyfin clients call nothing that changed.
Validation
main,Silo ignored them: Postgres search, nothing stored, Audiobookshelf on 13378. On this
branch, search runs on Meilisearch and indexed the library with the key from the
environment; the stored rows hold the normalized values with the key encrypted;
managed_by_envlists the three keys; a settings write of the provider returns 422; theconnection check passes; a restart rewrites nothing; Audiobookshelf answers on 13379
only.
invalid provider stops startup with a clear message; a disabled Audiobookshelf listener
stays off; an unreadable storage-transition row does not block the startup write.
docker compose configwith host-sideABS_PORTandJF_PORTin.envkeeps thecontainer ports pinned in both Compose files.
make lint-changed(0 issues), and the tests of the touchedpackages pass. In
make test-goon the macOS test host, failures injellycompat,metadata/nfo,scannerandsubtitles/subsyncfail onmainthere too, andTestCopyRemuxSubtitleRenditionRealFFmpeg(real ffmpeg, untouched package) timed out.make test-webpass.main; the livebefore and after is the proof, and the tests guard the edge cases. The page test for a
failed credential-status load, which a sandbox cannot easily produce, fails on the
commit before that fix and passes now.
Evidence
Admin Search page on desktop, before and after, plus the page with one variable unset and
at phone width, from sandbox builds of
mainand of this branch.Evidence: https://evidence.siloserver.org/r/silo-server/issue-3105/
Risks
ABS_PORTin.envto change the hostport and keeps a
docker-compose.ymlwithout the new pin will, after pulling thisimage, run the Audiobookshelf listener on that port inside the container, where the
port mapping does not reach it. Updating
docker-compose.yml, or addingABS_PORT: "13378"to the silo service's environment, fixes it.docker run --env-filesetups are affected the same way. The user-manual update carries an upgrade note.
variables disagree about search until their variables match, and each start writes its
own values. This is the same model as
SILO_TRUSTED_PROXIES.SILO_TRUSTED_PROXIESdoes.Follow-ups:
(connecting Meilisearch from
.env, whatABS_PORTsets, and the upgrade note above).Checklist
AI Disclosure
delegate_taskfor the Codex reviewsconnection settings in one batch, and hold the Search page until it knows which fields
the environment sets. Answered by documenting it: API servers sharing a database need
the same variables, as with
SILO_TRUSTED_PROXIES.first version of the startup write read and decrypted every setting under the global
settings lock, so an unreadable storage-transition row would have stopped startup. It
now writes one batch against the settings Silo already reads at startup. They also
fixed a docs claim about the stored key and trimmed duplicate tests. The Compose
upgrade case is listed under Risks.
The later commit 765f5dc addresses a CodeRabbit finding: the Search page now holds
the connection fields when credential status fails to load.
🤖 Generated with Claude Code
Note
Add
ABS_PORTand Meilisearch environment variables to Silo startup configStoreSearchSettingsin search_env.go. Invalid values exit the server with an error naming the variable.config.LoadBootstrapreadsABS_PORT(default:13378), and the newWithBootstrapListenhelper moves an enabled Audiobookshelf listener to that address at startup and on every config reload in watcher.go.ABS_PORToverrides a configured enabled listener address on every reload.SetManyadded to the encrypted settings test store in encrypted_settings_repo_test.go.Macroscope summarized 765f5dc.