Skip to main content
MinIOVFS mounts one bucket on a self-hosted MinIO server: every object becomes a file and every / in a key a folder. It reaches MinIO through its S3 API. Set up credentials as in MinIO setup.

Install

Configure

endpoint is required, since the server is self-hosted. region defaults to us-east-1. A mount takes MountMode.READ, WRITE or EXEC.

Fields

string
required
Name of the bucket to mount.
string
secret
Access key ID; set it with secretAccessKey. Unset uses the AWS SDK credential chain.
string
secret
Secret access key paired with accessKeyId.
string
secret
Session token for temporary credentials, sent with the access key pair.
string
Named profile in the shared AWS config and credentials files that supplies credentials when no access key pair is given.
boolean
default:"true"
Address the bucket in the URL path (<endpoint>/<bucket>/<key>) instead of as a subdomain of the endpoint.
string
Key prefix inside the bucket that the mount treats as its root; keys outside it are not visible. Leading slashes are dropped and a trailing / is added.
number
default:"DEFAULT_TIMEOUT"
Seconds a request may wait to connect, or between two reads of its answer, before it fails; a download that keeps flowing is never cut off.
string
secret
Proxy URL for every HTTP and HTTPS request to the endpoint.
string
default:"'us-east-1'"
Region requests are signed for; the gateway’s endpoint does not depend on it.
string
required
URL of the self-hosted S3 gateway, such as http://localhost:9000.
Fields marked secret are redacted in snapshots.

Authentication

Credentials come from accessKeyId and secretAccessKey, a MinIO access key, with sessionToken for temporary credentials. Without them, the AWS SDK reads its own chain: environment variables, ~/.aws/credentials, then the instance or container role. The key inherits its user’s policies: readonly to read, readwrite to write. A request the credentials may not make answers Permission denied.

Layout

/minio/data/file.txt is the key data/file.txt. Folders come from the / in keys; MinIO stores no folder objects.

Behavior

  • Key prefix: keyPrefix: 'users/42/' mounts only that part of the bucket, so /minio/notes.md is the key users/42/notes.md.
  • Conditional writes: MinIO ignores copy and delete conditions, so under write: conditional Mirage refuses a cp or mv within the mount, a mv out of it, rm and find -delete (ENOTSUP); a cp or mv into it from another mount is a write and goes through. See S3-compatible VFSes.

Browser

The browser MinIOVFS from @struktoai/mirage-browser keeps credentials off the page: a server signs a URL for each S3 call with the MinIO keys, and the browser fetches it.
  • MinIO answers CORS for every origin by default. To restrict it, set MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:5173,https://app.example.com on the server and restart it.
  • A browser mount cannot declare write: conditional, and any HTTP 403 from a signed URL, an expired one included, answers Permission denied.
  • keyPrefix set in the browser is no security boundary: enforce the prefix in the signing server.
  • endpoint only names the mount’s storage location: requests go to the host each signed URL names.
An Express route that signs URLs:
MinIO uses path-style URLs, since virtual-hosted buckets need extra DNS setup on a self-hosted server.Sign only the operations the app needs: a viewer needs GET, HEAD and LIST.
string
required
Name of the bucket to mount.
function
required
secret
Function (path, operation, options) that returns a signed URL for each S3 operation; your server signs it, so the browser holds no keys.
string
Region of the bucket. Most providers derive the endpoint from it; requests go to the host each presigned URL names.
string
Endpoint URL that replaces the one the provider derives. Requests go to the host each presigned URL names; the mount uses it to name its storage location.
string
default:"'application/octet-stream'"
Content-Type stored with every object the mount writes.
string
Key prefix the mount treats as its root. The browser can change it before a URL is signed, so enforce the prefix on the signing server.
number
default:"DEFAULT_TIMEOUT"
Seconds a request may wait to connect, or between two reads of its answer, before it fails; a download that keeps flowing is never cut off.
Fields marked secret are redacted in snapshots.

Integration

MinIO answers these commands through its own API, so fewer objects are read. See Integration.
  • md5sum: the object’s ETag, when it is the MD5 (a single-part upload, unencrypted or under SSE-S3).
  • find: one recursive listing.
  • du: one recursive listing.
  • ls -R and tree: one recursive listing.

VFS.md

The VFS.md an agent reads with MinIO mounted at /<path>. <mode> is the mount’s mode: read, write or exec. The commands shown are those of a write mount.
Virtual FilesystemSupported Unix Commands for VFSUnix commands work on each path as on a local filesystem, as far as the path supports them:Limitations of Unix Commands for VFSWhere a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.