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.pull/3740/head
parent
d1ad29a3d1
commit
f4418149cb
|
@ -408,6 +408,14 @@
|
|||
"indentationOnNewLine": false,
|
||||
*/
|
||||
|
||||
/*
|
||||
* From Etherpad 1.8.3 onwards, the maximum allowed size for a single imported
|
||||
* file is always bounded.
|
||||
*
|
||||
* File size is specified in bytes. Default is 50 MB.
|
||||
*/
|
||||
"importMaxFileSize": 52428800, // 50 * 1024 * 1024
|
||||
|
||||
/*
|
||||
* Toolbar buttons configuration.
|
||||
*
|
||||
|
|
|
@ -413,6 +413,14 @@
|
|||
"indentationOnNewLine": false,
|
||||
*/
|
||||
|
||||
/*
|
||||
* From Etherpad 1.8.3 onwards, the maximum allowed size for a single imported
|
||||
* file is always bounded.
|
||||
*
|
||||
* File size is specified in bytes. Default is 50 MB.
|
||||
*/
|
||||
"importMaxFileSize": 52428800, // 50 * 1024 * 1024
|
||||
|
||||
/*
|
||||
* Toolbar buttons configuration.
|
||||
*
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -305,6 +305,14 @@ exports.scrollWhenFocusLineIsOutOfViewport = {
|
|||
*/
|
||||
exports.exposeVersion = false;
|
||||
|
||||
/*
|
||||
* From Etherpad 1.8.3 onwards, the maximum allowed size for a single imported
|
||||
* file is always bounded.
|
||||
*
|
||||
* File size is specified in bytes. Default is 50 MB.
|
||||
*/
|
||||
exports.importMaxFileSize = 50 * 1024 * 1024;
|
||||
|
||||
// checks if abiword is avaiable
|
||||
exports.abiwordAvailable = function()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue