diff --git a/backend/prisma/seed/config.seed.ts b/backend/prisma/seed/config.seed.ts index 8b2dbf2..b7a78f4 100644 --- a/backend/prisma/seed/config.seed.ts +++ b/backend/prisma/seed/config.seed.ts @@ -18,7 +18,6 @@ const configVariables: ConfigVariables = { appUrl: { type: "string", defaultValue: "http://localhost:3000", - secret: false, }, showHomePage: { @@ -36,15 +35,17 @@ const configVariables: ConfigVariables = { allowUnauthenticatedShares: { type: "boolean", defaultValue: "false", - secret: false, }, maxSize: { type: "number", defaultValue: "1000000000", - secret: false, }, + zipCompressionLevel: { + type: "number", + defaultValue: "9", + }, }, email: { enableShareEmailRecipients: { diff --git a/backend/src/share/share.service.ts b/backend/src/share/share.service.ts index b75218b..4ab8350 100644 --- a/backend/src/share/share.service.ts +++ b/backend/src/share/share.service.ts @@ -104,7 +104,7 @@ export class ShareService { const files = await this.prisma.file.findMany({ where: { shareId } }); const archive = archiver("zip", { - zlib: { level: 9 }, + zlib: { level: this.config.get("share.zipCompressionLevel") }, }); const writeStream = fs.createWriteStream(`${path}/archive.zip`); diff --git a/frontend/src/components/share/DownloadAllButton.tsx b/frontend/src/components/share/DownloadAllButton.tsx index f10c28d..f5e581a 100644 --- a/frontend/src/components/share/DownloadAllButton.tsx +++ b/frontend/src/components/share/DownloadAllButton.tsx @@ -49,7 +49,7 @@ const DownloadAllButton = ({ shareId }: { shareId: string }) => { } }} > - + ); }; diff --git a/frontend/src/i18n/translations/en-US.ts b/frontend/src/i18n/translations/en-US.ts index a74c399..6804b7f 100644 --- a/frontend/src/i18n/translations/en-US.ts +++ b/frontend/src/i18n/translations/en-US.ts @@ -386,6 +386,9 @@ export default { "Whether unauthenticated users can create shares", "admin.config.share.max-size": "Max size", "admin.config.share.max-size.description": "Maximum share size in bytes", + "admin.config.share.zip-compression-level": "Zip compression level", + "admin.config.share.zip-compression-level.description": + "Adjust the level to balance between file size and compression speed. Valid values range from 0 to 9, with 0 being no compression and 9 being maximum compression. ", "admin.config.smtp.enabled": "Enabled", "admin.config.smtp.enabled.description":