@strapi/provider-upload-aws-s3 4.0.0-next.7 → 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 +61 -21
  2. package/package.json +20 -23
package/README.md CHANGED
@@ -1,12 +1,33 @@
1
- # strapi-provider-upload-aws-s3
1
+ # @strapi/provider-upload-aws-s3
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-aws-s3
19
+
20
+ # using npm
21
+ npm install @strapi/provider-upload-aws-s3 --save
22
+ ```
2
23
 
3
24
  ## Configurations
4
25
 
5
26
  Your configuration is passed down to the provider. (e.g: `new AWS.S3(config)`). You can see the complete list of options [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property)
6
27
 
7
- See the [using a provider](https://strapi.io/documentation/developer-docs/latest/development/plugins/upload.html#using-a-provider) documentation for information on installing and using a provider. And see the [environment variables](https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/configurations.html#environment-variables) for setting and using environment variables in your configs.
28
+ 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.
8
29
 
9
- **Example**
30
+ ### Provider Configuration
10
31
 
11
32
  `./config/plugins.js`
12
33
 
@@ -14,13 +35,15 @@ See the [using a provider](https://strapi.io/documentation/developer-docs/latest
14
35
  module.exports = ({ env }) => ({
15
36
  // ...
16
37
  upload: {
17
- provider: 'aws-s3',
18
- providerOptions: {
19
- accessKeyId: env('AWS_ACCESS_KEY_ID'),
20
- secretAccessKey: env('AWS_ACCESS_SECRET'),
21
- region: env('AWS_REGION'),
22
- params: {
23
- Bucket: env('AWS_BUCKET'),
38
+ config: {
39
+ provider: 'aws-s3',
40
+ providerOptions: {
41
+ accessKeyId: env('AWS_ACCESS_KEY_ID'),
42
+ secretAccessKey: env('AWS_ACCESS_SECRET'),
43
+ region: env('AWS_REGION'),
44
+ params: {
45
+ Bucket: env('AWS_BUCKET'),
46
+ },
24
47
  },
25
48
  },
26
49
  },
@@ -28,11 +51,38 @@ module.exports = ({ env }) => ({
28
51
  });
29
52
  ```
30
53
 
54
+ ### Security Middleware Configuration
55
+
56
+ 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.
57
+
58
+ `./config/middlewares.js`
59
+
60
+ ```js
61
+ module.exports = [
62
+ // ...
63
+ {
64
+ name: 'strapi::security',
65
+ config: {
66
+ contentSecurityPolicy: {
67
+ useDefaults: true,
68
+ directives: {
69
+ 'connect-src': ["'self'", 'https:'],
70
+ 'img-src': ["'self'", 'data:', 'blob:', 'yourBucketName.s3.yourRegion.amazonaws.com'],
71
+ 'media-src': ["'self'", 'data:', 'blob:', 'yourBucketName.s3.yourRegion.amazonaws.com'],
72
+ upgradeInsecureRequests: null,
73
+ },
74
+ },
75
+ },
76
+ },
77
+ // ...
78
+ ];
79
+ ```
80
+
31
81
  ## Required AWS Policy Actions
32
82
 
33
83
  These are the minimum amount of permissions needed for this provider to work.
34
84
 
35
- ```
85
+ ```json
36
86
  "Action": [
37
87
  "s3:PutObject",
38
88
  "s3:GetObject",
@@ -41,13 +91,3 @@ These are the minimum amount of permissions needed for this provider to work.
41
91
  "s3:PutObjectAcl"
42
92
  ],
43
93
  ```
44
-
45
- ## Resources
46
-
47
- - [License](LICENSE)
48
-
49
- ## Links
50
-
51
- - [Strapi website](https://strapi.io/)
52
- - [Strapi community on Slack](https://slack.strapi.io)
53
- - [Strapi news on Twitter](https://twitter.com/strapijs)
package/package.json CHANGED
@@ -1,51 +1,48 @@
1
1
  {
2
2
  "name": "@strapi/provider-upload-aws-s3",
3
- "version": "4.0.0-next.7",
3
+ "version": "4.0.1",
4
4
  "description": "AWS S3 provider for strapi upload",
5
- "homepage": "https://strapi.io",
6
5
  "keywords": [
7
6
  "upload",
8
7
  "aws",
9
8
  "s3",
10
9
  "strapi"
11
10
  ],
12
- "directories": {
13
- "lib": "./lib"
14
- },
15
- "main": "./lib",
16
- "dependencies": {
17
- "aws-sdk": "2.892.0",
18
- "lodash": "4.17.21"
11
+ "homepage": "https://strapi.io",
12
+ "bugs": {
13
+ "url": "https://github.com/strapi/strapi/issues"
19
14
  },
20
- "strapi": {
21
- "isProvider": true
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git://github.com/strapi/strapi.git"
22
18
  },
19
+ "license": "SEE LICENSE IN LICENSE",
23
20
  "author": {
21
+ "name": "Strapi Solutions SAS",
24
22
  "email": "hi@strapi.io",
25
- "name": "Strapi team",
26
23
  "url": "https://strapi.io"
27
24
  },
28
25
  "maintainers": [
29
26
  {
30
- "name": "Strapi team",
27
+ "name": "Strapi Solutions SAS",
31
28
  "email": "hi@strapi.io",
32
29
  "url": "https://strapi.io"
33
30
  }
34
31
  ],
35
- "repository": {
36
- "type": "git",
37
- "url": "git://github.com/strapi/strapi.git"
32
+ "main": "./lib",
33
+ "directories": {
34
+ "lib": "./lib"
38
35
  },
39
- "bugs": {
40
- "url": "https://github.com/strapi/strapi/issues"
36
+ "scripts": {
37
+ "test": "echo \"no tests yet\""
38
+ },
39
+ "dependencies": {
40
+ "aws-sdk": "2.892.0",
41
+ "lodash": "4.17.21"
41
42
  },
42
43
  "engines": {
43
44
  "node": ">=12.x.x <=16.x.x",
44
45
  "npm": ">=6.0.0"
45
46
  },
46
- "license": "SEE LICENSE IN LICENSE",
47
- "scripts": {
48
- "test": "echo \"no tests yet\""
49
- },
50
- "gitHead": "522d6afd54b68ed3376dd0c807fab6c1315f1931"
47
+ "gitHead": "e2cd01e8c6cbfeba15ad7787e38b6eebcbb92221"
51
48
  }