diff --git a/.gitignore b/.gitignore index d997f69..c3f0ee7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ block-test.hcl /*-source/ + +.env + +.claude/ diff --git a/Justfile b/Justfile index 6e00bf9..9b6763f 100644 --- a/Justfile +++ b/Justfile @@ -64,7 +64,7 @@ build-all: run: build @echo "→ Starting cachew at http://localhost:8080" @mkdir -p state - @{{ RELEASE }}/cachewd --config cachew.hcl + @{{ RELEASE }}/cachewd --config cachew-local.hcl # Clean up build artifacts clean: diff --git a/cachew-local.hcl b/cachew-local.hcl new file mode 100644 index 0000000..57595f3 --- /dev/null +++ b/cachew-local.hcl @@ -0,0 +1,32 @@ +# strategy git {} +# strategy docker {} +# strategy hermit {} + +# Artifactory caching proxy strategy +# artifactory "example.jfrog.io" { +# target = "https://example.jfrog.io" +# } + + +git { + mirror-root = "./state/git-mirrors" + clone-depth = 1000 + bundle-interval = "24h" +} + +host "https://w3.org" {} + +github-releases { + token = "${GITHUB_TOKEN}" + private-orgs = ["alecthomas"] +} + +disk { + root = "./state/cache" + limit-mb = 250000 + max-ttl = "8h" +} + +gomod { + proxy = "https://proxy.golang.org" +} \ No newline at end of file diff --git a/cachew.hcl b/cachew.hcl index 57595f3..369bc13 100644 --- a/cachew.hcl +++ b/cachew.hcl @@ -1,32 +1,35 @@ -# strategy git {} -# strategy docker {} -# strategy hermit {} +# Cachew unified configuration with tiered caching strategy +# Uses disk (L1) + S3 (L2) cache backends +# +# Required environment variable: +# - CACHEW_S3_BUCKET: S3 bucket name (REQUIRED) -# Artifactory caching proxy strategy -# artifactory "example.jfrog.io" { -# target = "https://example.jfrog.io" -# } +# First tier: Disk cache (fast local access) +# 500GB limit hardcoded - uses defaults for everything else +disk { + root = "./state/cache" + limit-mb = 512000 # 500GB +} +# Second tier: S3 cache (durable storage) +# Uses defaults for all optional fields (region=us-west-2, endpoint=s3.amazonaws.com, etc.) +s3 { + bucket = "${CACHEW_S3_BUCKET}" +} +# Git strategy configuration git { - mirror-root = "./state/git-mirrors" - clone-depth = 1000 + mirror-root = "./state/git-mirrors" + clone-depth = 1000 bundle-interval = "24h" } -host "https://w3.org" {} - +# GitHub releases caching github-releases { token = "${GITHUB_TOKEN}" - private-orgs = ["alecthomas"] -} - -disk { - root = "./state/cache" - limit-mb = 250000 - max-ttl = "8h" } +# Go module proxy gomod { proxy = "https://proxy.golang.org" -} \ No newline at end of file +}