Markdown Editor

Configuration Reference Template

Settings reference: precedence, file format, per-key type, default, range, env var, reload, secrets handling, env var naming, JSON Schema validation, deprecations

Documentation & SupportStandardJSON Schema 2020-12; YAML 1.2.2; TOML 1.1.0; POSIX.1-2024 §8.1 env names; OWASP Secrets Management Cheat Sheet; Diátaxis referenceconfigurationreference

How to use: Use when a product has more than a handful of settings. State precedence first, publish the JSON Schema and generate one complete row per key from it, then document how secrets are supplied. The main pitfall is empty defaults, literal secrets in examples and undocumented deprecated keys.

Preview

Configuration Reference: [Product name] [version]

Complete list of the settings that control [Product name], how they are loaded, how secrets are supplied and how values are validated against a machine-readable schema. The page is a reference in the sense of the Diátaxis framework: it states facts and links elsewhere for advice. File formats are YAML 1.2 (revision 1.2.2) and TOML 1.1.0; the schema uses JSON Schema draft 2020-12; environment variable names follow the character rules of POSIX.1-2024 (IEEE Std 1003.1-2024) section 8.1. Worked examples use Quillon Server 4.2, a fictional web service by the fictional Harrowgate Labs. Replace every [bracketed] value and every row marked Example.

Document control

FieldValue
Document ID[DOC-CFG-001]
Product version[4.2.0]
Configuration schema version[3] (Example: https://example.com/quillon/schema/v3/config.json)
Status[Draft / In review / Published / Superseded]
Owner[@platform-team]
Approvers / reviewers[@tech-writer], [@security-reviewer]
Last updatedYYYY-MM-DD
Classification[Public]
Generated from[Example: schema/config.json via quillon config docs --format md]
RelatedCLI Reference (docs/cli-reference), Administrator Guide (docs/administrator-guide), Installation Guide (docs/installation-guide), Migration Guide (docs/migration-guide), Changelog (dev/changelog)

Approvals

RoleNameDecisionDate
Platform owner[@name][Approved / Changes requested]YYYY-MM-DD
Security reviewer (sections 5 and 9)[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft
1.0YYYY-MM-DD[@name]Example: Published for Quillon 4.2.0, schema v3
1.1YYYY-MM-DD[@name]Example: cache.size_mb deprecated; secrets file references added

1. Sources and precedence

[Product name] reads configuration from four sources. When the same setting is defined in more than one place, the source higher in this list wins:

RankSourceExampleNotes
1 (highest)Command-line flag--server.port=9090Applies to this process only
2Environment variableAPP_SERVER_PORT=9090Naming rule in section 6
3Configuration fileserver.port: 9090First file found, see section 2
4 (lowest)Built-in default8080Listed in the tables below

To see the effective value and where it came from, run [app] config show --origin. Secrets are masked in the output.

2. File location and format

The first file found in this order is used; others are ignored:

  1. The path in --config or APP_CONFIG.
  2. ./app.yaml in the working directory.
  3. $XDG_CONFIG_HOME/app/app.yaml for a user install on Linux (default ~/.config/app/app.yaml).
  4. /etc/app/app.yaml (Windows: %ProgramData%\App\app.yaml).

YAML 1.2 and TOML 1.1.0 are supported; the format is chosen from the file extension (.yaml, .yml, .toml). YAML is parsed with the 1.2 core schema, so yes, no, on and off are strings, not booleans. Unknown keys are rejected so that typos are not silently ignored. A complete example with defaults:

# yaml-language-server: $schema=https://example.com/quillon/schema/v3/config.json
schema_version: 3
server:
  host: 0.0.0.0
  port: 8080
  request_timeout: 30s
database:
  url: ${secret:DATABASE_URL}
  max_connections: 20
cache:
  enabled: true
  ttl: 5m
logging:
  level: info
  format: json

The first line lets editors that support the YAML language server validate and complete the file against the schema (section 8).

3. Value types

TypeFormatExamples
stringUTF-8 text"eu-west-1"
integerWhole number, optional _ separators20, 10_000
booleantrue or false (also 1/0 in environment variables)true
durationNumber with unit ms, s, m, h500ms, 30s, 5m
sizeNumber with unit B, KiB, MiB, GiB (base 1024)64MiB
enumOne of the listed values, case-sensitiveinfo
secretReference to a secret (section 5); never a literal in the file${secret:DATABASE_URL}

4. Settings

4.1 server

KeyTypeDefaultAllowed valuesEnvironment variableReloadDescriptionSince
server.hoststring0.0.0.0IPv4 or IPv6 addressAPP_SERVER_HOSTNoInterface to listen on1.0
server.max_body_sizesize10MiB1KiB to 1GiBAPP_SERVER_MAX_BODY_SIZENoLargest accepted request body3.0
server.portinteger80801 to 65535APP_SERVER_PORTNoTCP port for HTTP traffic1.0
server.request_timeoutduration30s1s to 10mAPP_SERVER_REQUEST_TIMEOUTYesMaximum time to handle one request2.1

4.2 database

KeyTypeDefaultAllowed valuesEnvironment variableReloadDescriptionSince
database.max_connectionsinteger201 to 500APP_DATABASE_MAX_CONNECTIONSNoPool size per process1.0
database.statement_timeoutduration15s100ms to 5mAPP_DATABASE_STATEMENT_TIMEOUTYesCancels slower queries3.2
database.urlsecretnone (required)postgres:// URLAPP_DATABASE_URL_FILENoConnection string including credentials (section 5)1.0

4.3 cache

KeyTypeDefaultAllowed valuesEnvironment variableReloadDescriptionSince
cache.enabledbooleantruetrue, falseAPP_CACHE_ENABLEDNoTurns the response cache on or off2.0
cache.max_sizesize256MiB16MiB to 16GiBAPP_CACHE_MAX_SIZENoMemory limit for the cache4.0
cache.ttlduration5m0s to 24hAPP_CACHE_TTLYesTime an entry stays valid; 0s disables expiry2.0

4.4 logging

KeyTypeDefaultAllowed valuesEnvironment variableReloadDescriptionSince
logging.formatenumjsonjson, textAPP_LOGGING_FORMATNoOutput format1.4
logging.levelenuminfodebug, info, warn, errorAPP_LOGGING_LEVELYesMinimum severity written1.0
[key][type][default][allowed][ENV_VAR][Yes / No][Description][x.y]

5. Secrets

Settings of type secret never hold a literal value in the configuration file. They accept one of three references, resolved at startup and on reload:

FormExampleResolved fromNotes
Secret file${file:/run/secrets/db_url}A file mounted by the orchestratorPreferred; file must be readable only by the service user
_FILE variableAPP_DATABASE_URL_FILE=/run/secrets/db_urlPath in an environment variableSame as above, for container platforms
Secrets manager${secret:DATABASE_URL}The configured secrets backend (secrets.backend)Supports rotation without a restart

Behaviour the product guarantees:

  • Secret values are masked as **** in logs, config show, error messages and crash reports.
  • A literal value in a secret field is a validation error (SEC-LITERAL), so a pasted password is caught before it is committed.
  • Plain environment variables are not accepted for secrets, because other processes and crash dumps can expose them; the OWASP Secrets Management Cheat Sheet (section 5.1) describes this risk.
  • When the secrets backend rotates a value, the next reload picks it up; open database connections are recycled within database.statement_timeout.
IDCheckResult
CFG-SEC-001 (Example)No secret field contains a literal in any committed file (app config validate)Pass
CFG-SEC-002 (Example)Secret files mounted with mode 0400, owner quillonPass
CFG-SEC-003 (Example)config show --origin output reviewed: all secrets maskedPass

6. Environment variable naming

Every key has an environment variable derived by one rule:

  1. Prefix APP_.
  2. Replace each . with _.
  3. Convert to upper case.

So database.max_connections becomes APP_DATABASE_MAX_CONNECTIONS. Names use only upper-case letters, digits and underscores and never start with a digit, the character set POSIX.1-2024 section 8.1 uses for the variables of standard utilities. The product prefix avoids clashes with other software. Secret keys accept only the _FILE form (section 5). Lists are written as comma-separated values (APP_CORS_ORIGINS=https://a.example,https://b.example); a key that already contains an underscore, such as request_timeout, keeps it, so the mapping from a variable back to a key uses the schema, not string splitting.

7. Changes at runtime

Settings marked Yes in the Reload column can be changed without restarting: edit the file and send SIGHUP or call POST /admin/reload. Currently reloadable: logging.level, cache.ttl, server.request_timeout, database.statement_timeout and secret references. All other changes need a restart. A reload that fails validation is rejected and the running configuration stays in place.

8. Schema and validation

The configuration schema is published as JSON Schema draft 2020-12 at [https://example.com/quillon/schema/v3/config.json]. The same schema drives editor completion, app config validate and the tables in section 4. An excerpt:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/quillon/schema/v3/config.json",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "database"],
  "properties": {
    "schema_version": {"const": 3},
    "database": {
      "type": "object",
      "additionalProperties": false,
      "required": ["url"],
      "properties": {
        "url": {"type": "string", "pattern": "^\\$\\{(file|secret):[^}]+\\}$", "writeOnly": true},
        "max_connections": {"type": "integer", "minimum": 1, "maximum": 500, "default": 20}
      }
    }
  }
}

Configuration is validated at startup and on every reload. An invalid configuration stops startup. Run the same checks before deploying:

app config validate --config ./app.yaml

Checks performed:

  • Every key is known for the declared schema_version (additionalProperties: false).
  • Every value has the right type and is inside its allowed range.
  • Required settings without defaults are present.
  • Secret fields contain a reference, never a literal.
  • Cross-field rules hold, for example database.max_connections multiplied by the number of instances must not exceed the database server's connection limit (checked when --instances is given).

Example error output (exit status 2):

app.yaml:7:20 database.max_connections: 900 is above the maximum of 500
app.yaml:12:10 logging.level: "verbose" is not one of debug, info, warn, error
app.yaml:6:8 database.url: SEC-LITERAL literal value in a secret field, use ${file:...} or ${secret:...}

9. Deprecated and removed settings

KeyStatusReplacementDeprecated inRemoved inBehaviour now
db.pool (Example)Removeddatabase.max_connections2.04.0Startup error
server.timeout (Example)Deprecatedserver.request_timeout3.0[5.0]Value used, warning logged
cache.size_mb (Example)Deprecatedcache.max_size4.0[5.0]Converted, warning logged
[old key][Deprecated / Removed][new key][x.y][x.y][Behaviour]

app config migrate --to 3 rewrites deprecated keys in a file and prints what it changed.

10. Related documents

  • Installation Guide (docs/installation-guide): where the file is created during setup.
  • Administrator Guide (docs/administrator-guide): recommended production values and tuning.
  • CLI Reference (docs/cli-reference): the config command and global flags.
  • Migration Guide (docs/migration-guide): steps for removed keys.
  • Changelog (dev/changelog): settings added, changed or deprecated per release.

11. References

SourceVersion checkedUsed for
JSON Schema, https://json-schema.org/specificationDraft 2020-12 (current), checked 2026-10-29Schema format
YAML, https://yaml.org/spec/1.2.2/1.2 revision 1.2.2 (2021-10-01), checked 2026-10-29File format
TOML, https://toml.io/en/v1.1.01.1.0 (2025-12-18), checked 2026-10-29File format
POSIX.1-2024 (IEEE Std 1003.1-2024), XBD section 8.1, https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.htmlChecked 2026-10-29Environment variable names
OWASP Secrets Management Cheat Sheet, https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.htmlChecked 2026-10-29Secrets handling
The Twelve-Factor App, III Config, https://12factor.net/configChecked 2026-10-29Separation of config from code
XDG Base Directory Specification, https://specifications.freedesktop.org/basedir/latest/0.8 (2021-05-08), checked 2026-10-29File locations
Semantic Versioning 2.0.0, https://semver.org/2.0.0, checked 2026-10-29Deprecation timing
Diátaxis, Daniele Procida, https://diataxis.fr/reference/Checked 2026-10-29Reference form

Standard and licence note

Based on common industry practice for configuration reference documentation (layered precedence of flags, environment variables, files and defaults; the Twelve-Factor App separation of config from code), the published JSON Schema 2020-12, YAML 1.2.2 and TOML 1.1.0 specifications, POSIX.1-2024 section 8.1 (IEEE Std 1003.1-2024, freely readable at pubs.opengroup.org; cited by section number only) and the OWASP Secrets Management Cheat Sheet (OWASP, CC BY-SA 4.0; referenced, not adapted). The reference form follows the Diátaxis framework by Daniele Procida (CC BY-SA 4.0); only its concepts are used. The text of this template is original. Check the current official versions before relying on this page. Template licence: MIT.

Related templates