Skip to content

Commit a54887d

Browse files
committed
fix(s3): make data integrity protections opt-in
Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent fac380f commit a54887d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config/config.sample.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,12 @@
19801980
// optional: Maximum number of retry attempts for failed S3 requests
19811981
// Default: 5
19821982
'retriesMaxAttempts' => 5,
1983+
// Data Integrity Protections for Amazon S3 (https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html)
1984+
// Valid values are "when_required" (default) and "when_supported".
1985+
// To ensure compatibility with 3rd party S3 implementations, Nextcloud disables it by default. However, if you are
1986+
// using Amazon S3 (or any other implementation that supports it) we recommend enabling it by using "when_supported".
1987+
'request_checksum_calculation' => 'when_required',
1988+
'response_checksum_validation' => 'when_required',
19831989
],
19841990
],
19851991

lib/private/Files/ObjectStore/S3ConnectionTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,14 @@ public function getConnection() {
133133

134134
if (isset($this->params['request_checksum_calculation'])) {
135135
$options['request_checksum_calculation'] = $this->params['request_checksum_calculation'];
136+
} else {
137+
$options['request_checksum_calculation'] = 'when_required';
136138
}
137139

138140
if (isset($this->params['response_checksum_validation'])) {
139141
$options['response_checksum_validation'] = $this->params['response_checksum_validation'];
142+
} else {
143+
$options['response_checksum_validation'] = 'when_required';
140144
}
141145

142146
if ($this->getProxy()) {

0 commit comments

Comments
 (0)