File tree Expand file tree Collapse file tree
website/modules/@apostrophecms/uploadfs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const { getEnv } = require ( '../../../utils/env' ) ;
22
33const 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
68const 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+
1931if ( aposS3Secret ) {
2032 uploadfsOptions . secret = aposS3Secret ;
2133 uploadfsOptions . key = getEnv ( 'APOS_S3_KEY' ) ;
You can’t perform that action at this time.
0 commit comments