Strapi plugin logo for @nexide/strapi-provider-bunny

@nexide/strapi-provider-bunny

Bunny.net provider for Strapi

@nexide/strapi-provider-bunny

Bunny.net Upload Provider for Strapi V4.

Installation

npm install @nexide/strapi-provider-bunny

or

yarn add @nexide/strapi-provider-bunny

Configurations

See the using a provider documentation for information on installing and using a provider. And see the environment variables for setting and using environment variables in your configs.

Example

./config/plugins.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: '@nexide/strapi-provider-bunny',
      providerOptions: {
        api_key: env('BUNNY_API_KEY'),
        storage_zone: env('BUNNY_STORAGE_ZONE'),
        pull_zone: env('BUNNY_PULL_ZONE'),
        hostname: env('BUNNY_HOSTNAME'),
      },
    },
  },
  // ...
});

.env

1
2
3
4
BUNNY_API_KEY: Storage Password (Inside FTP & API Access).
BUNNY_STORAGE_ZONE: Storage Zone name.
BUNNY_HOSTNAME: Hostname value (Inside FTP & API Access). eg: ny.storage.bunnycdn.com
BUNNY_PULL_ZONE: Pull Zone URL.

Enter Pull Zone URL without trailing slash – https://<pull-zone-name>.b-cdn.net.\ Optionally add Storage Endpoint Url without trailing slash (read more)

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            'market-assets.strapi.io',
            process.env.BUNNY_PULL_ZONE,
          ],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            'market-assets.strapi.io',
            process.env.BUNNY_PULL_ZONE,
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  //  ...
];

Install now

npm install @nexide/strapi-provider-bunny

STATS

4 GitHub stars7 weekly downloads

Last updated

99 days ago

Strapi Version

>=4.0.0 <5.0.0-0

Author

github profile image for Jorge Zambrano
Jorge Zambrano

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.