mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Add MAX_UPLOAD_SIZE environment variable
This commit is contained in:
@@ -20,6 +20,7 @@ if [ -f "${nginx_template_file}" ]; then
|
|||||||
export NGINX_KEEPALIVE_TIMEOUT="${NGINX_KEEPALIVE_TIMEOUT:-65}"
|
export NGINX_KEEPALIVE_TIMEOUT="${NGINX_KEEPALIVE_TIMEOUT:-65}"
|
||||||
export NGINX_WORKER_CONNECTIONS="${NGINX_WORKER_CONNECTIONS:-768}"
|
export NGINX_WORKER_CONNECTIONS="${NGINX_WORKER_CONNECTIONS:-768}"
|
||||||
export NGINX_WORKER_PROCESSES="${NGINX_WORKER_PROCESSES:-4}"
|
export NGINX_WORKER_PROCESSES="${NGINX_WORKER_PROCESSES:-4}"
|
||||||
|
export MAX_UPLOAD_SIZE="${MAX_UPLOAD_SIZE:-50}"
|
||||||
|
|
||||||
echo "Nginx: generating config file from template"
|
echo "Nginx: generating config file from template"
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ if [ -f "${nginx_template_file}" ]; then
|
|||||||
${NGINX_KEEPALIVE_TIMEOUT}
|
${NGINX_KEEPALIVE_TIMEOUT}
|
||||||
${NGINX_WORKER_CONNECTIONS}
|
${NGINX_WORKER_CONNECTIONS}
|
||||||
${NGINX_WORKER_PROCESSES}
|
${NGINX_WORKER_PROCESSES}
|
||||||
|
${MAX_UPLOAD_SIZE}
|
||||||
' \
|
' \
|
||||||
< "${nginx_template_file}" \
|
< "${nginx_template_file}" \
|
||||||
> "${nginx_config_file}"
|
> "${nginx_config_file}"
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ http {
|
|||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
gzip_proxied any; # allow upstream server to compress.
|
gzip_proxied any; # allow upstream server to compress.
|
||||||
|
|
||||||
client_max_body_size 50m;
|
client_max_body_size ${MAX_UPLOAD_SIZE}m;
|
||||||
|
|
||||||
# gzip_vary on;
|
# gzip_vary on;
|
||||||
# gzip_proxied any;
|
# gzip_proxied any;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function _isZipTooLarge(source) {
|
|||||||
)
|
)
|
||||||
return done(new InvalidZipFileError({ info: { totalSizeInBytes } }))
|
return done(new InvalidZipFileError({ info: { totalSizeInBytes } }))
|
||||||
}
|
}
|
||||||
done(null, totalSizeInBytes > ONE_MEG * 300)
|
done(null, totalSizeInBytes > ONE_MEG * 6 * Settings.maxUploadSize)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -375,7 +375,9 @@ module.exports = {
|
|||||||
process.env.PROJECT_UPLOAD_TIMEOUT || '120000',
|
process.env.PROJECT_UPLOAD_TIMEOUT || '120000',
|
||||||
10
|
10
|
||||||
),
|
),
|
||||||
maxUploadSize: 50 * 1024 * 1024, // 50 MB
|
maxUploadSize: process.env.MAX_UPLOAD_SIZE
|
||||||
|
? parseInt(process.env.MAX_UPLOAD_SIZE, 10) * 1024 * 1024
|
||||||
|
: 50 * 1024 * 1024, // 50 MB
|
||||||
multerOptions: {
|
multerOptions: {
|
||||||
preservePath: process.env.MULTER_PRESERVE_PATH,
|
preservePath: process.env.MULTER_PRESERVE_PATH,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user