Scope#
The supplied Compose deployments use a separate RustFS 1.0.6 service with an S3-compatible API and a private bucket. PostgreSQL retains metadata, permissions, sizes and object references. Final bytes live in object storage.
| Content | Object namespace | Access |
|---|---|---|
| Files, images, videos, voice and shared on-device recordings | attachments/… | Existing client ciphertext; conversation authorization on the API |
| Synchronized personal stickers | stickers/… | Encrypted collection, authorized collection API |
| Profile photo | profiles/… | JPEG under existing profile authorization; not E2EE |
| Worker meeting recordings | recordings/… | Authenticated encrypted SREC archive; API authorization and Range |
OBJECTS_PREFIX precedes these keys. User filenames are not object keys. New attachments and worker archives use immutable attempt identifiers referenced from the database, preventing concurrent attempts from replacing each other.
Without workers: originals remain in the device/browser recording library. A copy published to the conversation uses normal encrypted attachment upload and lands in RustFS. This does not automatically synchronize local originals or require a worker. With workers: capture/transcoding happens on the worker; its encrypted SREC is uploaded through the private control API and stored remotely before acknowledgment. Updated registered and legacy workers use HTTP upload. Older workers remain compatible through the previous shared volume.
Browsers use Sintonia APIs, not public object URLs: no public bucket or RustFS CORS is required. The backend authenticates recording frames before playback. Profile images do not inherit the E2EE promise of private attachments.
Configuration#
RUSTFS_IMAGE=rustfs/rustfs:1.0.6
RUSTFS_ACCESS_KEY=
RUSTFS_SECRET_KEY=
OBJECTS_PROVIDER=s3
OBJECTS_ENDPOINT=http://rustfs:9000
OBJECTS_REGION=us-east-1
OBJECTS_BUCKET=sintonia
OBJECTS_PREFIX=sintonia/
OBJECTS_CREATE_BUCKET=true
OBJECTS_ACCESS_KEY=
OBJECTS_SECRET_KEY=Supply credentials privately; never deploy example/default secrets. Integrated local setup uses python3 scripts/ensure-local-turn.py; DigitalOcean installation calls prepare-secrets.py. Both create missing RustFS credentials without printing/replacing established values. Other operators should provision secrets through their vault.
Bundled Compose falls back to its RustFS administrative credential when service credentials are empty. Prefer a separate backend service identity restricted to the installation bucket/prefix: inspect/list bucket, read/write/delete objects and multipart operations. Pre-create the bucket and use OBJECTS_CREATE_BUCKET=false to avoid granting bucket creation. Do not give RustFS credentials to workers/apps.
Files stream from backend staging; files above 64 MiB use S3 multipart with 8 MiB parts and abort on failure. Full recordings are not held in memory. Client → API adaptive parts and API → RustFS multipart are separate transfers. Backend temporary ciphertext/staging still needs local disk capacity.
OBJECTS_PROVIDER=filesystem preserves standalone/test/legacy behavior. Do not switch back after writing remote-only objects without copying them back. S3 reads fall back to legacy files only on 404, never on authentication/network failure.
Container and privacy#
Root/local/selfhost/DigitalOcean Compose files include rustfs, persistent rustfs-data and rustfs-logs, readiness at /health/ready and a versioned image. Backend waits for the bundled service to become healthy. Its dependency is optional to support the external-storage override.
Development publishes API 127.0.0.1:19000 and console 127.0.0.1:19001. Production keeps API within Docker and console on loopback; use a private SSH tunnel. Do not expose ports 9000/9001 publicly. Host bind mounts need UID/GID 10001; named volumes are handled by the image. Never use docker compose down -v on a populated installation.
A single container has no node/disk redundancy. Droplet Terraform does not automatically create a cluster or additional disks. Monitor disk, I/O, S3 errors/latency and upload duration.
Non-destructive legacy migration#
Flyway V28 adds object references without deleting files, photos, accounts or keys. New uploads use S3 immediately; old files retain local fallback. Historical copying is explicit and paginated, limited to installation administrators:
| Operation | Behavior |
|---|---|
GET /api/admin/object-storage | Non-secret provider/bucket and source-preservation status |
POST /api/admin/object-storage/migrate | Plan/copy/verify one bounded category batch |
{"type":"attachments","after":"","limit":1,"dryRun":true}Categories: attachments, stickers, recordings, profiles. Default dryRun=true only plans. Set false to copy. Batch size 1–20, default 1. Pass returned nextCursor as after until empty, for every category. Sticker cursors combine collection and ID. Item statuses are planned, copied, verified, remote, missing; investigate missing sources. Large videos need suitable request timeouts and small batches.
The deployment repository includes scripts/migrate-object-storage.py. Use --login to prompt for email/password and, when enabled, TOTP or a one-use 2FA recovery code. This is neither the E2EE backup password nor ADMIN_SETUP_TOKEN. It checks installation-admin access and the S3 provider before copying. The session stays in memory; the script attempts to revoke only that session on exit, including failures. Browser sessions are preserved. Passwords, codes and tokens are never printed or saved to files. For SSO without a local password, omit --login and supply an authorized session token through the hidden prompt. Do not put secrets on the command line. Default is simulation; --execute copies:
python3 scripts/migrate-object-storage.py https://chat.yourcompany.com --login --type all
python3 scripts/migrate-object-storage.py https://chat.yourcompany.com --login --type all --executeCopy verifies length and SHA-256 by reading the remote object. Conflicting existing content fails without overwriting it. Original files and old photo bytes are retained; batches are repeatable. A dry run is not an integrity test. Back up database, volumes and keys first. Source cleanup is a separate operator procedure after restore verification; it is not automated.
External endpoint and future scale#
Use compose.object-storage-external.yaml with central Compose (DigitalOcean installer copies it):
COMPOSE_FILE=compose.yaml:compose.object-storage-external.yaml
OBJECTS_ENDPOINT=https://storage.yourcompany.internal
OBJECTS_CREATE_BUCKET=falseSet dedicated credentials privately. Preserve other overrides/profiles, including private recording control. The override removes bundled RustFS from default profiles. Validate TLS between hosts, restrict access to private/VPN networks, preserve S3 Host/path signatures at the gateway.
Keep bucket, prefix, object keys and database coherent. To move existing S3 storage, prepare the destination, stop writes during maintenance, copy all objects with S3 tooling, verify references/content, change the endpoint and test playback/Range before resuming. The legacy migrator does not copy between S3 endpoints.
Release merging protects established storage identity (provider, endpoint, bucket, prefix) and credentials. A planned cutover requires coordinated changes to server configuration and local .env.deploy after backup/copy/verification. Do not clear settings to bypass protection.
rustfs/cluster/ in the deployment repository contains a dedicated Linux node template for four nodes × four independent disks, identical full endpoint sets and a per-node private IP, plus a private TLS gateway example. It does not provision hosts/disks/DNS/firewalls. This project has not validated an actual distributed cluster. Prepare new mounted disks for UID 10001, resolve private node names, follow the selected RustFS version's cluster instructions, then copy/verify and cut over.
Do not use docker compose --scale rustfs on a shared volume, or convert a single volume into a cluster merely by changing RUSTFS_VOLUMES. Later pool expansion must follow procedures supported by the selected release.
Storage and recorder pools can grow separately; this does not make the whole backend stateless. Upload staging/locks, sessions and event distribution still need a multi-replica design. Keep one writer backend in the current deployment.
Backup and capacity#
Back up PostgreSQL + RustFS objects + operational configuration/keys consistently. Worker SREC needs the original RECORDING_STORAGE_KEY; private attachments still need user E2EE keys/backups. Storage cannot recover missing cryptographic secrets. Keep legacy sources during migration and maintain an independent backup.
Budget backend temporary uploads, worker scratch/outbox, final storage and backups. Authorized deletion/retention still runs through Sintonia and removes remote objects. Do not apply a generic object-expiry policy: it can delete referenced attachments or violate recording retention. Separately validate cleanup of incomplete multipart uploads without expiring completed objects.
For a low-load pilot, start by reserving an additional 1–2 vCPU/2 GiB for storage and measure; this is our estimate, not a benchmark. Production cluster requirements are much larger; see hardware. Local tests establish protocol/authorization behavior, not fault tolerance or production capacity.
Official references: Docker, scaling, Kubernetes/pools, hardware.