{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "server": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "host": {
          "type": "string"
        },
        "bodyLimitMb": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum request body size in megabytes."
        },
        "banner": {
          "type": "boolean",
          "description": "Show startup banner. When false, prints a compact single-line header instead."
        },
        "infobox": {
          "type": "boolean",
          "description": "Show the info box with version, URL, and store details."
        },
        "logFormat": {
          "type": "string",
          "enum": ["pretty", "json"],
          "description": "Log output format. `json` prints structured pino JSON lines. `pretty` prints human-readable lines. Defaults to `pretty` unless NODE_ENV is `production`."
        },
        "tls": {
          "type": "object",
          "additionalProperties": false,
          "description": "TLS configuration. When present, server serves HTTPS instead of HTTP.",
          "required": ["certFile", "keyFile"],
          "properties": {
            "certFile": {
              "type": "string",
              "description": "Path to PEM certificate file."
            },
            "keyFile": {
              "type": "string",
              "description": "Path to PEM private key file."
            },
            "caFile": {
              "type": "string",
              "description": "Path to CA certificate file (optional)."
            }
          }
        }
      }
    },
    "auth": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "token": {
          "type": "string",
          "description": "Bearer token required on all requests. Omit `auth` or `token` to disable auth. Passing '' to disable auth is deprecated and will be rejected in the next major version."
        },
        "readOnlyToken": {
          "type": "string",
          "minLength": 1,
          "description": "Optional bearer token granting read-only access (GET only, no PUT). Requires `token` to be set. Give this to untrusted CI (e.g. PR builds) so it can use the cache without being able to poison it (CVE-2025-36852 / CREEP). Must differ from `token`."
        }
      }
    },
    "storeOptions": {
      "type": "object",
      "description": "Store-specific config. Shape depends on the store implementation used by the runner."
    }
  }
}
