Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error cellar acl public bucket #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ TRANSFER_TOKEN_SALT="<your-token>"

Run `openssl rand -hex 32` for each value and replace `<your-token>` with the result.

#### Custom domain

If you use custom domain, change `origin:` on `middlewares.js`

#### A PostgreSQL add-on

Environment variables have already been set in the code.
Expand All @@ -74,6 +78,8 @@ This project uses [@strapi/provider-upload-aws-s3](https://www.npmjs.com/package

Don't forget to connect your add-ons to the application (**Service dependencies** option from your app menu in Clever Cloud Console).

Cellar policies need to be public. Follow this [documentation](https://www.clever-cloud.com/developers/doc/addons/cellar/#public-bucket-policy).

#### Dedicated build instance

Strapi can run on a small instance like the `XS` plan, but the build process can take more RAM and CPU. Enable a dedicated build instance from your app menu **Information** option in Clever Cloud Console.
Expand Down
33 changes: 30 additions & 3 deletions config/middlewares.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
module.exports = [
export default ({ env }) => [
'strapi::logger',
'strapi::errors',
'strapi::security',
'strapi::cors',
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'"],
'img-src': [
"'self'",
'data:',
'blob:',
'https://' + env('CELLAR_BUCKET') + '.' + env('CELLAR_ADDON_HOST')
],
'media-src': ["'self'", 'data:', 'blob:', 'https://' + env('CELLAR_BUCKET') + '.' + env('CELLAR_ADDON_HOST')],
upgradeInsecureRequests: null,
},
},
},
},
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
{
name: 'strapi::cors',
config: {
enabled: true,
origin: ['https://' + env("APP_ID") + '.cleverapps.io'], //change if you use your own DNS
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD'],
headers: ['*'],
credentials: true,
},
}
];