Add option to enlarge the file limits

This commit is contained in:
Jiří Štefka 2022-03-12 17:23:04 +01:00
parent ae61eae818
commit 4209059223
3 changed files with 31 additions and 0 deletions

@ -19,6 +19,11 @@ services:
#- JWT_SECRET=secret
#- JWT_HEADER=AuthorizationJwt
#- JWT_IN_BODY=true
# Uncomment strings below to enable larger files
#- LARGER_FILES = true
#- MAX_DOWNLOAD_SIZE = 104857600 # Download size in bytes
#- MAX_UNCOMPRESSED_SIZE = 300 # Uncompressed of a file in MB
ports:
- '80:80'
- '443:443'

22
largeFiles.sh Executable file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
LARGER_FILES=${LARGER_FILES:-false}
MAX_DOWNOAD_SIZE=${MAX_DOWNLOAD_SIZE:-104857600}
MAX_UNCOMPRESSED_SIZE=${MAX_UNCOMPRESSED_SIZE:-300}
if [ "$LARGER_FILES" = true ]; then
sed -i -e 's/104857600/${MAX_DOWNLOAD_SIZE}/g' /etc/onlyoffice/documentserver-example/production-linux.json
sed -i '9iclient_max_body_size ${MAX_DOWNLOAD_SIZE};' /etc/onlyoffice/documentserver-example/nginx/includes/ds-example.conf
sed -i '16iclient_max_body_size ${MAX_DOWLOAD_SIZE};' /etc/nginx/nginx.conf
sed -i -e 's/104857600/${MAX_DOWNLOAD_SIZE}/g' /etc/onlyoffice/documentserver/default.json
sed -i -e 's/50MB/${MAX_UNCOMPRESSED_SIZE}MB/g' /etc/onlyoffice/documentserver/default.json
sed -i -e 's/300MB/${MAX_UNCOMPRESSED_SIZE}MB/g' /etc/onlyoffice/documentserver/default.json
sed -i 's/^client_max_body_size 100m;$/client_max_body_size ${MAX_DOWNLOAD_SIZE};/' /etc/onlyoffice/documentserver/nginx/includes/ds-common.conf
fi
touch /app/ds/largeFiles.lck
#service nginx restart
#supervisorctl restart all

@ -1,5 +1,9 @@
#!/bin/bash
if [! -f /app/ds/largeFiles.lck]; then
/app/ds/largeFiles.sh
fi
function clean_exit {
/usr/bin/documentserver-prepare4shutdown.sh
}