From 3fe6ec71e3569d207c4aba0b679b24d60db7e0a2 Mon Sep 17 00:00:00 2001 From: Martin Honermeyer Date: Thu, 5 Dec 2019 18:33:35 +0100 Subject: [PATCH] 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 --- lib/web/imageRouter/s3.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/web/imageRouter/s3.js b/lib/web/imageRouter/s3.js index 7fd78c32..fbed1b0c 100644 --- a/lib/web/imageRouter/s3.js +++ b/lib/web/imageRouter/s3.js @@ -29,7 +29,8 @@ exports.uploadImage = function (imagePath, callback) { const params = { Bucket: config.s3bucket, Key: path.join('uploads', path.basename(imagePath)), - Body: buffer + Body: buffer, + ACL: 'public-read' } const mimeType = getImageMimeType(imagePath)