import: introduce importMaxFileSize setting. Defaults to 50 MB

From Etherpad 1.8.3 onwards, the maximum allowed size for a single imported
file will always be bounded.

The maximum allowed size can be configured via importMaxFileSize.
This commit is contained in:
John McLear 2020-04-07 01:07:10 +02:00 committed by muxator
parent d1ad29a3d1
commit f4418149cb
4 changed files with 25 additions and 0 deletions

View file

@ -72,6 +72,7 @@ async function doImport(req, res, padId)
let form = new formidable.IncomingForm();
form.keepExtensions = true;
form.uploadDir = tmpDirectory;
form.maxFileSize = settings.importMaxFileSize;
// locally wrapped Promise, since form.parse requires a callback
let srcFile = await new Promise((resolve, reject) => {