diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 75812346..5641f3e1 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -60,6 +60,7 @@ services: # - S3_SECRET_ACCESS_KEY= # - S3_BUCKET= # - S3_FORCE_PATH_STYLE=true + # - S3_REQUEST_CHECKSUM_CALCULATION= # - OIDC_ISSUER= # - OIDC_CLIENT_ID= diff --git a/docker-compose.yml b/docker-compose.yml index 9829ad35..d572bc8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,6 +76,7 @@ services: # - S3_SECRET_ACCESS_KEY__FILE=/run/secrets/s3_secret_access_key # - S3_BUCKET= # - S3_FORCE_PATH_STYLE=true + # - S3_REQUEST_CHECKSUM_CALCULATION= # - OIDC_ISSUER= # - OIDC_CLIENT_ID= diff --git a/server/.env.sample b/server/.env.sample index 46dae16c..c3263b32 100644 --- a/server/.env.sample +++ b/server/.env.sample @@ -51,6 +51,7 @@ SECRET_KEY=notsecretkey # S3_SECRET_ACCESS_KEY= # S3_BUCKET= # S3_FORCE_PATH_STYLE=true +# S3_REQUEST_CHECKSUM_CALCULATION= # OIDC_ISSUER= # OIDC_CLIENT_ID= diff --git a/server/api/hooks/s3/index.js b/server/api/hooks/s3/index.js index 5168ae8e..0e69925d 100644 --- a/server/api/hooks/s3/index.js +++ b/server/api/hooks/s3/index.js @@ -29,7 +29,7 @@ module.exports = function defineS3Hook(sails) { sails.log.info('Initializing custom hook (`s3`)'); - client = new S3Client({ + const config = { endpoint: sails.config.custom.s3Endpoint, region: sails.config.custom.s3Region || 'eu-central-1', credentials: { @@ -37,7 +37,13 @@ module.exports = function defineS3Hook(sails) { secretAccessKey: sails.config.custom.s3SecretAccessKey, }, forcePathStyle: sails.config.custom.s3ForcePathStyle, - }); + }; + + if (sails.config.custom.s3RequestChecksumCalculation) { + config.requestChecksumCalculation = sails.config.custom.s3RequestChecksumCalculation; + } + + client = new S3Client(config); }, getClient() { diff --git a/server/config/custom.js b/server/config/custom.js index 5db04627..4422fd79 100644 --- a/server/config/custom.js +++ b/server/config/custom.js @@ -72,6 +72,7 @@ module.exports.custom = { s3SecretAccessKey: process.env.S3_SECRET_ACCESS_KEY, s3Bucket: process.env.S3_BUCKET, s3ForcePathStyle: process.env.S3_FORCE_PATH_STYLE === 'true', + s3RequestChecksumCalculation: process.env.S3_REQUEST_CHECKSUM_CALCULATION, oidcIssuer: process.env.OIDC_ISSUER, oidcClientId: process.env.OIDC_CLIENT_ID,