From d4ce7d5009059dba1c0f6033d0083d3a80e72319 Mon Sep 17 00:00:00 2001 From: Neha Sherpa Date: Wed, 4 Feb 2026 11:04:46 -0800 Subject: [PATCH] refactor: Consolidate config files to use cachew.hcl for local development Remove cachew.hcl (production config) and rename cachew-local.hcl to cachew.hcl. Remove references to cachew-local.hcl in Justfile and remove copying cachew.hcl in the Docker image, as configs should be mounted or provided via environment variables at runtime. Co-Authored-By: Claude Sonnet 4.5 --- Justfile | 2 +- cachew-local.hcl | 32 -------------------------------- cachew.hcl | 41 +++++++++++++++++++---------------------- docker/Dockerfile | 3 --- 4 files changed, 20 insertions(+), 58 deletions(-) delete mode 100644 cachew-local.hcl diff --git a/Justfile b/Justfile index 2faa919..17865b2 100644 --- a/Justfile +++ b/Justfile @@ -68,7 +68,7 @@ build-all: run: build @echo "→ Starting cachew at http://localhost:8080" @mkdir -p state - @{{ RELEASE }}/cachewd --config cachew-local.hcl + @{{ RELEASE }}/cachewd --config cachew.hcl # Clean up build artifacts clean: diff --git a/cachew-local.hcl b/cachew-local.hcl deleted file mode 100644 index 57595f3..0000000 --- a/cachew-local.hcl +++ /dev/null @@ -1,32 +0,0 @@ -# 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 369bc13..57595f3 100644 --- a/cachew.hcl +++ b/cachew.hcl @@ -1,35 +1,32 @@ -# Cachew unified configuration with tiered caching strategy -# Uses disk (L1) + S3 (L2) cache backends -# -# Required environment variable: -# - CACHEW_S3_BUCKET: S3 bucket name (REQUIRED) +# strategy git {} +# strategy docker {} +# strategy hermit {} -# First tier: Disk cache (fast local access) -# 500GB limit hardcoded - uses defaults for everything else -disk { - root = "./state/cache" - limit-mb = 512000 # 500GB -} +# Artifactory caching proxy strategy +# artifactory "example.jfrog.io" { +# target = "https://example.jfrog.io" +# } -# 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" } -# GitHub releases caching +host "https://w3.org" {} + 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 diff --git a/docker/Dockerfile b/docker/Dockerfile index b7bcb2b..1d950ca 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,9 +16,6 @@ WORKDIR /app # Copy pre-built binary from host (built by Justfile) COPY dist/cachewd-linux-${TARGETARCH} /usr/local/bin/cachewd -# Copy default configuration file -COPY cachew.hcl /app/cachew.hcl - # Create state directory with proper permissions RUN mkdir -p /app/state/cache && \ chown -R cachew:cachew /app