keystone icon indicating copy to clipboard operation
keystone copied to clipboard

DigitalOcean Spaces bucket as files/images storage: access denied

Open molotow11 opened this issue 1 year ago • 2 comments

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.

molotow11 avatar Jun 22 '23 10:06 molotow11

See https://github.com/keystonejs/keystone/pull/8264

marekryb avatar Jun 25 '23 22:06 marekryb

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'
    },    
  }
});

molotow11 avatar Jun 26 '23 01:06 molotow11