@strapi/provider-upload-cloudinary 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +57 -17
  2. package/package.json +3 -6
package/README.md CHANGED
@@ -1,4 +1,25 @@
1
- # strapi-provider-upload-cloudinary
1
+ # @strapi/provider-upload-cloudinary
2
+
3
+ ## Resources
4
+
5
+ - [LICENSE](LICENSE)
6
+
7
+ ## Links
8
+
9
+ - [Strapi website](https://strapi.io/)
10
+ - [Strapi documentation](https://docs.strapi.io)
11
+ - [Strapi community on Discord](https://discord.strapi.io)
12
+ - [Strapi news on Twitter](https://twitter.com/strapijs)
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ # using yarn
18
+ yarn add @strapi/provider-upload-cloudinary
19
+
20
+ # using npm
21
+ npm install @strapi/provider-upload-cloudinary --save
22
+ ```
2
23
 
3
24
  ## Configurations
4
25
 
@@ -8,7 +29,7 @@ Your configuration is passed down to the cloudinary configuration. (e.g: `cloudi
8
29
 
9
30
  See the [using a provider](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#using-a-provider) documentation for information on installing and using a provider. And see the [environment variables](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#environment-variables) for setting and using environment variables in your configs.
10
31
 
11
- **Example**
32
+ ### Provider Configuration
12
33
 
13
34
  `./config/plugins.js`
14
35
 
@@ -16,27 +37,46 @@ See the [using a provider](https://docs.strapi.io/developer-docs/latest/plugins/
16
37
  module.exports = ({ env }) => ({
17
38
  // ...
18
39
  upload: {
19
- provider: 'cloudinary',
20
- providerOptions: {
21
- cloud_name: env('CLOUDINARY_NAME'),
22
- api_key: env('CLOUDINARY_KEY'),
23
- api_secret: env('CLOUDINARY_SECRET'),
24
- },
25
- actionOptions: {
26
- upload: {},
27
- delete: {},
40
+ config: {
41
+ provider: 'cloudinary',
42
+ providerOptions: {
43
+ cloud_name: env('CLOUDINARY_NAME'),
44
+ api_key: env('CLOUDINARY_KEY'),
45
+ api_secret: env('CLOUDINARY_SECRET'),
46
+ },
47
+ actionOptions: {
48
+ upload: {},
49
+ delete: {},
50
+ },
28
51
  },
29
52
  },
30
53
  // ...
31
54
  });
32
55
  ```
33
56
 
34
- ## Resources
57
+ ### Security Middleware Configuration
35
58
 
36
- - [License](LICENSE)
59
+ 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](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.html#loading-order) documentation.
37
60
 
38
- ## Links
61
+ `./config/middlewares.js`
39
62
 
40
- - [Strapi website](https://strapi.io/)
41
- - [Strapi community on Slack](https://slack.strapi.io)
42
- - [Strapi news on Twitter](https://twitter.com/strapijs)
63
+ ```js
64
+ module.exports = [
65
+ // ...
66
+ {
67
+ name: 'strapi::security',
68
+ config: {
69
+ contentSecurityPolicy: {
70
+ useDefaults: true,
71
+ directives: {
72
+ 'connect-src': ["'self'", 'https:'],
73
+ 'img-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
74
+ 'media-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
75
+ upgradeInsecureRequests: null,
76
+ },
77
+ },
78
+ },
79
+ },
80
+ // ...
81
+ ];
82
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/provider-upload-cloudinary",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Cloudinary provider for strapi upload",
5
5
  "keywords": [
6
6
  "upload",
@@ -36,7 +36,7 @@
36
36
  "test": "echo \"no tests yet\""
37
37
  },
38
38
  "dependencies": {
39
- "@strapi/utils": "4.0.0",
39
+ "@strapi/utils": "4.0.1",
40
40
  "cloudinary": "^1.25.1",
41
41
  "into-stream": "^5.1.0"
42
42
  },
@@ -44,8 +44,5 @@
44
44
  "node": ">=12.x.x <=16.x.x",
45
45
  "npm": ">=6.0.0"
46
46
  },
47
- "strapi": {
48
- "isProvider": true
49
- },
50
- "gitHead": "b181702f0202b2c6d645d42b195a831f25cd0b03"
47
+ "gitHead": "e2cd01e8c6cbfeba15ad7787e38b6eebcbb92221"
51
48
  }