don't use S3 CreateBucket and clean up
Docker server image / build-and-push (push) Successful in 1m6s
Docker server image / build-and-push (push) Successful in 1m6s
This commit is contained in:
@@ -135,7 +135,7 @@ Use `.env.example` as your baseline env configuration.
|
||||
|
||||
## Storage Backend Notes
|
||||
|
||||
- Local development defaults to **SeaweedFS** (S3-compatible) via Docker Compose.
|
||||
- Local development defaults to **SeaweedFS** (S3-compatible) via Docker Compose. Compose runs an `s3-init` step that creates the dev bucket before the server starts.
|
||||
- Production can use any S3-compatible provider; **AWS S3** is the expected choice.
|
||||
- The Python server uses the `minio` Python SDK against the S3 API.
|
||||
- Runtime configuration uses `S3_*` environment variables.
|
||||
@@ -166,11 +166,11 @@ S3_SECRET_KEY=...
|
||||
|
||||
Use your bucket's regional hostname for both endpoints unless you deliberately split internal vs client-facing access. `S3_PUBLIC_ENDPOINT` must be reachable by whatever uploads and downloads via presigned URLs (clients, not just the server).
|
||||
|
||||
On startup the server calls `CreateBucket` if the bucket is missing. In AWS it is simpler to **pre-create the bucket** and grant object permissions only (see IAM below).
|
||||
On startup the server verifies the bucket exists via HeadBucket and fails fast if it is missing. **Pre-create the bucket** before deploying (see IAM below).
|
||||
|
||||
**IAM permissions**
|
||||
|
||||
Scope access to the single bucket. Object keys are per-conversion prefixes, so list/delete can target the whole bucket:
|
||||
Scope access to the single bucket. Object keys are per-conversion prefixes, so list/delete can target the whole bucket. Startup verification uses HeadBucket, which is satisfied by `s3:ListBucket` on the bucket ARN:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -178,7 +178,7 @@ Scope access to the single bucket. Object keys are per-conversion prefixes, so l
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": ["s3:ListBucket"],
|
||||
"Action": ["s3:ListBucket", "s3:HeadBucket"],
|
||||
"Resource": "arn:aws:s3:::officeconvert-prod"
|
||||
},
|
||||
{
|
||||
@@ -190,8 +190,6 @@ Scope access to the single bucket. Object keys are per-conversion prefixes, so l
|
||||
}
|
||||
```
|
||||
|
||||
Add `s3:CreateBucket` on `arn:aws:s3:::officeconvert-prod` only if you want the server to create the bucket on first boot.
|
||||
|
||||
**CORS**
|
||||
|
||||
Required only if uploads or downloads go **directly from a browser** to presigned URLs. Server-side clients (`curl`, the Go client) do not need CORS. Allow `PUT` and `GET` for your web origin on the bucket.
|
||||
|
||||
Reference in New Issue
Block a user