Skip to content

Conversation

@alecthomas
Copy link
Collaborator

Current schema from running cachewd --schema

// The stable API of the cache server.
apiv1 {}

// Caches artifacts from an Artifactory server.
artifactory target {
  // List of hostnames to accept for host-based routing. If empty, uses path-based routing only.
  hosts = [string](optional)
}

// Caches objects on local disk, with a maximum size limit and LRU eviction
disk {
  // Root directory for the disk storage.
  root = string
  // Maximum size of the disk cache in megabytes (defaults to 10GB).
  limit-mb = number(optional default(10240))
  // Maximum time-to-live for entries in the disk cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
  // Interval at which to check files for eviction (defaults to 1 minute).
  evict-interval = string(optional default("1m"))
}

// Caches Git repositories, including bundle and tarball snapshots.
git {
  // Directory to store git clones.
  mirror-root = string
  // How often to fetch from upstream in minutes.
  fetch-interval = string(optional default("15m"))
  // How long to cache ref checks.
  ref-check-interval = string(optional default("10s"))
  // How often to generate bundles. 0 disables bundling.
  bundle-interval = string(optional default("0"))
  // Depth for shallow clones. 0 means full clone.
  clone-depth = number(optional default(0))
}

// Caches public and authenticated GitHub releases.
github-releases {
  // GitHub token for authentication.
  token = string
  // List of private GitHub organisations.
  private-orgs = [string]
}

// A generic host-based proxying strategy.
host target {}

// Caches objects in memory, with a maximum size limit and LRU eviction
memory {
  // Maximum size of the disk cache in megabytes (defaults to 1GB).
  limit-mb = number(optional default(1024))
  // Maximum time-to-live for entries in the disk cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
}

// Caches objects in S3
s3 {
  // S3 bucket name.
  bucket = string
  // S3 endpoint URL (e.g., s3.amazonaws.com or localhost:9000).
  endpoint = string(optional default("s3.amazonaws.com"))
  // S3 region (defaults to us-west-2).
  region = string(optional default("us-west-2"))
  // Use SSL for S3 connections (defaults to true).
  use-ssl = boolean(optional default(true))
  // Skip SSL certificate verification (defaults to false).
  skip-ssl-verify = boolean(optional default(false))
  // Maximum time-to-live for entries in the S3 cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
  // Number of concurrent workers for multi-part uploads (0 = use all CPU cores, defaults to 1).
  upload-concurrency = number(optional default(1))
  // Size of each part for multi-part uploads in megabytes (defaults to 16MB, minimum 5MB).
  upload-part-size-mb = number(optional default(16))
}

Current schema:

```hcl
// The stable API of the cache server.
apiv1 {}

// Caches artifacts from an Artifactory server.
artifactory target {
  // List of hostnames to accept for host-based routing. If empty, uses path-based routing only.
  hosts = [string](optional)
}

// Caches objects on local disk, with a maximum size limit and LRU eviction
disk {
  // Root directory for the disk storage.
  root = string
  // Maximum size of the disk cache in megabytes (defaults to 10GB).
  limit-mb = number(optional default(10240))
  // Maximum time-to-live for entries in the disk cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
  // Interval at which to check files for eviction (defaults to 1 minute).
  evict-interval = string(optional default("1m"))
}

// Caches Git repositories, including bundle and tarball snapshots.
git {
  // Directory to store git clones.
  mirror-root = string
  // How often to fetch from upstream in minutes.
  fetch-interval = string(optional default("15m"))
  // How long to cache ref checks.
  ref-check-interval = string(optional default("10s"))
  // How often to generate bundles. 0 disables bundling.
  bundle-interval = string(optional default("0"))
  // Depth for shallow clones. 0 means full clone.
  clone-depth = number(optional default(0))
}

// Caches public and authenticated GitHub releases.
github-releases {
  // GitHub token for authentication.
  token = string
  // List of private GitHub organisations.
  private-orgs = [string]
}

// A generic host-based proxying strategy.
host target {}

// Caches objects in memory, with a maximum size limit and LRU eviction
memory {
  // Maximum size of the disk cache in megabytes (defaults to 1GB).
  limit-mb = number(optional default(1024))
  // Maximum time-to-live for entries in the disk cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
}

// Caches objects in S3
s3 {
  // S3 bucket name.
  bucket = string
  // S3 endpoint URL (e.g., s3.amazonaws.com or localhost:9000).
  endpoint = string(optional default("s3.amazonaws.com"))
  // S3 region (defaults to us-west-2).
  region = string(optional default("us-west-2"))
  // Use SSL for S3 connections (defaults to true).
  use-ssl = boolean(optional default(true))
  // Skip SSL certificate verification (defaults to false).
  skip-ssl-verify = boolean(optional default(false))
  // Maximum time-to-live for entries in the S3 cache (defaults to 1 hour).
  max-ttl = string(optional default("1h"))
  // Number of concurrent workers for multi-part uploads (0 = use all CPU cores, defaults to 1).
  upload-concurrency = number(optional default(1))
  // Size of each part for multi-part uploads in megabytes (defaults to 16MB, minimum 5MB).
  upload-part-size-mb = number(optional default(16))
}
```
@alecthomas alecthomas requested a review from js-murph as a code owner January 21, 2026 02:35
@alecthomas alecthomas enabled auto-merge (squash) January 21, 2026 02:36
@alecthomas alecthomas merged commit afe6b41 into main Jan 21, 2026
4 of 6 checks passed
@alecthomas alecthomas deleted the aat/schema-dump branch January 21, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants