Skip to content

Commit af2ba16

Browse files
committed
add s3 as the storage backend
1 parent 68ff9cc commit af2ba16

File tree

4 files changed

+5019
-2280
lines changed

4 files changed

+5019
-2280
lines changed

config/middlewares.ts

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
export default [
2-
'strapi::logger',
3-
'strapi::errors',
4-
'strapi::security',
5-
'strapi::cors',
6-
'strapi::poweredBy',
7-
'strapi::query',
8-
'strapi::body',
9-
'strapi::session',
10-
'strapi::favicon',
11-
'strapi::public',
2+
"strapi::logger",
3+
"strapi::errors",
4+
{
5+
name: "strapi::security",
6+
config: {
7+
contentSecurityPolicy: {
8+
useDefaults: true,
9+
directives: {
10+
"connect-src": ["'self'", "https:"],
11+
"img-src": [
12+
"'self'",
13+
"data:",
14+
"blob:",
15+
"market-assets.strapi.io",
16+
"openobserve-prod-website.s3.us-west-2.amazonaws.com",
17+
],
18+
"media-src": [
19+
"'self'",
20+
"data:",
21+
"blob:",
22+
"market-assets.strapi.io",
23+
"openobserve-prod-website.s3.us-west-2.amazonaws.com",
24+
],
25+
upgradeInsecureRequests: null,
26+
},
27+
},
28+
},
29+
},
30+
,
31+
"strapi::cors",
32+
"strapi::poweredBy",
33+
"strapi::query",
34+
"strapi::body",
35+
"strapi::session",
36+
"strapi::favicon",
37+
"strapi::public",
1238
];

config/plugins.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = ({ env }) => ({
2+
// ...
3+
upload: {
4+
config: {
5+
provider: "aws-s3",
6+
providerOptions: {
7+
rootPath: 'assets',
8+
s3Options: {
9+
region: env("AWS_REGION"),
10+
params: {
11+
Bucket: env("AWS_BUCKET"),
12+
},
13+
},
14+
},
15+
actionOptions: {
16+
upload: {},
17+
uploadStream: {},
18+
delete: {},
19+
},
20+
},
21+
},
22+
});

0 commit comments

Comments
 (0)