Storage configuration
Media bytes never go into Git. freeze stores each new file through a storage provider and records the returned URI in rereel.lock.json. hydrate and build resolve those URIs back to files. Providers are configured in rereel.storage.json. For walkthroughs, see the Storage providers guide.
Configuration lookup
Section titled “Configuration lookup”The configuration is loaded once per CLI invocation (for every command). The first file that exists among these candidates is used:
--storage-config <path>$REREEL_STORAGE_CONFIG./rereel.storage.json(current working directory, not the bundle directory)~/.config/rereel/storage.json
Relative paths are resolved against the current working directory. If no candidate exists, the built-in default is used.
Built-in default
Section titled “Built-in default”{ "defaultProvider": "local-cache", "providers": { "local-cache": { "type": "local-cache", "cacheDir": "~/.cache/rereel/cas" }, "http": { "type": "http" } }}Merging
Section titled “Merging”The loaded file is shallow-merged over the default:
defaultProviderfrom the file, elselocal-cache.providers= default providers plus your providers. A provider with the same name (local-cache,http) replaces the default entry entirely.
So local-cache and http are always available unless you redefine them.
File format
Section titled “File format”{ "defaultProvider": "r2", "providers": { "<name>": { "type": "local-cache" | "s3" | "http" | "command", "...": "type-specific fields" } }}| Field | Type | Description |
|---|---|---|
defaultProvider |
string | Provider used by freeze when --provider is omitted, by hydrate for lock items without provider, and for templates without template.provider. |
providers |
Record<string, StorageProviderConfig> |
Named providers. |
Provider selection
Section titled “Provider selection”- Storing (
freeze):--provider <name>, elsedefaultProvider. The provider name is written into each new lock item’sprovider. - Resolving (
hydrate/build): each lock item’sprovider, elsedefaultProvider. Every machine that hydrates must therefore define a provider with that name. An unknown name fails with exit2and anavailablelist in the error JSON.
local-cache
Section titled “local-cache”A content-addressed store on the local filesystem.
| Field | Type | Default | Description |
|---|---|---|---|
type |
"local-cache" |
— | |
cacheDir |
string | ~/.cache/rereel/cas |
Cache root. |
- Store: copies (copy-on-write clone where supported) the file to
<cacheDir>/<sha256[0:2]>/<sha256><ext>if it is not there yet. Returnscas://<sha256><ext>(extension lower-cased). - Resolve: strips
cas://, copies<cacheDir>/<first 2 chars>/<key>to the destination. Missing object → exit1.
{ "defaultProvider": "team-nas", "providers": { "team-nas": { "type": "local-cache", "cacheDir": "/Volumes/video/rereel-cas" } }}S3-compatible object storage (AWS S3, Cloudflare R2, Google Cloud Storage XML API, MinIO, …) using built-in SigV4 signing and fetch, with no SDK dependency.
| Field | Type | Default | Description |
|---|---|---|---|
type |
"s3" |
— | |
bucket |
string | — (required) | Bucket for uploads. Missing → exit 2 when the provider is first used. |
endpoint |
string | https://s3.<region>.amazonaws.com (us-east-1 if region is auto) |
Service endpoint. Trailing slashes are removed. |
region |
string | auto |
SigV4 signing region. |
prefix |
string | rereel |
Key prefix (leading/trailing slashes trimmed). |
accessKeyEnv |
string | AWS_ACCESS_KEY_ID |
Name of the env var holding the access key. |
secretKeyEnv |
string | AWS_SECRET_ACCESS_KEY |
Name of the env var holding the secret key. |
- Requests use path-style URLs:
<endpoint>/<bucket>/<key>. - Store:
PUTto key<prefix>/<sha256[0:2]>/<sha256><ext>. Returnss3://<bucket>/<key>. - Resolve: parses
s3://<bucket>/<key>(anything else → exit2) andGETs<endpoint>/<bucket>/<key>. The bucket comes from the URI, the endpoint and credentials from the provider config. - Credentials are read at request time. Missing env vars → exit
2. Non-2xx responses → exit4.
Cloudflare R2
{ "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" } }}AWS S3
{ "providers": { "s3": { "type": "s3", "bucket": "my-video-assets", "region": "ap-northeast-1" } }}Google Cloud Storage (XML API with HMAC keys)
{ "providers": { "gcs": { "type": "s3", "bucket": "my-video-assets", "endpoint": "https://storage.googleapis.com", "region": "auto", "accessKeyEnv": "GCS_HMAC_ACCESS_ID", "secretKeyEnv": "GCS_HMAC_SECRET" } }}Read-only HTTP(S) download.
| Field | Type | Default | Description |
|---|---|---|---|
type |
"http" |
— | |
baseUrl |
string | — | Prefix for non-URL URIs (trailing slashes removed). |
- Store: always fails with exit
2(read-only). Do not use it as thefreezeprovider. - Resolve: if the URI starts with
http://orhttps://it is fetched as-is. Otherwise<baseUrl>/<uri without leading slashes>is fetched (or the URI as-is if there is nobaseUrl). Non-2xx → exit4. No authentication headers are sent.
Use it for public CDNs or lock entries that you write by hand:
{ "providers": { "cdn": { "type": "http", "baseUrl": "https://cdn.example.com/rereel" } }}"media/intro_1a2b3c4d.mp4": { "source": "storage", "provider": "cdn", "uri": "intro/1a2b3c4d.mp4", "sha256": "1a2b3c4d…", "bytes": 1048576, "kind": "video"}command
Section titled “command”Delegates storing and resolving to any shell command, so rereel can integrate with an existing asset database, DVC, rclone, gsutil, or similar tools.
| Field | Type | Default | Description |
|---|---|---|---|
type |
"command" |
— | |
storeCommand |
string | — | Template run by freeze. Missing → exit 2 on store. |
resolveCommand |
string | — | Template run by hydrate/build. Missing → exit 2 on resolve. |
defaultTags |
string | rereel |
Value of {tags} when freeze --tags is not given. |
Commands run with /bin/sh -c with a 300-second timeout. The working directory and environment are inherited.
Placeholders
Section titled “Placeholders”Every {name} placeholder is replaced with a single-quoted, shell-escaped value, so do not add quotes around placeholders. Unknown placeholders become an empty string.
| Placeholder | storeCommand |
resolveCommand |
|---|---|---|
{path} |
Absolute local file path | — |
{kind} |
Media kind (image, video, audio, font, svg, archive, other) |
— |
{sha256} |
File SHA-256 | Expected SHA-256 from the lockfile (empty for template archives) |
{tags} |
--tags or defaultTags |
— |
{uri} |
— | URI from the lockfile |
{dest} |
— | Absolute destination path to write |
storeCommand output
Section titled “storeCommand output”stdout is examined in this order:
- The last line of stdout that parses as a JSON object (falling back to parsing the whole stdout):
uriorasset_uri→ used as the URI.- else
idorasset_id→ used as-is if it contains://, otherwise becomesasset://<id>.
- Otherwise, the last non-empty stdout line, as plain text.
- Empty output → exit
4.
A non-zero exit status → exit 4 (exit 3 if /bin/sh cannot be spawned).
resolveCommand output
Section titled “resolveCommand output”After the command exits with status 0:
- If
{dest}now exists, it is used. - Else if the last JSON-object line has
localPath,local_path, orpathpointing to an existing file, that file is copied to{dest}. - Else if the last stdout line is an existing file path, that file is copied.
- Otherwise, exit
4(resolveCommand did not produce a valid file for <uri>).
The file is then SHA-256-verified by hydrate.
Example
Section titled “Example”{ "defaultProvider": "assetdb", "providers": { "assetdb": { "type": "command", "storeCommand": "my-asset-cli add {path} --kind {kind} --tags {tags} --json", "resolveCommand": "my-asset-cli get {uri} --out {dest}", "defaultTags": "rereel,video" }, "rclone": { "type": "command", "storeCommand": "rclone copyto {path} remote:videos/$(basename {path}) && echo rclone://videos/$(basename {path})", "resolveCommand": "rclone copyto \"remote:$(echo {uri} | sed 's#^rclone://##')\" {dest}" } }}URI schemes
Section titled “URI schemes”The URI in a lock item is opaque to rereel. Only the provider named in provider interprets it.
| Scheme | Produced by | Resolved by |
|---|---|---|
cas://<sha256><ext> |
local-cache store |
local-cache |
s3://<bucket>/<prefix>/<xx>/<sha256><ext> |
s3 store |
s3 (any S3-compatible endpoint configured on the resolving machine) |
https://…, http://…, or a relative path |
hand-written | http |
asset://<id> |
command store returning id / asset_id |
command |
| anything else | command store |
command |
Template archives (template.source: "storage") use the same providers via template.uri / template.provider.
SHA-256 verification
Section titled “SHA-256 verification”freezehashes every media file and storessha256andbytesin the lockfile.hydrate(and thereforebuild) skips files whose on-disk SHA-256 already matches. Otherwise it resolves the file and re-hashes it after download. A mismatch fails with exit1and error details{relPath, uri, expected, actual}. The mismatched file stays on disk and will be re-fetched on the next run.- Providers themselves do not verify. Verification is centralized in
hydrate, so customcommandproviders get it for free. validate --check-mediare-hashes all hydrated storage items without fetching.- Not verified:
source: "template"items (copied from the template directory) and template archives downloaded fortemplate.source: "storage".