feat(s3): allow disabling upload checksum (#804)

* S3 - toggle useChecksum

* Update frontend/src/i18n/translations/en-US.ts

---------

Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
marekhanzlik
2025-04-04 14:59:09 +02:00
committed by GitHub
parent 8e828311fe
commit 73a76a9d5b
4 changed files with 13 additions and 1 deletions

View File

@@ -349,6 +349,10 @@ export const configVariables = {
defaultValue: "", defaultValue: "",
obscured: true, obscured: true,
}, },
useChecksum: {
type: "boolean",
defaultValue: "true",
},
}, },
legal: { legal: {
enabled: { enabled: {

View File

@@ -275,6 +275,8 @@ export class S3FileService {
} }
getS3Instance(): S3Client { getS3Instance(): S3Client {
const checksumCalculation = this.config.get("s3.useChecksum") === true ? null : "WHEN_REQUIRED";
return new S3Client({ return new S3Client({
endpoint: this.config.get("s3.endpoint"), endpoint: this.config.get("s3.endpoint"),
region: this.config.get("s3.region"), region: this.config.get("s3.region"),
@@ -283,6 +285,8 @@ export class S3FileService {
secretAccessKey: this.config.get("s3.secret"), secretAccessKey: this.config.get("s3.secret"),
}, },
forcePathStyle: true, forcePathStyle: true,
requestChecksumCalculation: checksumCalculation,
responseChecksumValidation: checksumCalculation,
}); });
} }

View File

@@ -465,6 +465,8 @@ export default {
"admin.config.s3.key.description": "The key which allows you to access the S3 bucket.", "admin.config.s3.key.description": "The key which allows you to access the S3 bucket.",
"admin.config.s3.secret": "Secret", "admin.config.s3.secret": "Secret",
"admin.config.s3.secret.description": "The secret which allows you to access the S3 bucket.", "admin.config.s3.secret.description": "The secret which allows you to access the S3 bucket.",
"admin.config.s3.use-checksum": "Použít checksum",
"admin.config.s3.use-checksum.description": "Vypněte pro backendy které nepodporují checksum (např. B2)",
"admin.config.category.legal": "Legal", "admin.config.category.legal": "Legal",
"admin.config.legal.enabled": "Enable legal notices", "admin.config.legal.enabled": "Enable legal notices",
"admin.config.legal.enabled.description": "Whether to show a link to imprint and privacy policy in the footer.", "admin.config.legal.enabled.description": "Whether to show a link to imprint and privacy policy in the footer.",

View File

@@ -655,6 +655,8 @@ export default {
"admin.config.s3.key.description": "The key which allows you to access the S3 bucket.", "admin.config.s3.key.description": "The key which allows you to access the S3 bucket.",
"admin.config.s3.secret": "Secret", "admin.config.s3.secret": "Secret",
"admin.config.s3.secret.description": "The secret which allows you to access the S3 bucket.", "admin.config.s3.secret.description": "The secret which allows you to access the S3 bucket.",
"admin.config.s3.use-checksum": "Use checksum",
"admin.config.s3.use-checksum.description": "Turn off for backends that do not support checksum (e.g. B2).",
"admin.config.category.legal": "Legal", "admin.config.category.legal": "Legal",
"admin.config.legal.enabled": "Enable legal notices", "admin.config.legal.enabled": "Enable legal notices",