Bunny.net provider for Strapi
Bunny.net Upload Provider for Strapi V4.
npm install @nexide/strapi-provider-bunny
or
yarn add @nexide/strapi-provider-bunny
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
1module.exports = ({ env }) => ({
2 // ...
3 upload: {
4 config: {
5 provider: '@nexide/strapi-provider-bunny',
6 providerOptions: {
7 api_key: env('BUNNY_API_KEY'),
8 storage_zone: env('BUNNY_STORAGE_ZONE'),
9 pull_zone: env('BUNNY_PULL_ZONE'),
10 hostname: env('BUNNY_HOSTNAME'),
11 },
12 },
13 },
14 // ...
15});
.env
1BUNNY_API_KEY: Storage Password (Inside FTP & API Access).
2BUNNY_STORAGE_ZONE: Storage Zone name.
3BUNNY_HOSTNAME: Hostname value (Inside FTP & API Access). eg: ny.storage.bunnycdn.com
4BUNNY_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)
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
1module.exports = [
2 // ...
3 {
4 name: 'strapi::security',
5 config: {
6 contentSecurityPolicy: {
7 useDefaults: true,
8 directives: {
9 'connect-src': ["'self'", 'https:'],
10 'img-src': [
11 "'self'",
12 'data:',
13 'blob:',
14 'market-assets.strapi.io',
15 process.env.BUNNY_PULL_ZONE,
16 ],
17 'media-src': [
18 "'self'",
19 'data:',
20 'blob:',
21 'market-assets.strapi.io',
22 process.env.BUNNY_PULL_ZONE,
23 ],
24 upgradeInsecureRequests: null,
25 },
26 },
27 },
28 },
29 // ...
30];
npm install @nexide/strapi-provider-bunny
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.