Explicitely set uploaded image ACLs for S3 to "public-read"

This works around permission problems with DigitalOcean spaces (where
files are always *private* by default).

This should not pose a difference with AWS and other providers as CodiMD
only works with public S3 assets either way.

Signed-off-by: Martin Honermeyer <maze@strahlungsfrei.de>
This commit is contained in:
Martin Honermeyer 2019-12-05 18:33:35 +01:00
parent a0cc1955cb
commit 3fe6ec71e3
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ exports.uploadImage = function (imagePath, callback) {
const params = { const params = {
Bucket: config.s3bucket, Bucket: config.s3bucket,
Key: path.join('uploads', path.basename(imagePath)), Key: path.join('uploads', path.basename(imagePath)),
Body: buffer Body: buffer,
ACL: 'public-read'
} }
const mimeType = getImageMimeType(imagePath) const mimeType = getImageMimeType(imagePath)