Recipes

RustFS

S3-compatible object store — S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY, /data volume, console on :9001.

RustFS is the default oke dev / prod store.files image — an Apache-2.0 S3-compatible object store. Driver id stays s3; Bun binds Bun.S3Client against the endpoint.

The one rule

Protocol name is s3 — vendor choice is the image pin (rustfs/rustfs:…) plus S3_ENDPOINT. Never invent a rustfs driver id.

Quick start

Pin driver + image (templates already do)

oke.config.ts
drivers: {
  store: {
    files: { dev: "s3", test: "memory", prod: "s3" },
  },
},
images: {
  store: { files: "rustfs/rustfs:1.0.0-rc.5" },
},

Credentials and endpoint

.env.local (written by oke docker)
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_BUCKET=oke
S3_ENDPOINT=http://127.0.0.1:9000
S3_URL=http://…@127.0.0.1:9000/oke
S3_REGION=us-east-1
S3_CONSOLE_URL=http://127.0.0.1:9001

Recipe maps:

  • RUSTFS_ACCESS_KEY=${S3_ACCESS_KEY_ID}
  • RUSTFS_SECRET_KEY=${S3_SECRET_ACCESS_KEY}
  • RUSTFS_CONSOLE_ENABLE=true
  • RUSTFS_ADDRESS=:9000
  • command: /data

Put an object

Any flow using fx.store files (put / get) against the s3 driver talks to this endpoint. Open S3_CONSOLE_URL for a browser console on port 9001.

Required env

VariableRequired?Meaning
S3_ACCESS_KEY_IDYesAccess key → RUSTFS_ACCESS_KEY
S3_SECRET_ACCESS_KEYYesSecret key → RUSTFS_SECRET_KEY
S3_BUCKETYes (app)Bucket name the driver opens
S3_ENDPOINTYes (non-AWS)Origin http://host:9000
S3_REGIONOptionalDefault us-east-1 in stack env
S3_SESSION_TOKENOptionalTemporary creds
S3_CONSOLE_URLWritten by stackUI on :9001 — not required by the driver
S3_URLWritten by stackCredentialed URL form

Data and backup

VolumePathWhat it stores
store-files-data/dataObject bytes + RustFS metadata

Backup means: snapshot that named volume (or aws s3 sync against the API). Deleting the volume deletes every object.

Credentials live in .env.local, not in /data — rotate keys without wiping objects. Losing both volume and keys means full restore from backup only.

Production note

For cloud prod, point the same s3 driver at real S3 / R2 / GCS interop by changing S3_ENDPOINT + keys — keep the driver id. Self-hosted RustFS on a single node is a durability SPOF: put the /data volume on reliable disks and back it up.

Do not publish :9000 / :9001 on the public internet without TLS and network policy — the recipe enables the console for local ops.

What the recipe configures

FieldValue
API port9000
Extra port9001 → console
Healthcheckcurl -f http://127.0.0.1:9000/health, every 5s, 12 retries, 10s start
Connection URLhttp://user:pass@host:9000/bucket

Troubleshooting

Learn more

Next

On this page