mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Added S3_FORCE_PATH_STYLE environment variable support for AWS S3 client configuration to ensure compatibility with custom S3 endpoints and path-style URLs. This change sets the forcePathStyle option based on the environment variable, defaulting to false if not provided. (#3315)
Co-authored-by: Thiago Assis <thiago.assis@go9.tech>
This commit is contained in:
@@ -331,6 +331,7 @@ export const getS3Config = () => {
|
||||
const region = process.env.S3_STORAGE_REGION
|
||||
const Bucket = process.env.S3_STORAGE_BUCKET_NAME
|
||||
const customURL = process.env.S3_ENDPOINT_URL
|
||||
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true' ? true : false
|
||||
|
||||
if (!region || !Bucket) {
|
||||
throw new Error('S3 storage configuration is missing')
|
||||
@@ -347,7 +348,8 @@ export const getS3Config = () => {
|
||||
const s3Client = new S3Client({
|
||||
credentials,
|
||||
region,
|
||||
endpoint: customURL
|
||||
endpoint: customURL,
|
||||
forcePathStyle: forcePathStyle
|
||||
})
|
||||
return { s3Client, Bucket }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user