2022-03-12 17:23:04 +01:00
|
|
|
#!/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
|
|
|
|
|
2022-03-13 01:47:40 +01:00
|
|
|
sed -i -e "s/104857600/${MAX_DOWNLOAD_SIZE}/g" /etc/onlyoffice/documentserver-example/production-linux.json
|
2022-03-12 17:23:04 +01:00
|
|
|
|
2022-03-13 01:47:40 +01:00
|
|
|
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
|
2022-03-12 17:23:04 +01:00
|
|
|
|
2022-03-13 01:47:40 +01:00
|
|
|
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
|
2022-03-12 17:23:04 +01:00
|
|
|
|
2022-03-13 01:47:40 +01:00
|
|
|
sed -i "s/^client_max_body_size 100m;$/client_max_body_size ${MAX_DOWNLOAD_SIZE};/" /etc/onlyoffice/documentserver/nginx/includes/ds-common.conf
|
2022-03-12 17:23:04 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
touch /app/ds/largeFiles.lck
|
|
|
|
#service nginx restart
|
|
|
|
#supervisorctl restart all
|