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.
Where the config is loaded from
Section titled “Where the config is loaded from”The first file that exists wins:
--storage-config <path>$REREEL_STORAGE_CONFIG./rereel.storage.json(current working directory)~/.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.
{ "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>.
Providers
Section titled “Providers”The default. A content-addressed store on the local disk.
{ "type": "local-cache", "cacheDir": "/Volumes/media/rereel-cas" }cacheDirdefaults to~/.cache/rereel/cas.- Objects are stored at
<cacheDir>/<sha[0:2]>/<sha><ext>, with URIs of the formcas://<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.
{ "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" }Create an R2 API token with Object Read & Write on the bucket and export its S3 credentials:
export R2_ACCESS_KEY_ID=...export R2_SECRET_ACCESS_KEY=...{ "type": "s3", "bucket": "my-video-assets", "region": "ap-northeast-1", "prefix": "rereel" }- Set
regionexplicitly. Whenendpointis omitted it becomeshttps://s3.<region>.amazonaws.com. The defaultregionis"auto", which AWS rejects in signatures. - Credentials come from
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYunlessaccessKeyEnv/secretKeyEnvname other variables. - Requests are path-style (
<endpoint>/<bucket>/<key>). Session tokens (AWS_SESSION_TOKEN) are not sent, so use long-lived IAM user keys, not temporary STS credentials.
GCS is used through its S3-compatible XML API with HMAC keys (Cloud Storage → Settings → Interoperability):
{ "type": "s3", "bucket": "my-video-assets", "endpoint": "https://storage.googleapis.com", "region": "auto", "prefix": "rereel", "accessKeyEnv": "GCS_HMAC_ACCESS_ID", "secretKeyEnv": "GCS_HMAC_SECRET" }Read-only. Downloads with GET and verifies the SHA-256 after download.
{ "type": "http", "baseUrl": "https://cdn.example.com/rereel" }A lock entry’s uri is used as-is if it is an http(s):// URL. Otherwise it is appended to baseUrl. Because store() throws, freeze cannot use this provider. Use it for lock entries you write yourself, or through the TypeScript API, for public assets.
Delegates to any CLI, such as an internal asset DB, a NAS, or DVC.
{ "type": "command", "storeCommand": "my-asset-cli add {path} --kind {kind} --json", "resolveCommand": "my-asset-cli get {uri} --out {dest}", "defaultTags": "rereel" }Placeholders are replaced with shell-quoted values, and the command runs with /bin/sh -c.
| Command | Placeholders | Must output |
|---|---|---|
storeCommand |
{path}, {kind}, {sha256}, {tags} |
A JSON line with uri / asset_uri, or id / asset_id (which becomes asset://<id> unless it already contains ://). Otherwise the last stdout line is taken as the URI. |
resolveCommand |
{uri}, {dest}, {sha256} |
Either write the file to {dest}, or print JSON with localPath / local_path / path, or print a path on the last line. rereel copies it to {dest}. |
{tags} comes from freeze --tags, falling back to defaultTags ("rereel"). A minimal NAS-backed example:
{ "type": "command", "storeCommand": "cp {path} /mnt/nas/rereel/{sha256} && echo nas://{sha256}", "resolveCommand": "sh -c 'cp \"/mnt/nas/rereel/${1#nas://}\" \"$2\"' _ {uri} {dest}" }Object layout
Section titled “Object layout”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.
Recommended .gitignore
Section titled “Recommended .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.
Errors you may see
Section titled “Errors you may see”| 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.