feat: add S3_FORCE_PATH_STYLE configuration for MinIO compatibility (#100)

* feat: add S3_FORCE_PATH_STYLE configuration for MinIO compatibility

* docs: add S3_FORCE_PATH_STYLE to env example
This commit is contained in:
Rees Morris
2025-07-07 21:06:51 +01:00
committed by GitHub
parent 392be38f10
commit fdfd1f3d03
9 changed files with 13 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ export default async function handler(
const client = new S3Client({
region: env.S3_REGION ?? "",
endpoint: env.S3_ENDPOINT ?? "",
forcePathStyle: env.S3_FORCE_PATH_STYLE === "true",
credentials: {
accessKeyId: env.S3_ACCESS_KEY_ID ?? "",
secretAccessKey: env.S3_SECRET_ACCESS_KEY ?? "",
@@ -58,6 +59,7 @@ export default async function handler(
new PutObjectCommand({
Bucket: nextRuntimeEnv("NEXT_PUBLIC_AVATAR_BUCKET_NAME") ?? "",
Key: filename,
ACL: "public-read",
}),
);