mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 03:01:10 +03:00
[Fix] Change S3 logger to accept more authorization methods for AWS (#4114)
* Change S3 logger to accept more authorization methods for AWS * Lint fix
This commit is contained in:
@@ -21,14 +21,23 @@ if (process.env.STORAGE_TYPE === 's3') {
|
|||||||
const customURL = process.env.S3_ENDPOINT_URL
|
const customURL = process.env.S3_ENDPOINT_URL
|
||||||
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true'
|
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true'
|
||||||
|
|
||||||
|
if (!region || !s3Bucket) {
|
||||||
|
throw new Error('S3 storage configuration is missing')
|
||||||
|
}
|
||||||
|
|
||||||
|
let credentials: S3ClientConfig['credentials'] | undefined
|
||||||
|
if (accessKeyId && secretAccessKey) {
|
||||||
|
credentials = {
|
||||||
|
accessKeyId,
|
||||||
|
secretAccessKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const s3Config: S3ClientConfig = {
|
const s3Config: S3ClientConfig = {
|
||||||
region: region,
|
region: region,
|
||||||
endpoint: customURL,
|
endpoint: customURL,
|
||||||
forcePathStyle: forcePathStyle,
|
forcePathStyle: forcePathStyle,
|
||||||
credentials: {
|
credentials: credentials
|
||||||
accessKeyId: accessKeyId as string,
|
|
||||||
secretAccessKey: secretAccessKey as string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s3ServerStream = new S3StreamLogger({
|
s3ServerStream = new S3StreamLogger({
|
||||||
|
|||||||
Reference in New Issue
Block a user