mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
feat: ability to define zip compression level
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user