mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-29 01:28:59 -05:00
feat: ability to define zip compression level
This commit is contained in:
parent
389dc87cac
commit
7827b687fa
4 changed files with 9 additions and 5 deletions
|
@ -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`);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ const DownloadAllButton = ({ shareId }: { shareId: string }) => {
|
|||
}
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="share.download-all" />
|
||||
<FormattedMessage id="share.button.download-all" />
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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":
|
||||
|
|
Loading…
Add table
Reference in a new issue