Object storage
Anastro uses object storage for two things: Postgres backups (backup.store) and machine
workspaces (filesystem.store). Each is configured as a named [storage.<name>] table.
Backups and workspaces must use separate buckets, and no two stores may share overlapping prefixes.
(Thread payloads currently stay inline in Postgres; pidurable.payload_store is accepted in config
but unused.)
Supported providers
Section titled “Supported providers”| Provider | Key fields | Best for |
|---|---|---|
r2 |
account_id, bucket, prefix, credentials, temp_credentials |
Cloudflare R2 |
s3 |
endpoint, region, bucket, prefix, path_style, credentials, sts_role_arn |
AWS S3 and S3-compatible stores (Garage, SeaweedFS, MinIO) |
garage |
replication |
Workspaces only: built-in Garage on cluster storage nodes |
local |
path (under /var/lib/anastro-objects/) |
Single-node clusters only: a directory on the node’s own disk |
Any prefix must end with /. For s3, endpoint defaults to AWS for region (default
us-east-1), and path_style defaults to true.
Cloudflare R2
Section titled “Cloudflare R2”[storage.backups]provider = "r2"account_id = "a1b2c3d4e5f6"bucket = "anastro-prod-backups"prefix = "pg/"access_key_id = "secret:storage/backups/access_key_id"secret_access_key = "secret:storage/backups/secret_access_key"
[storage.workspaces]provider = "r2"account_id = "a1b2c3d4e5f6"bucket = "anastro-prod-workspaces"access_key_id = "secret:storage/workspaces/access_key_id"secret_access_key = "secret:storage/workspaces/secret_access_key"temp_credentials = { api_token = "secret:storage/workspaces/cf_api_token", max_ttl = "1h" }Create two buckets and three tokens:
| Token | Permission | Secrets in secrets.age |
|---|---|---|
| Backups | Read + write on backups bucket | storage/backups/access_key_id, secret_access_key |
| Workspaces | Read + write + delete on workspaces bucket | storage/workspaces/access_key_id, secret_access_key |
| Credential minter | Cloudflare API token allowed to mint R2 temporary credentials for the workspaces bucket | storage/workspaces/cf_api_token |
Consider adding an R2 bucket lock rule on the backups bucket so even a compromised control plane can’t delete recent backups.
AWS S3 and S3-compatible stores
Section titled “AWS S3 and S3-compatible stores”A workspaces store on S3 requires sts_role_arn so the control plane can mint read-only host
credentials via STS AssumeRole:
[storage.workspaces]provider = "s3"endpoint = "https://s3.example.com"bucket = "anastro-workspaces"access_key_id = "secret:storage/workspaces/access_key_id"secret_access_key = "secret:storage/workspaces/secret_access_key"sts_role_arn = "arn:aws:iam::123456789012:role/anastro-workspaces-read"In-cluster Garage
Section titled “In-cluster Garage”You can host workspaces on your cluster’s own disks using nodes with the storage role. Anastro
runs Garage and an internal gateway that mints scoped credentials just like R2—no external bucket
or tokens to configure.
[storage.workspaces]provider = "garage"replication = 3 # copies per object across storage nodes (default 3)
# nodes/cp1.toml[node]roles = ["controlplane", "storage"]
[node.storage]objects_disk = "/dev/vdb" # formatted automatically if emptyzone = "rack-a" # failure domain (defaults to node name)capacity = "90%" # share of objects_disk Garage may use- Replication: Garage keeps
replicationcopies across distinct storage nodes and zones (withreplication = 3, one storage node can be down for upgrades while writes continue).replicationcannot exceed your number of storage nodes. Setzoneto whatever fails together (e.g. physical host name). - Disks: multi-node clusters require
objects_diskon every storage node; a single node can fall back to a local directory. - Secrets: after adding a
garagestore, runanastroctl cluster bundle initto generate Garage’s keys, thenanastroctl cluster unseal. Storage-only nodes (not incontrol_plane) only unseal fromanastroctl cluster unseal, not from peers. - Network: storage nodes talk to each other on TCP 3901 and 3903 within
network.private.cidr; all other nodes reach gateways over iroh via local loopback127.0.0.1:7448. - Keep backups external: only workspaces can use
garage. Put backups on R2 or S3 so you can recover if the cluster loses its disks.
Once enough storage nodes are up, their gateways join Garage, apply the layout, create the bucket,
and log garage is ready in journalctl -u anastro-objects. Verify with:
anastroctl cluster storage test workspacesRotate Garage credentials or remove a storage role
Section titled “Rotate Garage credentials or remove a storage role”Before your first rotation, make sure every node runs a release that supports Garage credential
generations (cluster bundle init initializes generation 0 without changing active keys).
Routine rotation:
anastroctl cluster bundle rotate-garagegit add secrets.age && git commit -m 'Rotate Garage credentials'anastroctl cluster unseal -n <each-storage-node>anastroctl cluster unsealanastroctl cluster storage test workspacesUnseal storage nodes first so control-plane clients never send new credentials to an older
gateway, and unseal all storage nodes in one short window since Garage RPC shares a cluster-wide
secret. Old S3 keys expire automatically after a 5-minute overlap window, and Garage records a
generation floor on disk so replaying an older secrets.age is always rejected (keep your latest
secrets.age backed up for recovery).
To remove the storage role from a node without handing it the replacement keys:
- Remove
"storage"from that node’s file and runanastroctl cluster bundle rotate-garage. - Unseal only the remaining storage nodes (
-n), skipping the node being removed. - Apply the removed node’s config within the 5-minute overlap window. It confirms Garage has
bounded its old key, stops
anastro-objectsand Garage, and wipes its local Garage credentials. - Apply the remaining nodes, then run
cluster unsealon the removed node for cleanup. - Confirm
revoking the superseded garage keyinanastro-objectslogs and runanastroctl cluster storage test workspaces.
Credential isolation
Section titled “Credential isolation”Master bucket credentials never leave the control plane. Workers read workspaces using temporary read-only credentials scoped to a single org’s prefix (roughly matching their lease), and upload each new data pack through a single-object presigned URL. Workers can never overwrite or delete objects—only control-plane garbage collection deletes. Backup credentials go solely to the Postgres primary for WAL-G.
Test a store
Section titled “Test a store”anastroctl cluster storage test backupsanastroctl cluster storage test workspaces -n cp2Runs an end-to-end probe from the node: put, get, range-get, list, delete, and a clock-skew check (must be within 5 minutes). For workspaces, it also mints a host credential and presigned upload URL and verifies neither can delete, overwrite, or read outside its org prefix. Run this after unsealing secrets.
The Postgres primary also checks every store in use with a single HEAD request every 5 minutes, and
raises StoreUnreachable when one doesn’t answer within 10 seconds.
Workspace garbage collection
Section titled “Workspace garbage collection”A workspace checkpoint becomes Portable once its data packs reach object storage; before that, it’s local to the host. Moves, worker removal, and writable workstation mounts always wait for a Portable checkpoint—an expired lease alone never discards unuploaded edits.
The schedd leader runs garbage collection on [filesystem.gc] schedule:
[filesystem.gc]schedule = "daily 04:30" # UTCgrace = "24h" # protects in-flight uploads not yet committeddelete_after = "7d" # delay before deleting unreferenced objectsorphan_retention = "30d" # how long snapshots orphaned by a restore remain adoptableObjects unique to a deleted workspace disappear after roughly grace + delete_after + 1d. If
backups are enabled, keep backup.policy.pitr_window <= delete_after so point-in-time restores
never reference deleted workspace data.
User pins, retained thread references, and fork heads protect their snapshots (pinning is serialized with GC so it can’t race deletion). See Keep a machine after archive for machine cleanup rules.
anastroctl cluster fs status # last GC pass and whether GC is waiting on a reindexanastroctl cluster fs gc # full summary of last passanastroctl cluster fs gc --now # run GC immediately and waitGcStalled fires when no pass has finished for an hour past its scheduled time, or the last pass
reported errors.
The agents sidecar also cleans up abandoned rollback branches in Postgres after
[pidurable] rolled_back_retention (default 30d), while preserving any history needed by
surviving forks.
Rotate workspace encryption keys
Section titled “Rotate workspace encryption keys”Rotate the DWFS root key without rewriting any workspace data:
anastroctl cluster bundle rekey --dwfs-rootThis updates secrets.age, pushes both the new and previous root keys to control-plane nodes,
rewraps all org keys, and drops the old root when done (re-run safely if interrupted, then commit
secrets.age). This is independent of cluster bundle rekey --kek, which rotates the cluster
secret store’s KEK.
To permanently crypto-shred an org’s workspace data, a human org owner runs:
anastroctl cluster fs org shred <org UUID> --confirm 'shred <org UUID>'Thread credentials, service accounts, and API keys are refused. Existing encrypted data becomes unreadable immediately (older copies of the key remain in Postgres backups until those backups expire).
Move to another store
Section titled “Move to another store”To migrate workspaces from one store to another (e.g., local → R2, or R2 → in-cluster Garage),
define the new [storage.<name>] store, unseal its secrets, and run:
anastroctl cluster storage migrate workspaces --to workspaces-r2anastroctl cluster applyanastroctl cluster storage migrate workspaces --to workspaces-r2The first migrate copies every object while verifying BLAKE3 hashes (skipping anything already
present), updates anastro.toml to point at the new store, and marks the old store
read_only = true. After cluster apply, the second migrate catches any objects written during
the cutover. Snapshot IDs stay identical.