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
+10
View File
@@ -3,6 +3,7 @@ package main
import (
"crussell/auth"
"crussell/internal/dav"
"crussell/internal/s3"
"fmt"
"log"
"net/http"
@@ -46,9 +47,18 @@ func initDav() {
fmt.Println("DAV Service connected successfully")
}
func initS3() {
if err := s3.Connect(); err != nil {
log.Printf("WARNING: Failed to connect to S3: %v", err)
} else {
fmt.Println("S3 client initialized")
}
}
func main() {
initDB()
initDav()
initS3()
r := chi.NewRouter()