feat: add s3 storage provider integration

This commit is contained in:
2026-01-13 16:46:00 +08:00
parent bd8dab5764
commit e97be37b05
9 changed files with 253 additions and 22 deletions

32
docs/storage_provider.md Normal file
View File

@@ -0,0 +1,32 @@
# Storage Provider Setup
This project supports local filesystem storage for development/tests and an S3-compatible provider (AWS S3/MinIO) for production.
## Local (dev/test)
Use local storage for tests and quick development.
```toml
[Storage]
Type = "local"
LocalPath = "./storage"
Secret = "your-storage-secret"
BaseURL = "http://localhost:8080/t/<tenantCode>/v1/storage"
```
Note: `BaseURL` should include the tenant code because storage routes are tenant-scoped.
## S3/MinIO (example)
```toml
[Storage]
Type = "s3"
AccessKey = "minioadmin"
SecretKey = "minioadmin"
Region = "us-east-1"
Bucket = "quyun-assets"
Endpoint = "http://127.0.0.1:9000"
PathStyle = true
```
For AWS S3, set `Endpoint` with `https://` (e.g., `https://s3.amazonaws.com`) and keep `PathStyle` as `false` unless your provider requires path-style access.