feat(storage): add S3/R2 abstraction with local Rustfs dev

- Add backend/internal/s3/ with build-tag pattern (dev vs prod)
- Dev: Uses local Rustfs container (S3-compatible)
- Prod: Stub for R2 Cloudflare (add AWS SDK to implement)
- Add S3 env vars to .env.example and .env
- Add Rustfs service to compose.yml
- Add Rustfs reset to local-dev-2.sh (wipes data on each run)
This commit is contained in:
2026-02-17 22:47:38 +00:00
parent d43d7ebc5e
commit dfd552b02f
8 changed files with 304 additions and 0 deletions
+19
View File
@@ -59,19 +59,38 @@ services:
ports:
- "80:80"
- "443:443"
- "9000:9000" # Rustfs S3 API
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/certs:/etc/nginx/certs
- ./frontend/build:/usr/share/nginx/html # Serve frontend
- ./sabredav:/var/www/dav
- rustfs_data:/data
depends_on:
- backend
- sabredav
networks:
- appnet
rustfs:
image: rustfs/rustfs:latest
container_name: rustfs
restart: always
ports:
- "9001:9000" # Web console
environment:
- RUSTFS_ADMIN_ACCESS_KEY=minioadmin
- RUSTFS_ADMIN_SECRET_KEY=minioadmin
volumes:
- rustfs_data:/data
networks:
- appnet
command: >
bash -c "rustfs server /data --console-address :9000 --address :9000 --axum-server"
volumes:
pgdata:
rustfs_data:
networks: