Skip to content
BlogOctober 29, 2026

Configuration Belongs to Its Parser

Rohi Rikman
Configuration Belongs to Its Parser
An earlier version of my SearXNG settings.yml expected ${SEARXNG_SECRET_KEY} to be replaced with a secret. Nothing replaced it. SearXNG does not expand ${...} inside that file, and the image's entrypoint only substitutes ultrasecretkey in a settings file it generates itself. According to the service notes, the instance would have run with the literal string ${SEARXNG_SECRET_KEY} as its key. A placeholder is only a placeholder if something agrees to replace it. This class of mistake teaches more than another argument about YAML being unpleasant. The syntax can be valid. The file can be mounted correctly. The secret can exist somewhere on the host. The value can still arrive at the wrong interpreter. The failures below come from the maintenance notes beside each service, not from a fresh reproduction.

An environment file has a consumer

The Infisical definition supplies backend configuration through service-level env_file entries. Its comments deliberately leave DB_CONNECTION_URI as a complete value in the private environment file instead of constructing it inside Compose from separate POSTGRES_* variables. That choice is about evaluation order. Compose interpolates expressions in the Compose model using the environment available to that invocation. The environment it later gives a service through env_file is a different input at a different boundary. Merely listing a private file under a service does not make its contents the interpolation source for the whole Compose document. The local Infisical notes name the tempting mistake: constructing a database URI in compose.yaml as though the password supplied through the service's environment file were already available to Compose's substitution step. Making it available would mean a second, shell-visible copy of the password. The source avoids that dependency by supplying the complete URI to the backend. Its tracked configuration carries the key's purpose, not the credential value. Shell exports and a project .env are not the only ways a Compose invocation can receive interpolation inputs; an explicit CLI environment-file input is another. The point is narrower: a CLI input to Compose and a service's env_file are not the same contract just because both involve a file of environment variables. Before moving a value, name which consumer needs it and when.

A mounted file is not a template

SearXNG's Compose definition mounts settings.yml read-only and supplies environment files separately. Compose owns the mount declaration. That does not mean it renders the contents of the mounted settings file. The current settings comments now say it outright: placeholders in this file would be used literally. The deployment instead relies on the environment names the application recognizes, SEARXNG_SECRET and SEARXNG_BASE_URL, which override the file from the container environment. That is an explicit application override, not generic templating. The assumed substitution had no responsible parser. The text looked as if it referred to a secret, and nothing in the pipeline could make that true. The repair was not another layer of punctuation. It was moving the value to the application's supported input.

Sometimes the next parser should expand it

The Infisical PostgreSQL healthcheck illustrates the opposite requirement. Its CMD-SHELL probe contains $$POSTGRES_USER and $$POSTGRES_DB. The doubled dollar signs are deliberate. The comment above the probe says why: $$ so the container's shell expands the variable, not Compose. That is the same ownership problem with a different answer. The application settings file should not be assumed to expand arbitrary expressions. A shell-based probe does need its variables expanded, but by the shell that has the container's environment. Do not copy the escaping without the command context. CMD-SHELL names a shell evaluation step. A direct executable invocation is a different interface; it does not become a shell because its arguments contain dollar signs. The thing to review is the evaluation path, not whether a familiar token appears in the file.

An override can remove the defaults

Variable expansion is only part of the problem. Merge semantics have their own owner. SearXNG's settings enable use_default_settings: true. The comments describe dictionaries merging key by key and engine entries merging by name. That sounds like a reasonable basis for adding a small local change. The plugin block has a different rule. The notes, dated 2026-09-14, say a plugins: block replaces the upstream plugin list rather than merging with it. The first attempt omitted the default-active plugins and silently disabled the calculator, hash, unit converter and tracker-URL remover. That is a concrete functional loss, not a hypothetical concern about configuration style. The current file lists the default-active plugins again alongside the two it adds. The resulting file is more repetitive. In this case, reducing repetition without understanding the loader would remove behavior. Treat every claimed merge as an API contract. Does a mapping merge recursively? Does a list replace? Are entries matched by name? Is this particular section special? The answer for an adjacent section does not settle the section being edited.

Valid YAML can still be the wrong configuration

The same SearXNG notes record brand.public_instances failing schema validation when set to the boolean false. SearXNG exits with "Expected str, got bool". The checked-in file uses an empty string to hide the footer link. YAML can represent either value. The application does not assign them the same meaning. The cache configuration has another example. An earlier host-and-port block under redis: was not a recognized setting, so the notes say the cache was never used. The current configuration uses valkey.url, with a Redis server speaking the required protocol. The service's name is not the configuration interface's name. A familiar backend name is not evidence that a guessed configuration key exists. Neither case needs a clever abstraction to explain it. The application owns the schema. A text parser accepting the document is not the application's agreement to use every key.

Check the boundary you are changing

The SearXNG verifier makes its limited job visible. Its Compose parse uses --no-interpolate and --no-env-resolution, intentionally avoiding dependence on private runtime inputs for a structural check. That makes it a structural check and nothing more. It cannot prove the effective secret value, the application's plugin behavior or the live cache connection. For a configuration review, I want the evidence tied to the changed boundary. Structural parsing for the deployment model. Application schema validation for application settings. A non-secret observation of the affected behavior when runtime testing is approved. Dumping a fully resolved credential-bearing configuration into a report would create another problem, not settle this one safely. My preferred review note is short enough to sit beside the change: this value is supplied here, interpreted there, and observed through this behavior. If that sentence cannot name the interpreter, the placeholder is still a guess. A dollar sign does not give a file an execution model.
Share this post: