Skip to content

Commit 993a17f

Browse files
docs(config): reference generated config schema (#4015)
- document `zot schema` as the generated JSON Schema reference for configuration files - add a top-level configuration map to help users discover the major config sections before reading examples Fixes #2967 Signed-off-by: Akash Kumar <meakash7902@gmail.com>
1 parent 1a1f84d commit 993a17f

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

examples/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,25 @@ zot verify <config-file>
1414
1515
```
1616

17+
The complete machine-readable configuration reference can be generated from the
18+
same binary:
19+
20+
```
21+
zot schema > zot-config-schema.json
22+
23+
```
24+
25+
The generated schema is JSON Schema draft 7. It is built from the same
26+
configuration model used by `zot verify`, so it is the preferred reference for
27+
editor integration, CI validation, and checking accepted field names.
28+
1729
Examples of working configurations for various use cases are available [here](../examples/)
1830

1931
# Configuration Parameters
2032

2133
- [Configuration Parameters](#configuration-parameters)
34+
- [Generated JSON Schema](#generated-json-schema)
35+
- [Top-level Configuration Map](#top-level-configuration-map)
2236
- [Network](#network)
2337
- [Storage](#storage)
2438
- [Authentication](#authentication)
@@ -34,6 +48,36 @@ Examples of working configurations for various use cases are available [here](..
3448
- [Sync](#sync)
3549
- [Search and CVE scanning (Trivy)](#search-and-cve-scanning-trivy)
3650

51+
## Generated JSON Schema
52+
53+
Use `zot schema` when you need a complete field-level reference instead of a
54+
scenario-specific example file.
55+
56+
```
57+
zot schema > zot-config-schema.json
58+
zot verify config.json
59+
60+
```
61+
62+
The schema output includes nested options for storage drivers, authentication,
63+
authorization, extensions, sync, events, retention, and clustering. It also
64+
includes supported field aliases where the config loader accepts them.
65+
66+
## Top-level Configuration Map
67+
68+
| Key | Type | Purpose |
69+
| --- | --- | --- |
70+
| `distSpecVersion` | string | Distribution spec version declared by the config. zot warns if it differs from the supported version and then uses the supported version. |
71+
| `storage` | object | Registry storage root, dedupe, garbage collection, retention, storage drivers, cache drivers, and repository subpaths. |
72+
| `http` | object | Listener address and port, TLS, authentication, authorization, CORS, rate limits, realm, and client compatibility settings. |
73+
| `log` | object | Log level, primary log output, and audit log output. |
74+
| `extensions` | object | Optional sync, search, UI, metrics, scrub, lint, image trust, API key, management, and event-recorder settings. |
75+
| `scheduler` | object | Background task scheduler settings such as worker count. |
76+
| `cluster` | object | Scale-out members, cluster hash key, and cluster TLS settings. |
77+
| `goVersion`, `commit`, `releaseTag`, `binaryType` | string | Build metadata fields populated by zot; they are not normally set in user configuration files. |
78+
79+
The sections below describe the most common settings and point to working
80+
example files for complete configurations.
3781

3882
## Network
3983

@@ -1189,4 +1233,3 @@ To set those options explicitly (for example to mirror standalone Trivy’s `--v
11891233
- [config-cve-trivy.json](config-cve-trivy.json) — shows optional `dbRepository`, `javaDBRepository`, and `vulnSeveritySources`.
11901234

11911235
`vulnSeveritySources` is a list of source names in priority order (for example `auto`, `nvd`, or vendor IDs such as `redhat`, `alpine`). If omitted, zot defaults it to `["auto"]`, consistent with the Trivy CLI. See [Trivy: severity selection](https://trivy.dev/docs/latest/scanner/vulnerability/#severity-selection).
1192-

0 commit comments

Comments
 (0)