Self-host your turborepo remote cache powered by React Router
- Store artifacts where you want
- fs: file storage (example)
- s3: https://aws.amazon.com/s3/ (example)
- azure: https://azure.microsoft.com/en-us/services/storage/blobs/
- Manage users & teams
- Manage saved artifacts (list, delete, download)
- Manage tokens (generated by yourslef for a CI or generated by the turborepo cli)
- See sessions globally, by user or by teams
- See artifacts globally, by user or by teams
- Display times saved by using the remote caching
- Probably can be deployed anywhere that supports a Node.js server (Deploying a React Router app)
- Docker Image support thibmarechal/turborepo-remote-cache
- ADMIN_USERNAME : admin
- ADMIN_NAME : Admin
- ADMIN_PASSWORD : turbo
- ADMIN_EMAIL
- COOKIE_SECRET : secret used to sign the session cookie. Set it to a long random value (e.g.
openssl rand -hex 32): when it is not set, a random secret is generated at startup and users are logged out on every restart - COOKIE_NOT_SECURE : set to
trueonly when the app is not served over https
- STORAGE_TYPE : the type of storage to use (default: fs, options: fs ,s3, azure)
- STORAGE_FS_PATH : the path where to storage the cache,
- STORAGE_S3_ACCESS_KEY_ID
- STORAGE_S3_SECRET_ACCESS_KEY
- STORAGE_S3_FORCE_PATH_STYLE
- STORAGE_S3_ENDPOINT
- STORAGE_S3_REGION
- STORAGE_S3_SSL_ENABLED
- STORAGE_S3_BUCKET
- STORAGE_AZURE_STORAGE_ACCOUNT
- STORAGE_AZURE_STORAGE_ACCESS_KEY
- STORAGE_AZURE_STORAGE_CONTAINER
- DATABASE_URL
//.turbo/config.json
{
"apiUrl": "http://localhost:8080/turbo/api",
"loginUrl": "http://localhost:8080/turbo/login"
}// Link the repository to this remote server caching
npx turbo login
npx turbo link
- Install dependencies
yarn install- Launch a postgres database You can use Docker with the docker-commpose.db.yml file if you want
docker-compose -f docker-compose.db.yml up -d- Launch the dev server
yarn devThis starts your app in development mode, rebuilding assets on file changes.
First, build your app for production:
yarn buildThen run the app in production mode:
yarn startNow you'll need to pick a host to deploy it.
You can also use the Dockerfile
In some cases you may need to use HTTP/2. To do so set the environment variable USE_HTTP2_NO_TLS=1.
E.g. Google CloudRun will have a payload limit of 32MB if you use HTTP/1.1, but some artifacts may be bigger than that. There is no limit when using HTTP/2.
Make sure to set --use-http2 on cloud run. See https://cloud.google.com/run/docs/configuring/http2
If the app runs behind a reverse proxy that terminates HTTPS (Traefik, nginx, a load balancer...), set the environment variable TRUST_PROXY=true.
The app then uses the X-Forwarded-Proto and X-Forwarded-Host headers sent by the proxy, so that the OAuth redirect_uri (Azure AD / OIDC login) uses https:// and your public host name.
Only enable it when the app is reachable through the proxy only, since these headers are trusted as-is.