+12
-3
@@ -32,15 +32,24 @@ export const fileStorageModuleFactory = async (
|
||||
const bucketName = environmentService.get('STORAGE_S3_NAME');
|
||||
const endpoint = environmentService.get('STORAGE_S3_ENDPOINT');
|
||||
const region = environmentService.get('STORAGE_S3_REGION');
|
||||
const accessKeyId = environmentService.get('STORAGE_S3_ACCESS_KEY_ID');
|
||||
const secretAccessKey = environmentService.get(
|
||||
'STORAGE_S3_SECRET_ACCESS_KEY',
|
||||
);
|
||||
|
||||
return {
|
||||
type: StorageDriverType.S3,
|
||||
options: {
|
||||
bucketName: bucketName ?? '',
|
||||
endpoint: endpoint,
|
||||
credentials: fromNodeProviderChain({
|
||||
clientConfig: { region },
|
||||
}),
|
||||
credentials: accessKeyId
|
||||
? {
|
||||
accessKeyId,
|
||||
secretAccessKey,
|
||||
}
|
||||
: fromNodeProviderChain({
|
||||
clientConfig: { region },
|
||||
}),
|
||||
forcePathStyle: true,
|
||||
region: region ?? '',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user