]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Set ACL when uploading objects
authorChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 07:19:09 +0000 (09:19 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 07:19:09 +0000 (09:19 +0200)
server/lib/object-storage/shared/object-storage-helpers.ts

index e2321690740fab654346d553a281f79bb7ae23b0..b53b94b96b24f0e6f1372c9be97670abeef4a0b9 100644 (file)
@@ -146,7 +146,8 @@ async function objectStoragePut (options: {
   const command = new PutObjectCommand({
     Bucket: bucketInfo.BUCKET_NAME,
     Key: buildKey(objectStorageKey, bucketInfo),
-    Body: content
+    Body: content,
+    ACL: 'public-read'
   })
 
   await getClient().send(command)
@@ -168,7 +169,8 @@ async function multiPartUpload (options: {
 
   const createMultipartCommand = new CreateMultipartUploadCommand({
     Bucket: bucketInfo.BUCKET_NAME,
-    Key: key
+    Key: key,
+    ACL: 'public-read'
   })
   const createResponse = await s3Client.send(createMultipartCommand)