mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 07:18:06 +02:00
Patched settings for 500mb upload limit
This commit is contained in:
parent
b31f7f3b7c
commit
7f6193e907
3 changed files with 123 additions and 0 deletions
|
@ -8,6 +8,8 @@ services:
|
|||
container_name: sharelatex
|
||||
volumes:
|
||||
- "${SHARELATEX_DATA_PATH}:/var/lib/sharelatex"
|
||||
- ../lib/patch/settings_limit_patch.js:/etc/sharelatex/settings.server-pro.js
|
||||
- ../lib/patch/nginx.settings.limit.conf.template:/etc/nginx/templates/nginx.conf.template
|
||||
ports:
|
||||
- "${SHARELATEX_LISTEN_IP:-127.0.0.1}:${SHARELATEX_PORT:-80}:80"
|
||||
environment:
|
||||
|
@ -19,6 +21,7 @@ services:
|
|||
SHARELATEX_MONGO_URL: "${MONGO_URL}"
|
||||
SHARELATEX_REDIS_HOST: "${REDIS_HOST}"
|
||||
V1_HISTORY_URL: "http://sharelatex:3100/api"
|
||||
MAX_FILE_UPLOAD_SIZE: 524288000
|
||||
env_file:
|
||||
- ../config/variables.env
|
||||
stop_grace_period: 60s
|
||||
|
|
81
lib/patch/nginx.settings.limit.conf.template
Normal file
81
lib/patch/nginx.settings.limit.conf.template
Normal file
|
@ -0,0 +1,81 @@
|
|||
## ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ##
|
||||
## ! This file was generated from a template ! ##
|
||||
## ! See /etc/nginx/templates/ ! ##
|
||||
## ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ##
|
||||
daemon off;
|
||||
user www-data;
|
||||
worker_processes ${NGINX_WORKER_PROCESSES};
|
||||
pid /run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections ${NGINX_WORKER_CONNECTIONS};
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout ${NGINX_KEEPALIVE_TIMEOUT};
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
|
||||
# server_names_hash_bucket_size 64;
|
||||
# server_name_in_redirect off;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
gzip_proxied any; # allow upstream server to compress.
|
||||
|
||||
client_max_body_size 500m;
|
||||
|
||||
# gzip_vary on;
|
||||
# gzip_proxied any;
|
||||
# gzip_comp_level 6;
|
||||
# gzip_buffers 16 8k;
|
||||
# gzip_http_version 1.1;
|
||||
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
##
|
||||
# nginx-naxsi config
|
||||
##
|
||||
# Uncomment it if you installed nginx-naxsi
|
||||
##
|
||||
|
||||
#include /etc/nginx/naxsi_core.rules;
|
||||
|
||||
##
|
||||
# nginx-passenger config
|
||||
##
|
||||
# Uncomment it if you installed nginx-passenger
|
||||
##
|
||||
|
||||
#passenger_root /usr;
|
||||
#passenger_ruby /usr/bin/ruby;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
39
lib/patch/settings_limit_patch.js
Normal file
39
lib/patch/settings_limit_patch.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
const Path = require('path')
|
||||
const base = require('/overleaf/services/web/config/settings.overrides.server-pro')
|
||||
const settings = require('/etc/sharelatex/settings.js')
|
||||
|
||||
settings.imageRoot = 'quay.io/sharelatex'
|
||||
|
||||
// TeX Live Images
|
||||
// -----------
|
||||
//
|
||||
if (process.env.SANDBOXED_COMPILES === 'true') {
|
||||
let allTexLiveDockerImages
|
||||
if (process.env.ALL_TEX_LIVE_DOCKER_IMAGES != null) {
|
||||
allTexLiveDockerImages = process.env.ALL_TEX_LIVE_DOCKER_IMAGES.split(',')
|
||||
}
|
||||
|
||||
let allTexLiveDockerImageNames
|
||||
if (process.env.ALL_TEX_LIVE_DOCKER_IMAGE_NAMES != null) {
|
||||
allTexLiveDockerImageNames =
|
||||
process.env.ALL_TEX_LIVE_DOCKER_IMAGE_NAMES.split(',')
|
||||
}
|
||||
|
||||
if (allTexLiveDockerImages != null) {
|
||||
settings.allowedImageNames = []
|
||||
for (let index = 0; index < allTexLiveDockerImages.length; index++) {
|
||||
const fullImageName = allTexLiveDockerImages[index]
|
||||
const imageName = Path.basename(fullImageName)
|
||||
const imageDesc =
|
||||
allTexLiveDockerImageNames != null
|
||||
? allTexLiveDockerImageNames[index]
|
||||
: imageName
|
||||
settings.allowedImageNames.push({ imageName, imageDesc })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settings.maxUploadSize = parseInt(process.env.MAX_FILE_UPLOAD_SIZE, 10)
|
||||
|
||||
module.exports = base.mergeWith(settings)
|
Loading…
Add table
Add a link
Reference in a new issue