diff --git a/.env b/.env index 62e61db..f6e0ebd 100644 --- a/.env +++ b/.env @@ -14,7 +14,7 @@ PRODUCT_EDITION= # Unless otherwise specified, the latest up-to-date version will be used # Example: # RELEASE_VERSION=-7.2.2 -RELEASE_VERSION= +RELEASE_VERSION=-8.0.0 # Prefix in the name of your repository in Docker Hub PREFIX_NAME=docs diff --git a/Dockerfile b/Dockerfile index db92954..22cebca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,6 +60,7 @@ ENV DOCSERVICE_HOST_PORT=localhost:8000 \ EXAMPLE_HOST_PORT=localhost:3000 \ NGINX_ACCESS_LOG=off \ NGINX_GZIP_PROXIED=off \ + NGINX_CLIENT_MAX_BODY_SIZE=100m \ NGINX_WORKER_CONNECTIONS=4096 EXPOSE 8888 RUN yum -y updateinfo && \ @@ -203,7 +204,7 @@ RUN mkdir -p \ USER ds ENTRYPOINT docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter -FROM node:buster AS example +FROM node:lts-buster-slim AS example LABEL maintainer Ascensio System SIA ENV LANG=en_US.UTF-8 \ @@ -214,7 +215,9 @@ ENV LANG=en_US.UTF-8 \ WORKDIR /var/www/onlyoffice/documentserver-example/ -RUN git clone \ +RUN apt update -y && \ + apt install git -y && \ + git clone \ --depth 1 \ --recurse-submodules \ https://github.com/ONLYOFFICE/document-server-integration.git && \ diff --git a/README.md b/README.md index c79c812..5c12f41 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ Below is the complete list of parameters for `onlyoffice/docs-proxy`. - **EXAMPLE_HOST_PORT**: Defaults to `localhost:3000`. - **NGINX_ACCESS_LOG**: Defines the nginx config [access_log](https://nginx.org/ru/docs/http/ngx_http_log_module.html#access_log) directive. Defaults to `off`. - **NGINX_GZIP_PROXIED**: Defines the nginx config [gzip_proxied](https://nginx.org/ru/docs/http/ngx_http_gzip_module.html#gzip_proxied) directive. Defaults to `off`. +- **NGINX_CLIENT_MAX_BODY_SIZE**: Defines the nginx config [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size) directive. Defaults to `100m`. - **NGINX_WORKER_CONNECTIONS**: Defines the nginx config [worker_connections](https://nginx.org/en/docs/ngx_core_module.html#worker_connections) directive. Defaults to `4096`. - **SECURE_LINK_SECRET**: Defines secret for the nginx config directive [secure_link_md5](http://nginx.org/ru/docs/http/ngx_http_secure_link_module.html#secure_link_md5). Defaults to `verysecretstring`. - **INFO_ALLOWED_IP**: Defines ip addresses for accessing the info page. You can specify multiple values separated by a space. @@ -164,6 +165,7 @@ Below is the complete list of parameters for `onlyoffice/docs-docservice`, `only - **REDIS_SERVER_PWD**: The password set for the Redis account. - **REDIS_SERVER_DB_NUM**: Number of the redis logical database to be [selected](https://redis.io/commands/select/). Default to `0`. - **REDIS_SENTINEL_GROUP_NAME**: Name of a group of Redis instances composed of a master and one or more slaves. Default to `mymaster`. +- **REDIS_CLUSTER_NODES**: List of nodes in the Redis cluster. There is no need to specify every node in the cluster, 3 should be enough. You can specify multiple values separated by a space. It must be specified in the `host:port` format. - **JWT_ENABLED**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Docs. Common for inbox and outbox requests. Defaults to `true`. - **JWT_ENABLED_INBOX**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Docs only for inbox requests. Default, the value of the variable `JWT_ENABLED` is used. - **JWT_ENABLED_OUTBOX**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Docs only for outbox requests. Default, the value of the variable `JWT_ENABLED` is used. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7454b87..c86a847 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -23,6 +23,21 @@ case $AMQP_PROTO in ;; esac +if [[ -n "$REDIS_CLUSTER_NODES" ]]; then + declare -a REDIS_CLUSTER_NODES_ALL=($REDIS_CLUSTER_NODES) + REDIS_CLUSTER_NODES_ARRAY=() + for node in "${REDIS_CLUSTER_NODES_ALL[@]}"; do + REDIS_CLUSTER_NODES_ARRAY+=('{ "url": "redis://'$node'" }') + done + OLD_IFS="$IFS" + IFS="," + NODES=$(echo "${REDIS_CLUSTER_NODES_ARRAY[*]}") + IFS="$OLD_IFS" + REDIS_CLUSTER='"rootNodes": [ '$NODES' ], "defaults": { "username": "'${REDIS_SERVER_USER:-default}'", "password": "'$REDIS_SERVER_PWD'" }' +else + REDIS_CLUSTER='' +fi + export NODE_CONFIG='{ "statsd": { "useMetrics": '${METRICS_ENABLED:-false}', @@ -49,6 +64,7 @@ export NODE_CONFIG='{ "password": "'${REDIS_SERVER_PWD}'", "db": "'${REDIS_SERVER_DB_NUM:-0}'" }, + "optionsCluster": { '${REDIS_CLUSTER}' }, "iooptions": { "sentinels": [ { diff --git a/proxy-docker-entrypoint.sh b/proxy-docker-entrypoint.sh index 600d724..c6e2382 100755 --- a/proxy-docker-entrypoint.sh +++ b/proxy-docker-entrypoint.sh @@ -12,6 +12,7 @@ fi envsubst < /tmp/proxy_nginx/includes/http-upstream.conf > /tmp/http-upstream.conf envsubst < /etc/nginx/includes/ds-common.conf | tee /tmp/proxy_nginx/includes/ds-common.conf > /dev/null sed "s,\(set \+\$secure_link_secret\).*,\1 "${SECURE_LINK_SECRET:-verysecretstring}";," -i /tmp/proxy_nginx/conf.d/ds.conf +sed "s/\(client_max_body_size\).*/\1 $NGINX_CLIENT_MAX_BODY_SIZE;/" -i /tmp/proxy_nginx/includes/ds-common.conf if [[ ! -f "/proc/net/if_inet6" ]]; then sed '/listen\s\+\[::[0-9]*\].\+/d' -i /tmp/proxy_nginx/conf.d/ds.conf fi