aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2026-07-08 15:01:05 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2026-07-08 15:01:05 -0700
commit4bd4c14daff4cb8807a91305239cae1e8544f276 (patch)
tree37de49c06efa627748f0581f6531b35f28485158 /README.md
parent52eb3389f074e8ac28fa1eae90847fb7536acdd8 (diff)
Add Cloudflare R2 file library storage backend
Implement R2FileStore, a FileStore backed by Cloudflare R2 via its S3-compatible API, selectable with --file-store r2 and configured through R2_* environment variables. The store follows the MemFileStore model: a flat keyspace where directories are derived from key prefixes, with zero-byte marker objects so empty folders persist, and errors.ErrUnsupported for symlink/alias operations. Because R2 has no append, in-progress .incomplete uploads are routed to a local staging directory (real O_APPEND and size-based resume) and promoted to a finished R2 object on the terminal upload-commit Rename; all other paths live in R2. A narrow s3API seam plus an s3Uploader interface make the backend unit-testable against an in-memory fake without a network. Adds a user setup guide at docs/r2-file-store.md.
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3165535..3a25a5b 100644
--- a/README.md
+++ b/README.md
@@ -170,6 +170,16 @@ Usage of mobius-hotline-server:
To run as a systemd service, refer to this sample unit file: [mobius-hotline-server.service](https://github.com/jhalter/mobius/blob/master/cmd/mobius-hotline-server/mobius-hotline-server.service)
+## File Storage
+
+By default the file library is stored on the server's local disk. The `-file-store` flag selects an alternate backend:
+
+- `os` (default) — local filesystem
+- `memory` — in-memory, non-persistent (for testing)
+- `r2` — [Cloudflare R2](docs/r2-file-store.md) object storage
+
+See [docs/r2-file-store.md](docs/r2-file-store.md) for R2 setup instructions.
+
## HTTP API
The Mobius server includes an optional HTTP API for server administration and user management.