Skip to content

Commit 0c82fe0

Browse files
Ihor MasechkoIhor Masechko
authored andcommitted
fix(uploadfs): disable S3 ACL usage for attachment uploads
1 parent 3a3a823 commit 0c82fe0

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

  • website/modules/@apostrophecms/uploadfs

website/modules/@apostrophecms/uploadfs/index.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
const { getEnv } = require('../../../utils/env');
22

33
const aposS3Secret = process.env.APOS_S3_SECRET;
4-
const aposS3Https = getEnv('APOS_S3_HTTPS');
4+
const aposS3Endpoint = process.env.APOS_S3_ENDPOINT;
5+
const aposS3Style = process.env.APOS_S3_STYLE;
6+
const aposS3Https = process.env.APOS_S3_HTTPS;
57

68
const uploadfsOptions = {
79
storage: 's3',
810
bucket: getEnv('APOS_S3_BUCKET'),
911
region: getEnv('APOS_S3_REGION'),
10-
endpoint: getEnv('APOS_S3_ENDPOINT'),
11-
style: getEnv('APOS_S3_STYLE'),
12-
https: aposS3Https.toLowerCase() === 'true',
12+
acl: process.env.APOS_S3_ACL || null,
1313
cdn: {
1414
enabled: true,
1515
url: getEnv('APOS_CDN_URL'),
1616
},
1717
};
1818

19+
if (aposS3Endpoint) {
20+
uploadfsOptions.endpoint = aposS3Endpoint;
21+
}
22+
23+
if (aposS3Style) {
24+
uploadfsOptions.style = aposS3Style;
25+
}
26+
27+
if (aposS3Https) {
28+
uploadfsOptions.https = aposS3Https.toLowerCase() === 'true';
29+
}
30+
1931
if (aposS3Secret) {
2032
uploadfsOptions.secret = aposS3Secret;
2133
uploadfsOptions.key = getEnv('APOS_S3_KEY');

0 commit comments

Comments
 (0)