From 02cbfa4fb412b88fb741b5394607cebce1819a16 Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Mon, 11 Nov 2024 08:33:45 +0000 Subject: [PATCH 1/4] Add the ability to connect to sentinel nodes with a password Co-authored-by: VyacheslavSemin Co-committed-by: VyacheslavSemin --- README.md | 1 + docker-entrypoint.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index d677407f..8b892a76 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,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_SENTINEL_PWD**: The password set for the Redis Sentinel nodes. Default to empty. - **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. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9e4acf24..54a3b005 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -73,6 +73,7 @@ export NODE_CONFIG='{ } ], "name": "'${REDIS_SENTINEL_GROUP_NAME:-mymaster}'", + "sentinelPassword": "'${REDIS_SENTINEL_PWD}'", "username": "'${REDIS_SERVER_USER:-default}'", "password": "'${REDIS_SERVER_PWD}'", "db": "'${REDIS_SERVER_DB_NUM:-0}'" From f96fc47c503aa4619e47e63ceaf745ed2fd16109 Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Mon, 11 Nov 2024 11:42:17 +0300 Subject: [PATCH 2/4] Update dockerfile without plugins --- Dockerfile.noplugins | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.noplugins b/Dockerfile.noplugins index ef49c284..3741267d 100644 --- a/Dockerfile.noplugins +++ b/Dockerfile.noplugins @@ -5,6 +5,7 @@ LABEL maintainer Ascensio System SIA ARG COMPANY_NAME=onlyoffice ARG DS_VERSION_HASH ENV COMPANY_NAME=$COMPANY_NAME \ + APPLICATION_NAME=$COMPANY_NAME \ DS_VERSION_HASH=$DS_VERSION_HASH \ NODE_ENV=production-linux \ NODE_CONFIG_DIR=/etc/$COMPANY_NAME/documentserver @@ -211,7 +212,7 @@ RUN mkdir -p \ USER ds ENTRYPOINT dumb-init docker-entrypoint.sh /var/www/$COMPANY_NAME/documentserver/server/FileConverter/converter -FROM node:alpine3.19 AS example +FROM node:20-alpine3.19 AS example LABEL maintainer Ascensio System SIA ENV LANG=en_US.UTF-8 \ From a70d1a4fbfdfb1b63fd107292d2f98650ef2fe0a Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Mon, 11 Nov 2024 11:46:23 +0300 Subject: [PATCH 3/4] Replace the version with v8.2.1 --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 474c9361..81bc13e4 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=-8.2.0 +RELEASE_VERSION=-8.2.1 # The hash that will be appended to the ONLYOFFICE Docs version in the request URLs DS_VERSION_HASH=1 From 2d5e9c1cda551e1c99063835ce97625a28090981 Mon Sep 17 00:00:00 2001 From: VyacheslavSemin Date: Tue, 12 Nov 2024 08:11:50 +0000 Subject: [PATCH 4/4] Add the ability to set up nginx log format Co-authored-by: VyacheslavSemin Co-committed-by: VyacheslavSemin --- config/nginx/nginx.conf | 4 +--- proxy-docker-entrypoint.sh | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf index 9c336c2c..9e2e3c6a 100644 --- a/config/nginx/nginx.conf +++ b/config/nginx/nginx.conf @@ -10,9 +10,7 @@ events { } http { - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log off; diff --git a/proxy-docker-entrypoint.sh b/proxy-docker-entrypoint.sh index 4efdc8c7..7fe8cf97 100755 --- a/proxy-docker-entrypoint.sh +++ b/proxy-docker-entrypoint.sh @@ -7,6 +7,9 @@ fi cp -r /etc/nginx/* /tmp/proxy_nginx/ sed 's|\(worker_connections\) [[:digit:]]*;|\1 '$NGINX_WORKER_CONNECTIONS';|g' -i /tmp/proxy_nginx/nginx.conf sed "s/\(worker_processes\).*/\1 $NGINX_WORKER_PROCESSES;/" -i /tmp/proxy_nginx/nginx.conf +if [[ -n "$NGINX_LOG_FORMAT" ]]; then + sed "s/\(log_format main\).*/\1 '$NGINX_LOG_FORMAT';/" -i /tmp/proxy_nginx/nginx.conf +fi if [ $NGINX_ACCESS_LOG != "off" ]; then sed 's|#*\(\s*access_log\).*;|\1 /var/log/nginx/access.log '$NGINX_ACCESS_LOG';|g' -i /tmp/proxy_nginx/nginx.conf fi