Skip to content

Storage providers

freeze uploads media through a storage provider and records the returned URI in rereel.lock.json. hydrate (and build) download it again through the provider named in each lock entry.

The first file that exists wins:

  1. --storage-config <path>
  2. $REREEL_STORAGE_CONFIG
  3. ./rereel.storage.json (current working directory)
  4. ~/.config/rereel/storage.json

Your providers are merged over two built-in ones, local-cache and http. If defaultProvider is omitted, it is local-cache.

rereel.storage.json
{
"defaultProvider": "r2",
"providers": {
"r2": { "type": "s3", "bucket": "my-video-assets", "endpoint": "https://<account-id>.r2.cloudflarestorage.com",
"region": "auto", "prefix": "rereel",
"accessKeyEnv": "R2_ACCESS_KEY_ID", "secretKeyEnv": "R2_SECRET_ACCESS_KEY" }
}
}

The config holds environment variable names, not secrets, so it is safe to commit. Choose the provider at freeze time with defaultProvider or freeze --provider <name>.

The default. A content-addressed store on the local disk.

{ "type": "local-cache", "cacheDir": "/Volumes/media/rereel-cas" }
  • cacheDir defaults to ~/.cache/rereel/cas.
  • Objects are stored at <cacheDir>/<sha[0:2]>/<sha><ext>, with URIs of the form cas://<sha><ext>. Files are cloned copy-on-write where the filesystem supports it.
  • Good for solo work and tests. A fresh clone on another machine cannot hydrate from it.

The s3 type stores each file once at <prefix>/<sha[0:2]>/<sha><ext> (default prefix rereel) and records s3://<bucket>/<prefix>/<sha[0:2]>/<sha><ext>. Identical files across reels share one object. Every download, from any provider, is hashed again and compared with the lockfile.

.gitignore
# rereel build output and hydrated media
**/media/
**/build/

Commit rereel.storage.json. It contains no secrets. Keep the actual keys in your shell, a secret manager, or CI secrets.

Error Cause
Unknown storage provider: r2 (exit 2, with available) The lockfile or --provider names a provider missing from the loaded config
Missing S3 credentials in env vars … (exit 2) The environment variables named by accessKeyEnv / secretKeyEnv are not set
S3 PUT failed (403) / S3 GET failed (404) (exit 4) Permissions, wrong endpoint/region, or a missing object
SHA-256 mismatch for media/… (exit 1) The stored object differs from the locked bytes

See the storage reference for the full schema.