Skip to content

Commit

Permalink
Changes to plugin and middleware
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Andrew Hinchey <[email protected]>
  • Loading branch information
ChrisHinchey committed Aug 24, 2023
1 parent 20ca067 commit 196d2b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
26 changes: 14 additions & 12 deletions config/middlewares.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// ~/strapi-aws-s3/backend/config/middlewares.js

module.exports = [
"strapi::errors",
"strapi::cors",
"strapi::poweredBy",
"strapi::logger",
"strapi::query",
"strapi::body",
"strapi::session",
"strapi::favicon",
"strapi::public",
'strapi::errors',
{
name: 'strapi::security',
config: {
Expand All @@ -19,19 +13,27 @@ module.exports = [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'dl.airtable.com',
'saf-site.s3.us-east-1.amazonaws.com',
],
'media-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'dl.airtable.com',
'saf-site.s3.us-east-1.amazonaws.com',
],
upgradeInsecureRequests: null,
},
},
},
},
];
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
18 changes: 7 additions & 11 deletions config/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ module.exports = ({ env }) => ({
config: {
provider: 'aws-s3',
providerOptions: {
baseUrl: env('CDN_URL'),
rootPath: env('CDN_ROOT_PATH'),
s3Options: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
ACL: env('AWS_ACL', 'public-read'),
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60),
Bucket: env('AWS_BUCKET'),
},
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
region: env('AWS_REGION'),
params: {
ACL: env('AWS_ACL', 'public-read'),
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60),
Bucket: env('AWS_BUCKET'),
},
},
actionOptions: {
Expand Down

0 comments on commit 196d2b6

Please sign in to comment.