Bunny.net
Upload provider for Bunny.net
strapi-provider-upload-bunnycdn
Bunny.net Upload Provider for Strapi V4.
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
1module.exports = ({ env }) => ({
2 //...
3 upload: {
4 config: {
5 provider: "strapi-provider-upload-bunnynet",
6 providerOptions: {
7 api_key: process.env.BUNNY_API_KEY,
8 storage_zone: process.env.BUNNY_STORAGE_ZONE,
9 pull_zone: process.env.BUNNY_PULL_ZONE,
10 },
11 },
12 },
13 //...
14})
.env
1BUNNY_API_KEY: Storage Password (Inside FTP & API Access).
2BUNNY_STORAGE_ZONE: Storage Zone name.
3BUNNY_PULL_ZONE: Pull Zone name.
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
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": ["'self'", "data:", "blob:", process.env.BUNNY_PULL_ZONE],
11 "media-src": ["'self'", "data:", "blob:", process.env.BUNNY_PULL_ZONE],
12 upgradeInsecureRequests: null,
13 },
14 },
15 },
16 },
17 // ...
18]
Install now
npm install strapi-provider-upload-bunnynet
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.