From b9f2fdaf9d2794acc37e868c705448865ed5e5fa Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Sun, 15 May 2022 15:15:19 +0200 Subject: [PATCH] Move `largerFileLimits.sh` to `run-document-server.sh` --- README.md | 3 +-- docker-compose.yml | 2 ++ largerFiles.sh | 22 ---------------------- run-document-server.sh | 23 +++++++++++++++++++++++ 4 files changed, 26 insertions(+), 24 deletions(-) delete mode 100644 largerFiles.sh diff --git a/README.md b/README.md index 3247768..b6ab468 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,7 @@ volumes: 7. Save ### Setup lager file limits -1. Run `sh largerFiles.sh` -2. Input your container name, if you didn't change it, just press enter +- Uncomment the `- LARGER_FILE_LIMITS=true` line in `docker-compose.yml` #### Tags used on DockerHub - `latest` - the latest version of the Documentserver - `amd64` version diff --git a/docker-compose.yml b/docker-compose.yml index 91863c7..517f659 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,8 @@ services: #- JWT_SECRET=secret #- JWT_HEADER=AuthorizationJwt #- JWT_IN_BODY=true + # Uncomment the line below to set larger file limits (about 1GB) + #- LARGER_FILE_LIMITS=true ports: - '80:80' - '443:443' diff --git a/largerFiles.sh b/largerFiles.sh deleted file mode 100644 index 7f37cc6..0000000 --- a/largerFiles.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -echo "What's the name of your container? (default value: 'onlyoffice_documentserver')" -read container_name - -if [ "$container_name" = "" ]; then - container_name="onlyoffice_documentserver" -fi; - -docker exec -it $container_name "/bin/sh -c 'sed -i -e 's/104857600/10485760000/g' /etc/onlyoffice/documentserver-example/production-linux.json'" - -docker exec -it $container_name "/bin/sh -c 'sed -i '9iclient_max_body_size 1000M;' /etc/onlyoffice/documentserver-example/nginx/includes/ds-example.conf'" -docker exec -it $container_name "/bin/sh -c 'sed -i '16iclient_max_body_size 1000M;' /etc/nginx/nginx.conf'" - -docker exec -it $container_name "/bin/sh -c 'sed -i -e 's/104857600/10485760000/g' /etc/onlyoffice/documentserver/default.json'" -docker exec -it $container_name "/bin/sh -c 'sed -i -e 's/50MB/5000MB/g' /etc/onlyoffice/documentserver/default.json'" -docker exec -it $container_name "/bin/sh -c 'sed -i -e 's/300MB/3000MB/g' /etc/onlyoffice/documentserver/default.json'" - -docker exec -it $container_name "/bin/sh -c 'sed -i 's/^client_max_body_size 100m;$/client_max_body_size 1000m;/' /etc/onlyoffice/documentserver/nginx/includes/ds-common.conf'" - -docker exec -it $container_name "/bin/sh -c 'service nginx restart'" -docker exec -it $container_name "/bin/sh -c 'supervisorctl restart all'" diff --git a/run-document-server.sh b/run-document-server.sh index c8dcf39..8378094 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -66,6 +66,29 @@ NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} +# Chech if lager file limits should be set +if [ "$LARGER_FILE_LIMITS" = "true" ]; then + if [ -e /app/ds/file_limits_set ]; then + echo "" + else + touch /app/ds/file_limits_set + + /bin/sh -c 'sed -i -e 's/104857600/10485760000/g' /etc/onlyoffice/documentserver-example/production-linux.json' + + /bin/sh -c 'sed -i '9iclient_max_body_size 1000M;' /etc/onlyoffice/documentserver-example/nginx/includes/ds-example.conf' + /bin/sh -c 'sed -i '16iclient_max_body_size 1000M;' /etc/nginx/nginx.conf' + + /bin/sh -c 'sed -i -e 's/104857600/10485760000/g' /etc/onlyoffice/documentserver/default.json' + /bin/sh -c 'sed -i -e 's/50MB/5000MB/g' /etc/onlyoffice/documentserver/default.json' + /bin/sh -c 'sed -i -e 's/300MB/3000MB/g' /etc/onlyoffice/documentserver/default.json' + + /bin/sh -c 'sed -i 's/^client_max_body_size 100m;$/client_max_body_size 1000m;/' /etc/onlyoffice/documentserver/nginx/includes/ds-common.conf' + + /bin/sh -c 'service nginx restart' + /bin/sh -c 'supervisorctl restart all' + fi +fi + JWT_ENABLED=${JWT_ENABLED:-false} # validate user's vars before usinig in json