Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ SMTP_REJECT_UNAUTHORIZED= # set to "false" to accept invalid certs
NEXT_PUBLIC_DISABLE_EMAIL=

# S3 storage (optional)
S3_REGION=
S3_ENDPOINT=
S3_REGION= # required for AWS S3 (e.g. us-east-1); ignored by most S3-compatible providers — defaults to us-east-1 if unset
S3_ENDPOINT= # set for S3-compatible providers (MinIO, R2, Spaces, etc.); leave blank for AWS S3
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_FORCE_PATH_STYLE=
Expand Down
8 changes: 7 additions & 1 deletion packages/shared/src/utils/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ export function createS3Client() {
}
: undefined;

// The AWS SDK throws "Region is missing" if region is undefined or
// empty string at S3Client construction. Default to "us-east-1" so
// S3-compatible providers (MinIO, Backblaze B2, R2, Spaces, Wasabi)
// that don't care about region work without forcing operators to
// set a meaningless value. Real AWS S3 users should still set
// S3_REGION explicitly to their bucket's actual region.
return new S3Client({
region: process.env.S3_REGION ?? "",
region: process.env.S3_REGION ?? "us-east-1",
endpoint: process.env.S3_ENDPOINT ?? "",
forcePathStyle: process.env.S3_FORCE_PATH_STYLE === "true",
credentials,
Expand Down
Loading