keystone
keystone copied to clipboard
DigitalOcean Spaces bucket as files/images storage: access denied
Steps to reproduce the problem
- Configure your Keystonejs for use DigitalOcean Spaces bucket as storage.
- Try to upload something
- Check link provided
- You will see access denied
Expected outcome:
Asset served by the provided link
Possible solution
It looks like DO changed their politics and files in private access by default now. So, need to set it public somehow.
See https://github.com/keystonejs/keystone/pull/8264
Great, thanks @marekryb
So, we can use acl
option in the config
config({
storage: {
remote: {
kind: 's3',
type: 'image',
bucketName,
region,
accessKeyId,
secretAccessKey,
endpoint,
/** Optionally add one of the ACL options from AWS-SDK.
*
* Example: 'private', 'public-read' or 'public-read-write'.
*
* See https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl
* for more details.
*/
acl: 'public-read'
},
}
});