keystonejs / keystone

The superpowered headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
9.12k stars 1.14k forks source link

DigitalOcean Spaces bucket as files/images storage: access denied #8647

Open molotow11 opened 1 year ago

molotow11 commented 1 year ago

Steps to reproduce the problem

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.

marekryb commented 1 year ago

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

molotow11 commented 1 year ago

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