Skip to content

Commit 162f114

Browse files
committed
upd: added the possibility to configure S3 endpoint, whether SSL is enabled and the forceStylePath
1 parent d8e8a26 commit 162f114

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,10 @@ AWS_SECRET_ACCESS_KEY=
543543
AWS_REGION=
544544
AWS_S3_BUCKET=
545545
AWS_S3_UPLOAD_PATH=
546+
AWS_S3_ENDPOINT=
547+
AWS_S3_SSL_ENABLED=
548+
AWS_S3_FORCE_PATH_STYLE=
549+
546550

547551
# Deepgram
548552
DEEPGRAM_API_KEY=

packages/plugin-node/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ AWS_SECRET_ACCESS_KEY=your_aws_secret_key
5454
AWS_REGION=your_aws_region
5555
AWS_S3_BUCKET=your_s3_bucket
5656
AWS_S3_UPLOAD_PATH=your_upload_path
57+
AWS_S3_ENDPOINT=an_alternative_endpoint
58+
AWS_S3_SSL_ENABLED=boolean(true|false)
59+
AWS_S3_FORCE_PATH_STYLE=boolean(true|false)
5760
```
5861

5962
## Usage

packages/plugin-node/src/services/awsS3.ts

+10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@ export class AwsS3Service extends Service implements IAwsS3Service {
5858
return false;
5959
}
6060

61+
/** Optional fields to allow for other providers */
62+
const endpoint = this.runtime.getSetting("AWS_S3_ENDPOINT");
63+
const sslEnabled = this.runtime.getSetting("AWS_S3_SSL_ENABLED");
64+
const forcePathStyle = this.runtime.getSetting("AWS_S3_FORCE_PATH_STYLE");
65+
6166
this.s3Client = new S3Client({
67+
...(endpoint ? { endpoint } : {}),
68+
...(sslEnabled ? { sslEnabled } : {}),
69+
...(forcePathStyle
70+
? { forcePathStyle: Boolean(forcePathStyle) }
71+
: {}),
6272
region: AWS_REGION,
6373
credentials: {
6474
accessKeyId: AWS_ACCESS_KEY_ID,

0 commit comments

Comments
 (0)