Feat/add s3 custom url (#2891)

add s3 custom url
This commit is contained in:
Henry Heng
2024-07-26 15:39:24 +01:00
committed by GitHub
parent 2dadf2e42b
commit 1c730323e2
6 changed files with 13 additions and 4 deletions
+4 -1
View File
@@ -318,6 +318,8 @@ export const getS3Config = () => {
const secretAccessKey = process.env.S3_STORAGE_SECRET_ACCESS_KEY
const region = process.env.S3_STORAGE_REGION
const Bucket = process.env.S3_STORAGE_BUCKET_NAME
const customURL = process.env.S3_ENDPOINT_URL
if (!region || !Bucket) {
throw new Error('S3 storage configuration is missing')
}
@@ -332,7 +334,8 @@ export const getS3Config = () => {
const s3Client = new S3Client({
credentials,
region
region,
endpoint: customURL
})
return { s3Client, Bucket }
}