Skip to content

Commit

Permalink
add strapi::security middleware docs on README
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzaganelli committed Feb 8, 2022
1 parent 8b79236 commit 7c62c9e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,42 @@ module.exports = ({ env }) => ({
});
```

- you may need also to add to the unlayer domain to the _Content Security Policy_. Update the config file `config/middleware.js` as:

```diff
// ...
- "strapi::security",
+ {
+ name: "strapi::security",
+ config: {
+ contentSecurityPolicy: {
+ directives: {
+ "script-src": [
+ "'self'",
+ "'unsafe-inline'",
+ "editor.unlayer.com"
+ ],
+ "frame-src": [
+ "'self'",
+ "'unsafe-
+ inline'",
+ "editor.unlayer.com"
+ ],
+ "img-src": [
+ "'self'",
+ "data:",
+ "cdn.jsdelivr.net",
+ "strapi.io",
+ "s3.amazonaws.com",
+ `${env("AWS_BUCKET")}.s3.${env("AWS_REGION")}.amazonaws.com`
+ ],
+ },
+ },
+ },
+ },
// ...
```

- After successful installation you've to build a fresh package that includes plugin UI. To archive that simply use:

```bash
Expand Down

0 comments on commit 7c62c9e

Please sign in to comment.