Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

strapi-provider-upload-do 4.1.0

Install from the command line:
Learn more about npm packages
$ npm install @lyl-radio/strapi-provider-upload-do@4.1.0
Install via package.json:
"@lyl-radio/strapi-provider-upload-do": "4.1.0"

About this version

@lyl-radio/strapi-provider-upload-do

Resources

Links

Installation

using yarn

yarn add @lyl-radio/strapi-provider-upload-do

using npm

npm install @lyl-radio/strapi-provider-upload-do --save

Configuration

See the documentation about using a provider for information on installing and using a provider. To understand how environment variables are used in Strapi, please refer to the documentation about environment variables.

Provider Configuration

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: '@lyl-radio/strapi-provider-upload-do',
      providerOptions: {
        key: env('DO_SPACE_ACCESS_KEY'),
        secret: env('DO_SPACE_SECRET_KEY'),
        endpoint: env('DO_SPACE_ENDPOINT'),
        space: env('DO_SPACE_BUCKET'),
        directory: env('DO_SPACE_DIRECTORY'),
        cdn: env('DO_SPACE_CDN'),
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
  // ...
});

Security Middleware Configuration

Due to the default settings in the Strapi Security Middleware you will need to modify the contentSecurityPolicy settings to properly see thumbnail previews in the Media Library. You should replace strapi::security string with the object bellow instead as explained in the middleware configuration documentation.

./config/middlewares.js

module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            'yourBucketName.yourRegion.digitaloceanspaces.com',
            'yourBucketName.yourRegion.cdn.digitaloceanspaces.com',
          ],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            'yourBucketName.yourRegion.digitaloceanspaces.com',
            'yourBucketName.yourRegion.cdn.digitaloceanspaces.com',
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

You can also add your custom CDN subdomain to img-src and media-src directives.

Details


Assets

  • strapi-provider-upload-do-4.1.0.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all