From 56f320a9ad99ae3b607f30eb89b0f83e2f0bf795 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Mon, 14 Aug 2023 00:14:31 +0100 Subject: [PATCH 01/18] Double file size upload limits. The information contained in an actual budget is now much more detailed than it was previously. Doubling this file size should prevent errors --- src/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index d75cb46af..da3ee6daf 100644 --- a/src/app.js +++ b/src/app.js @@ -26,9 +26,9 @@ app.use( standardHeaders: true, }), ); -app.use(bodyParser.json({ limit: '20mb' })); -app.use(bodyParser.raw({ type: 'application/actual-sync', limit: '20mb' })); -app.use(bodyParser.raw({ type: 'application/encrypted-file', limit: '50mb' })); +app.use(bodyParser.json({ limit: '40mb' })); +app.use(bodyParser.raw({ type: 'application/actual-sync', limit: '40mb' })); +app.use(bodyParser.raw({ type: 'application/encrypted-file', limit: '100mb' })); app.use('/sync', syncApp.handlers); app.use('/account', accountApp.handlers); From f6b3927d0bab2cd49ada4796d95dab511f9059c0 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Mon, 14 Aug 2023 00:26:55 +0000 Subject: [PATCH 02/18] Add release notes --- upcoming-release-notes/245.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 upcoming-release-notes/245.md diff --git a/upcoming-release-notes/245.md b/upcoming-release-notes/245.md new file mode 100644 index 000000000..85e3a6bcc --- /dev/null +++ b/upcoming-release-notes/245.md @@ -0,0 +1,6 @@ +--- +category: Features +authors: DistroByte +--- + +Increase file size limits to double previous value to eliminate `PayloadTooLargeError` \ No newline at end of file From 5df26c6b4c008993c56acb2cee6271110d3b3a10 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Mon, 14 Aug 2023 00:28:56 +0000 Subject: [PATCH 03/18] Fix authors not being a list --- upcoming-release-notes/245.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upcoming-release-notes/245.md b/upcoming-release-notes/245.md index 85e3a6bcc..549d1561e 100644 --- a/upcoming-release-notes/245.md +++ b/upcoming-release-notes/245.md @@ -1,6 +1,7 @@ --- category: Features -authors: DistroByte +authors: + - DistroByte --- Increase file size limits to double previous value to eliminate `PayloadTooLargeError` \ No newline at end of file From 3ad9ec655b520011122baeb7d9f880be9b8642e0 Mon Sep 17 00:00:00 2001 From: DistroByte Date: Wed, 16 Aug 2023 00:18:46 +0100 Subject: [PATCH 04/18] Adds env var to configure upload limit --- docker-compose.yml | 3 +++ src/app.js | 16 +++++++++++++--- src/config-types.ts | 5 +++++ src/load-config.js | 20 ++++++++++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9659d0192..45a51c3a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,9 @@ services: # Uncomment any of the lines below to set configuration options. # - ACTUAL_HTTPS_KEY=/data/selfhost.key # - ACTUAL_HTTPS_CERT=/data/selfhost.crt + # - ACTUAL_FILE_SYNC_LIMIT=20 + # - ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT=50 + # - ACTUAL_FILE_LIMIT=20 # See all options and more details at https://actualbudget.github.io/docs/Installing/Configuration # !! If you are not using any of these options, remove the 'environment:' tag entirely. volumes: diff --git a/src/app.js b/src/app.js index da3ee6daf..cdd5bcb2c 100644 --- a/src/app.js +++ b/src/app.js @@ -26,9 +26,19 @@ app.use( standardHeaders: true, }), ); -app.use(bodyParser.json({ limit: '40mb' })); -app.use(bodyParser.raw({ type: 'application/actual-sync', limit: '40mb' })); -app.use(bodyParser.raw({ type: 'application/encrypted-file', limit: '100mb' })); +app.use(bodyParser.json({ limit: `${config.upload.fileLimit}` })); +app.use( + bodyParser.raw({ + type: 'application/actual-sync', + limit: `${config.upload.fileSyncLimit}mb`, + }), +); +app.use( + bodyParser.raw({ + type: 'application/encrypted-file', + limit: `${config.upload.syncEncryptedFileLimit}mb`, + }), +); app.use('/sync', syncApp.handlers); app.use('/account', accountApp.handlers); diff --git a/src/config-types.ts b/src/config-types.ts index 58268662c..9877f5be3 100644 --- a/src/config-types.ts +++ b/src/config-types.ts @@ -11,4 +11,9 @@ export interface Config { key: string; cert: string; } & ServerOptions; + upload?: { + fileSyncLimit: number; + syncEncryptedFileLimit: number; + fileLimit: number; + }; } diff --git a/src/load-config.js b/src/load-config.js index 0e5f10ad5..f27e88265 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -85,6 +85,18 @@ const finalConfig = { ...(config.https || {}), } : config.https, + upload: + process.env.ACTUAL_FILE_SYNC_LIMIT && + process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT && + process.env.ACTUAL_FILE_LIMIT + ? { + fileSyncLimit: +process.env.ACTUAL_FILE_SYNC_LIMIT || 20, + syncEncryptedFileLimit: + +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || 50, + fileLimit: +process.env.ACTUAL_FILE_LIMIT || 20, + ...(config.upload || {}), + } + : config.upload, }; debug(`using port ${finalConfig.port}`); @@ -100,4 +112,12 @@ if (finalConfig.https) { debugSensitive(`using https cert ${finalConfig.https.cert}`); } +if (finalConfig.upload) { + debug(`using file sync limit ${finalConfig.upload.fileSyncLimit}`); + debug( + `using sync encrypted file limit ${finalConfig.upload.syncEncryptedFileLimit}`, + ); + debug(`using file limit ${finalConfig.upload.fileLimit}`); +} + export default finalConfig; From 16f1d7694b99132cbb7b35610d1858091bc9e839 Mon Sep 17 00:00:00 2001 From: DistroByte Date: Wed, 16 Aug 2023 00:20:49 +0100 Subject: [PATCH 05/18] Update changelog --- upcoming-release-notes/245.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upcoming-release-notes/245.md b/upcoming-release-notes/245.md index 549d1561e..396cea948 100644 --- a/upcoming-release-notes/245.md +++ b/upcoming-release-notes/245.md @@ -1,7 +1,7 @@ --- category: Features -authors: - - DistroByte +authors: + - DistroByte --- -Increase file size limits to double previous value to eliminate `PayloadTooLargeError` \ No newline at end of file +Make upload limits configurable via env vars to allow for larger files to be uploaded. From 2023f176cd486aec10122bc4f3c85b3e9e7c88c3 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 20:57:29 +0100 Subject: [PATCH 06/18] Commit suggestion Co-authored-by: Matiss Janis Aboltins --- src/load-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index ee9af7428..ca0dd2b1f 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -96,9 +96,9 @@ const finalConfig = { process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT && process.env.ACTUAL_FILE_LIMIT ? { - fileSyncLimit: +process.env.ACTUAL_FILE_SYNC_LIMIT || 20, + fileSyncLimit: +process.env.ACTUAL_FILE_SYNC_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, syncEncryptedFileLimit: - +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || 50, + +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 50, fileLimit: +process.env.ACTUAL_FILE_LIMIT || 20, ...(config.upload || {}), } From 11cc89c62dd795d02475ad042bdcc8470db14e62 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 20:57:49 +0100 Subject: [PATCH 07/18] Commit suggestion Co-authored-by: Matiss Janis Aboltins --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 45a51c3a6..44384f774 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,9 +10,9 @@ services: # Uncomment any of the lines below to set configuration options. # - ACTUAL_HTTPS_KEY=/data/selfhost.key # - ACTUAL_HTTPS_CERT=/data/selfhost.crt - # - ACTUAL_FILE_SYNC_LIMIT=20 - # - ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT=50 - # - ACTUAL_FILE_LIMIT=20 + # - ACTUAL_FILE_SIZE_SYNC_LIMIT_MB=20 + # - ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB=50 + # - ACTUAL_FILE_SIZE_LIMIT_MB=20 # See all options and more details at https://actualbudget.github.io/docs/Installing/Configuration # !! If you are not using any of these options, remove the 'environment:' tag entirely. volumes: From 2dcbea407a5dcb7fc9f0ecdd24931c6107aff759 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 20:58:05 +0100 Subject: [PATCH 08/18] Commit suggestion Co-authored-by: Matiss Janis Aboltins --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 7555a2628..5fc36e82f 100644 --- a/src/app.js +++ b/src/app.js @@ -27,7 +27,7 @@ app.use( standardHeaders: true, }), ); -app.use(bodyParser.json({ limit: `${config.upload.fileLimit}` })); +app.use(bodyParser.json({ limit: `${config.upload.fileSizeLimitMB}mb` })); app.use( bodyParser.raw({ type: 'application/actual-sync', From c968d843c12260249c4a3351b48c598aa7ad28a9 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 20:58:18 +0100 Subject: [PATCH 09/18] Commit suggestion Co-authored-by: Matiss Janis Aboltins --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 5fc36e82f..a9add012a 100644 --- a/src/app.js +++ b/src/app.js @@ -31,7 +31,7 @@ app.use(bodyParser.json({ limit: `${config.upload.fileSizeLimitMB}mb` })); app.use( bodyParser.raw({ type: 'application/actual-sync', - limit: `${config.upload.fileSyncLimit}mb`, + limit: `${config.upload.fileSizeSyncLimitMB}mb`, }), ); app.use( From eed4a3579348bc5738a6aa577623d3d9df0bbd97 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 20:58:34 +0100 Subject: [PATCH 10/18] Commit suggestion Co-authored-by: Matiss Janis Aboltins --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index a9add012a..6d588d238 100644 --- a/src/app.js +++ b/src/app.js @@ -37,7 +37,7 @@ app.use( app.use( bodyParser.raw({ type: 'application/encrypted-file', - limit: `${config.upload.syncEncryptedFileLimit}mb`, + limit: `${config.upload.syncEncryptedFileSizeLimitMB}mb`, }), ); From d12140f90c0746b7957e18657cf90a709d7b4683 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 21:03:18 +0100 Subject: [PATCH 11/18] Make env vars OR operators --- src/load-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index ca0dd2b1f..7d2af8267 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -92,8 +92,8 @@ const finalConfig = { } : config.https, upload: - process.env.ACTUAL_FILE_SYNC_LIMIT && - process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT && + process.env.ACTUAL_FILE_SYNC_LIMIT || + process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || process.env.ACTUAL_FILE_LIMIT ? { fileSyncLimit: +process.env.ACTUAL_FILE_SYNC_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, From a52f2cafbccce06b73884f4e585ddc0e9fe662c9 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 21:06:36 +0100 Subject: [PATCH 12/18] update config names --- src/load-config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index 7d2af8267..bbb576c75 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -119,11 +119,11 @@ if (finalConfig.https) { } if (finalConfig.upload) { - debug(`using file sync limit ${finalConfig.upload.fileSyncLimit}`); + debug(`using file sync limit ${finalConfig.upload.fileSizeSyncLimitMB}mb`); debug( - `using sync encrypted file limit ${finalConfig.upload.syncEncryptedFileLimit}`, + `using sync encrypted file limit ${finalConfig.upload.syncEncryptedFileSizeLimitMB}mb`, ); - debug(`using file limit ${finalConfig.upload.fileLimit}`); + debug(`using file limit ${finalConfig.upload.fileSizeLimitMB}mb`); } export default finalConfig; From bf5cbd79daa541c6fae2adcc61885082f8ef12a7 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 21:08:38 +0100 Subject: [PATCH 13/18] Update config types --- src/config-types.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config-types.ts b/src/config-types.ts index 9877f5be3..fc59333d4 100644 --- a/src/config-types.ts +++ b/src/config-types.ts @@ -12,8 +12,8 @@ export interface Config { cert: string; } & ServerOptions; upload?: { - fileSyncLimit: number; - syncEncryptedFileLimit: number; - fileLimit: number; + fileSizeSyncLimitMB: number; + syncEncryptedFileSizeLimitMB: number; + fileSizeLimitMB: number; }; } From 33ce54f3a3e2ddad281d07fea6c228d2c7cb91d9 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 21:16:32 +0100 Subject: [PATCH 14/18] autoformatting changes --- src/load-config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index bbb576c75..5a55d364a 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -96,9 +96,14 @@ const finalConfig = { process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || process.env.ACTUAL_FILE_LIMIT ? { - fileSyncLimit: +process.env.ACTUAL_FILE_SYNC_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, + fileSyncLimit: + +process.env.ACTUAL_FILE_SYNC_LIMIT || + +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || + 20, syncEncryptedFileLimit: - +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 50, + +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || + +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || + 50, fileLimit: +process.env.ACTUAL_FILE_LIMIT || 20, ...(config.upload || {}), } From b3c09fb82ac2c07b5ae53d3bd56315e340fa259a Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 21:31:26 +0100 Subject: [PATCH 15/18] Address comments --- src/load-config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/load-config.js b/src/load-config.js index 5a55d364a..e8e824d2e 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -55,6 +55,11 @@ let defaultConfig = { 'web', 'build', ), + upload: { + fileSizeSyncLimitMB: 20, + syncEncryptedFileSizeLimitMB: 50, + fileSizeLimitMB: 20, + }, }; /** @type {import('./config-types.js').Config} */ @@ -104,7 +109,7 @@ const finalConfig = { +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 50, - fileLimit: +process.env.ACTUAL_FILE_LIMIT || 20, + fileLimit: +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, ...(config.upload || {}), } : config.upload, From 8159494527706a7cdce4926b7a7bdcbe1d90a0ae Mon Sep 17 00:00:00 2001 From: James Hackett Date: Tue, 22 Aug 2023 23:08:28 +0100 Subject: [PATCH 16/18] Fix env var namings --- src/load-config.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index e8e824d2e..0a66a2f96 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -97,17 +97,17 @@ const finalConfig = { } : config.https, upload: - process.env.ACTUAL_FILE_SYNC_LIMIT || - process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || - process.env.ACTUAL_FILE_LIMIT + process.env.ACTUAL_FILE_SIZE_SYNC_LIMIT_MB || + process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || + process.env.ACTUAL_FILE_SIZE_LIMIT_MB ? { fileSyncLimit: - +process.env.ACTUAL_FILE_SYNC_LIMIT || - +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || + process.env.ACTUAL_FILE_SIZE_SYNC_LIMIT_MB || + process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, syncEncryptedFileLimit: - +process.env.ACTUAL_SYNC_ENCRYPTED_FILE_LIMIT || - +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || + process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || + process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 50, fileLimit: +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, ...(config.upload || {}), From 0613dd1b6626652e07df5729722b5d0b47a8389c Mon Sep 17 00:00:00 2001 From: James Hackett Date: Wed, 23 Aug 2023 20:36:53 +0100 Subject: [PATCH 17/18] naming is hard --- src/load-config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/load-config.js b/src/load-config.js index 0a66a2f96..d648ac7d7 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -101,15 +101,15 @@ const finalConfig = { process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || process.env.ACTUAL_FILE_SIZE_LIMIT_MB ? { - fileSyncLimit: + fileSizeSyncLimitMB: process.env.ACTUAL_FILE_SIZE_SYNC_LIMIT_MB || process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, - syncEncryptedFileLimit: + syncEncryptedFileSizeLimitMB: process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 50, - fileLimit: +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, + fileSizeLimitMB: +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, ...(config.upload || {}), } : config.upload, From 523072d9b4b956dab936fd12e494c8c00cdf4fbb Mon Sep 17 00:00:00 2001 From: James Hackett Date: Thu, 24 Aug 2023 01:36:21 +0100 Subject: [PATCH 18/18] Fix env var names in compose --- docker-compose.yml | 6 +++--- src/load-config.js | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 44384f774..2a6851fd1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,9 +10,9 @@ services: # Uncomment any of the lines below to set configuration options. # - ACTUAL_HTTPS_KEY=/data/selfhost.key # - ACTUAL_HTTPS_CERT=/data/selfhost.crt - # - ACTUAL_FILE_SIZE_SYNC_LIMIT_MB=20 - # - ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB=50 - # - ACTUAL_FILE_SIZE_LIMIT_MB=20 + # - ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB=20 + # - ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB=50 + # - ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB=20 # See all options and more details at https://actualbudget.github.io/docs/Installing/Configuration # !! If you are not using any of these options, remove the 'environment:' tag entirely. volumes: diff --git a/src/load-config.js b/src/load-config.js index d648ac7d7..a4714d1ed 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -97,20 +97,21 @@ const finalConfig = { } : config.https, upload: - process.env.ACTUAL_FILE_SIZE_SYNC_LIMIT_MB || - process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || - process.env.ACTUAL_FILE_SIZE_LIMIT_MB + process.env.ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB || + process.env.ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB || + process.env.ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB ? { fileSizeSyncLimitMB: - process.env.ACTUAL_FILE_SIZE_SYNC_LIMIT_MB || - process.env.ACTUAL_FILE_SIZE_LIMIT_MB || - 20, + +process.env.ACTUAL_UPLOAD_FILE_SYNC_SIZE_LIMIT_MB || + +process.env.ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB || + config.upload.fileSizeSyncLimitMB, syncEncryptedFileSizeLimitMB: - process.env.ACTUAL_SYNC_ENCRYPTED_FILE_SIZE_LIMIT_MB || - process.env.ACTUAL_FILE_SIZE_LIMIT_MB || - 50, - fileSizeLimitMB: +process.env.ACTUAL_FILE_SIZE_LIMIT_MB || 20, - ...(config.upload || {}), + +process.env.ACTUAL_UPLOAD_SYNC_ENCRYPTED_FILE_SYNC_SIZE_LIMIT_MB || + +process.env.ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB || + config.upload.syncEncryptedFileSizeLimitMB, + fileSizeLimitMB: + +process.env.ACTUAL_UPLOAD_FILE_SIZE_LIMIT_MB || + config.upload.fileSizeLimitMB, } : config.upload, };