File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/server/src/utils Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,23 @@ if (process.env.STORAGE_TYPE === 's3') {
21
21
const customURL = process . env . S3_ENDPOINT_URL
22
22
const forcePathStyle = process . env . S3_FORCE_PATH_STYLE === 'true'
23
23
24
+ if ( ! region || ! s3Bucket ) {
25
+ throw new Error ( 'S3 storage configuration is missing' )
26
+ }
27
+
28
+ let credentials : S3ClientConfig [ 'credentials' ] | undefined
29
+ if ( accessKeyId && secretAccessKey ) {
30
+ credentials = {
31
+ accessKeyId,
32
+ secretAccessKey
33
+ }
34
+ }
35
+
24
36
const s3Config : S3ClientConfig = {
25
37
region : region ,
26
38
endpoint : customURL ,
27
39
forcePathStyle : forcePathStyle ,
28
- credentials : {
29
- accessKeyId : accessKeyId as string ,
30
- secretAccessKey : secretAccessKey as string
31
- }
40
+ credentials : credentials
32
41
}
33
42
34
43
s3ServerStream = new S3StreamLogger ( {
You can’t perform that action at this time.
0 commit comments