Storage Services π‘ BETA
Drive stores bot files on an S3-compatible endpoint; the default is the self-hosted OtterIO shipped with the stack, with Backblaze B2, Cloudflare R2 and Wasabi selectable without a rebuild.
When to use
- Choosing or changing the object-storage backend for a deployment.
- Explaining why Drive has no public bucket and no direct-to-S3 URL.
- Investigating egress charges or a failed read after a backend change.
botdrive::storage_backends owns the backend catalog and botdrive::s3_repository consumes it. Backend values are read from the secret/gbo/drive Vault secret.
Before you start
| Check | Requirement |
|---|---|
| Vault | secret/gbo/drive holds accesskey, secret, bucket and the backend selector. |
| Env fallback | Deployments that skip Vault can use OTTERIO_ENDPOINT, OTTERIO_REGION, OTTERIO_BACKEND and OTTERIO_FALLBACK_ENDPOINT. |
| Endpoint | OtterIO uses host + port; B2, R2 and Wasabi use a full endpoint URL. |
| Authority | botserver/3rdparty.toml for the pinned OtterIO release; root AGENTS.md for ports. |
Steps
- Keep the backend at its default unless a deployment needs an external tier. An unknown
backendvalue falls back to OtterIO rather than failing the boot.
| Backend | Vault backend |
Runtime buckets | Minimums | Egress |
|---|---|---|---|---|
| OtterIO | otterio |
default | none | unmetered |
| Backblaze B2 | b2 |
supported | none | 3Γ stored volume included |
| Cloudflare R2 | r2 |
supported | none | unmetered |
| Wasabi | wasabi |
archive tier only | 1 TB floor, 90-day term | fair use 1:1 |
- Set an explicit
regionfor B2 and R2 β signing against the wrong region makes them unusable. Defaults exist (us-west-004for B2,autofor OtterIO and R2), but the operator should confirm them. - Leave Wasabi for long-lived archive data: the 1 TB floor is charged per tenant and objects deleted inside 90 days are billed for the full term. Selecting it for a runtime bucket logs a warning.
- If a secondary endpoint is needed, set
fallback_endpoint. It is used for reads only after the primary fails; a write is never redirected, because two divergent copies of a bot's source tree are worse than a failed upload. - Keep share links revocable. Bytes reach a client through botserver, gated by a random 128-bit token in
drive_public_links; expired or revoked links answer exactly like unknown ones.
Verify
| Check | Expected result |
|---|---|
| Backend resolved | backend matches the intended value; a typo falls back to OtterIO. |
| Read / write | A file can be uploaded and read back through the bot. |
| Failover | A forced primary failure serves reads from the fallback and logs the event; writes are not redirected. |
| Share link | Revoking a link stops access immediately; the link cannot list or enumerate. |
| Egress | S3Repository::egress() reports billable_egress against the backend allowance. |
| Buckets | {bot}.gbai for a standalone bot; {org}.gborg holding {workspace}.gbai/ prefixes for an organisation. |
Roll back
- Restore the previous
secret/gbo/drivevalues and rotate the credentials if they may have been exposed. - Do not resync Drive after a backend switch:
drive_monitorreloads on ETag change, and a backend switch is a process-level change rather than a content change. - Re-run the Verify table. If a fallback read was in use, confirm the primary endpoint is healthy before removing the fallback.
Keep bot-file sources in the bot's ALM repository: .gbdialog scripts and .gbot prompts are git-owned and materialised into Drive, while .gbkb and .gbdrive remain Drive-owned.
Related
- Storage and Data β how the storage layers fit together.
- OtterIO Configuration β running the default backend.
- Service Catalog β where storage credentials are listed.