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
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
| Field | Value |
|---|---|
| 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 updated | YYYY-MM-DD |
| Classification | [Public] |
| Generated from | [Example: schema/config.json via quillon config docs --format md] |
| Related | CLI Reference (docs/cli-reference), Administrator Guide (docs/administrator-guide), Installation Guide (docs/installation-guide), Migration Guide (docs/migration-guide), Changelog (dev/changelog) |
Approvals
| Role | Name | Decision | Date |
|---|---|---|---|
| Platform owner | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
| Security reviewer (sections 5 and 9) | [@name] | [Decision] | YYYY-MM-DD |
Revision history
| Version | Date | Author | Change summary |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [@name] | First draft |
| 1.0 | YYYY-MM-DD | [@name] | Example: Published for Quillon 4.2.0, schema v3 |
| 1.1 | YYYY-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:
| Rank | Source | Example | Notes |
|---|---|---|---|
| 1 (highest) | Command-line flag | --server.port=9090 | Applies to this process only |
| 2 | Environment variable | APP_SERVER_PORT=9090 | Naming rule in section 6 |
| 3 | Configuration file | server.port: 9090 | First file found, see section 2 |
| 4 (lowest) | Built-in default | 8080 | Listed 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:
- The path in
--configorAPP_CONFIG. ./app.yamlin the working directory.$XDG_CONFIG_HOME/app/app.yamlfor a user install on Linux (default~/.config/app/app.yaml)./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
| Type | Format | Examples |
|---|---|---|
| string | UTF-8 text | "eu-west-1" |
| integer | Whole number, optional _ separators | 20, 10_000 |
| boolean | true or false (also 1/0 in environment variables) | true |
| duration | Number with unit ms, s, m, h | 500ms, 30s, 5m |
| size | Number with unit B, KiB, MiB, GiB (base 1024) | 64MiB |
| enum | One of the listed values, case-sensitive | info |
| secret | Reference to a secret (section 5); never a literal in the file | ${secret:DATABASE_URL} |
4. Settings
4.1 server
| Key | Type | Default | Allowed values | Environment variable | Reload | Description | Since |
|---|---|---|---|---|---|---|---|
server.host | string | 0.0.0.0 | IPv4 or IPv6 address | APP_SERVER_HOST | No | Interface to listen on | 1.0 |
server.max_body_size | size | 10MiB | 1KiB to 1GiB | APP_SERVER_MAX_BODY_SIZE | No | Largest accepted request body | 3.0 |
server.port | integer | 8080 | 1 to 65535 | APP_SERVER_PORT | No | TCP port for HTTP traffic | 1.0 |
server.request_timeout | duration | 30s | 1s to 10m | APP_SERVER_REQUEST_TIMEOUT | Yes | Maximum time to handle one request | 2.1 |
4.2 database
| Key | Type | Default | Allowed values | Environment variable | Reload | Description | Since |
|---|---|---|---|---|---|---|---|
database.max_connections | integer | 20 | 1 to 500 | APP_DATABASE_MAX_CONNECTIONS | No | Pool size per process | 1.0 |
database.statement_timeout | duration | 15s | 100ms to 5m | APP_DATABASE_STATEMENT_TIMEOUT | Yes | Cancels slower queries | 3.2 |
database.url | secret | none (required) | postgres:// URL | APP_DATABASE_URL_FILE | No | Connection string including credentials (section 5) | 1.0 |
4.3 cache
| Key | Type | Default | Allowed values | Environment variable | Reload | Description | Since |
|---|---|---|---|---|---|---|---|
cache.enabled | boolean | true | true, false | APP_CACHE_ENABLED | No | Turns the response cache on or off | 2.0 |
cache.max_size | size | 256MiB | 16MiB to 16GiB | APP_CACHE_MAX_SIZE | No | Memory limit for the cache | 4.0 |
cache.ttl | duration | 5m | 0s to 24h | APP_CACHE_TTL | Yes | Time an entry stays valid; 0s disables expiry | 2.0 |
4.4 logging
| Key | Type | Default | Allowed values | Environment variable | Reload | Description | Since |
|---|---|---|---|---|---|---|---|
logging.format | enum | json | json, text | APP_LOGGING_FORMAT | No | Output format | 1.4 |
logging.level | enum | info | debug, info, warn, error | APP_LOGGING_LEVEL | Yes | Minimum severity written | 1.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:
| Form | Example | Resolved from | Notes |
|---|---|---|---|
| Secret file | ${file:/run/secrets/db_url} | A file mounted by the orchestrator | Preferred; file must be readable only by the service user |
_FILE variable | APP_DATABASE_URL_FILE=/run/secrets/db_url | Path in an environment variable | Same 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
secretfield 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.
| ID | Check | Result |
|---|---|---|
| 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 quillon | Pass |
| CFG-SEC-003 (Example) | config show --origin output reviewed: all secrets masked | Pass |
6. Environment variable naming
Every key has an environment variable derived by one rule:
- Prefix
APP_. - Replace each
.with_. - 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_connectionsmultiplied by the number of instances must not exceed the database server's connection limit (checked when--instancesis 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
| Key | Status | Replacement | Deprecated in | Removed in | Behaviour now |
|---|---|---|---|---|---|
db.pool (Example) | Removed | database.max_connections | 2.0 | 4.0 | Startup error |
server.timeout (Example) | Deprecated | server.request_timeout | 3.0 | [5.0] | Value used, warning logged |
cache.size_mb (Example) | Deprecated | cache.max_size | 4.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): theconfigcommand and global flags. - Migration Guide (
docs/migration-guide): steps for removed keys. - Changelog (
dev/changelog): settings added, changed or deprecated per release.
11. References
| Source | Version checked | Used for |
|---|---|---|
| JSON Schema, https://json-schema.org/specification | Draft 2020-12 (current), checked 2026-10-29 | Schema format |
| YAML, https://yaml.org/spec/1.2.2/ | 1.2 revision 1.2.2 (2021-10-01), checked 2026-10-29 | File format |
| TOML, https://toml.io/en/v1.1.0 | 1.1.0 (2025-12-18), checked 2026-10-29 | File format |
| POSIX.1-2024 (IEEE Std 1003.1-2024), XBD section 8.1, https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html | Checked 2026-10-29 | Environment variable names |
| OWASP Secrets Management Cheat Sheet, https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html | Checked 2026-10-29 | Secrets handling |
| The Twelve-Factor App, III Config, https://12factor.net/config | Checked 2026-10-29 | Separation of config from code |
| XDG Base Directory Specification, https://specifications.freedesktop.org/basedir/latest/ | 0.8 (2021-05-08), checked 2026-10-29 | File locations |
| Semantic Versioning 2.0.0, https://semver.org/ | 2.0.0, checked 2026-10-29 | Deprecation timing |
| Diátaxis, Daniele Procida, https://diataxis.fr/reference/ | Checked 2026-10-29 | Reference 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
CLI Reference Template (Man Page Sections)
Command-line reference in man-page order: synopsis, POSIX option syntax, commands, shell completion, environment, files, exit status, JSON output, deprecations
Documentation & SupportError Message Reference Template (RFC 9457)
Error catalogue: code scheme, RFC 9457 problem details mapping, writing rules, entries with cause and fix, client handling, governance
Documentation & SupportReference Documentation Template (Diátaxis)
Diátaxis reference page – neutral, consistently structured entries for functions, types, errors and constants