Turborepo Remote Cache's open source alternative.
It supports Cloudflare Workers and Node.js.
- Login and link
# In a monorepo turbo login --login YOUR_DOMAIN --api YOUR_DOMAIN/api turbo link --login YOUR_DOMAIN --api YOUR_DOMAIN/api
- Edit
.turbo/config.json
{ "apiurl": "YOUR_DOMAIN/api", "loginurl": "YOUR_DOMAIN", "teamslug": null, "teamid": "YOUR_ORG" }
pnpm install
cp .dev.vars.example .dev.vars
- Create a GitHub OAuth app link
- Set the redirection URL as
http://localhost:8787/turborepo/redirect
- Create a secret
- Copy them to
.dev.vars
GITHUB_CLIENT=YOUR_CLIENT GITHUB_CLIENT_SECRET=YOUR_CLIENT_SECRET
- Set an organization to allow to access the cache
ALLOWED_ORG=YOUR_ORG
- Create buckets for Turbo
wrangler r2 bucket create turbo-artifacts wrangler r2 bucket create preview-turbo-artifacts
- Comment
TOKENS
onwrangler.toml
- [[kv_namespaces]] - binding = "TOKENS" - id = "c26c953846004524851a7bca67b624e6" - preview_id = "b4ec6bc69c3e415289ec3d47fde77712" + # [[kv_namespaces]] + # binding = "TOKENS" + # id = "c26c953846004524851a7bca67b624e6" + # preview_id = "b4ec6bc69c3e415289ec3d47fde77712"
- Create a bucket
- Create a Google Service Account for the bucket and download it to a JSON file
- Encode the account to Base64 string, then set
GOOGLE_SERVICE_ACCOUNT
of.dev.vars
cat ./service-account.json | base64
- Comment R2 config on
wrangler.toml
- [[r2_buckets]] - binding = "TURBO_ARTIFACTS" - bucket_name = "turbo-artifacts" - preview_bucket_name = "preview-turbo-artifacts" + # [[r2_buckets]] + # binding = "TURBO_ARTIFACTS" + # bucket_name = "turbo-artifacts" + # preview_bucket_name = "preview-turbo-artifacts"
- Create KV namespaces for GCP tokens
wrangler kv:namespace create TOKENS wrangler kv:namespace create TOKENS --preview
- Replace
TOKENS
's IDs onwrangler.toml
- Set
BUCKET_NAME
on.dev.vars
- Do the above "development" steps
- Run
wrangler publish
- Set variables and secrets
- Do the above "development" steps via using GCP
- Run
docker build . -t turbo-cache
- Run
docker run --env-file .dev.vars -it -p 8787:8787 turbo-cache