From dc099c3eb17d8ee4c9f5070b38d37f944961addd Mon Sep 17 00:00:00 2001 From: Valeria Bagisheva Date: Mon, 13 May 2024 17:01:07 +0300 Subject: [PATCH 1/3] Separate dashboards location --- config/nginx/includes/dashboards.conf | 12 ++++++++++++ config/nginx/onlyoffice.conf | 13 +------------ install/docker/Dockerfile.app | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 config/nginx/includes/dashboards.conf diff --git a/config/nginx/includes/dashboards.conf b/config/nginx/includes/dashboards.conf new file mode 100644 index 00000000000..7fe285a31e1 --- /dev/null +++ b/config/nginx/includes/dashboards.conf @@ -0,0 +1,12 @@ +location ^~ /dashboards/ { + auth_basic "Restricted Access"; + auth_basic_user_file /etc/nginx/.htpasswd_dashboards; + + rewrite ^/dashboards(/.*)$ $1 break; + proxy_pass http://127.0.0.1:5601; + proxy_redirect off; + proxy_buffering off; + + proxy_set_header Connection "Keep-Alive"; + proxy_set_header Proxy-Connection "Keep-Alive"; +} \ No newline at end of file diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 75dd2170936..161fb0d4143 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -157,18 +157,7 @@ server { } - location ^~ /dashboards/ { - auth_basic "Restricted Access"; - auth_basic_user_file /etc/nginx/.htpasswd_dashboards; - - rewrite ^/dashboards(/.*)$ $1 break; - proxy_pass http://127.0.0.1:5601; - proxy_redirect off; - proxy_buffering off; - - proxy_set_header Connection "Keep-Alive"; - proxy_set_header Proxy-Connection "Keep-Alive"; - } + include /etc/nginx/includes/dashboards*.conf; location / { proxy_pass http://127.0.0.1:5001; diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index 5e0d49bf2dd..085c33ca4a9 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -52,7 +52,7 @@ RUN cd ${SRC_PATH} && \ cd ${SRC_PATH} && \ cp buildtools/config/*.config /app/onlyoffice/config/ && \ mkdir -p /etc/nginx/conf.d && cp -f buildtools/config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \ - mkdir -p /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && \ + mkdir -p /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/dashboards.conf /etc/nginx/includes/ && \ sed -i "s/\"number\".*,/\"number\": \"${PRODUCT_VERSION}.${BUILD_NUMBER}\",/g" /app/onlyoffice/config/appsettings.json && \ sed -e 's/#//' -i /etc/nginx/conf.d/onlyoffice.conf && \ cd ${SRC_PATH}/buildtools/install/common/ && \ @@ -173,7 +173,7 @@ RUN sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice. if [[ -z "${SERVICE_CLIENT}" ]] ; then sed -i 's/127.0.0.1:5001/$service_client/' /etc/nginx/conf.d/onlyoffice.conf; fi && \ if [[ -z "${SERVICE_MANAGEMENT}" ]] ; then sed -i 's/127.0.0.1:5015/$service_management/' /etc/nginx/conf.d/onlyoffice.conf; fi && \ sed -i 's/127.0.0.1:5033/$service_healthchecks/' /etc/nginx/conf.d/onlyoffice.conf && \ - sed -i 's/127.0.0.1:5601/$dashboards_host:5601/' /etc/nginx/conf.d/onlyoffice.conf && \ + sed -i 's/127.0.0.1:5601/$dashboards_host:5601/' /etc/nginx/includes/dashboards.conf && \ sed -i 's/$public_root/\/var\/www\/public\//' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i 's/http:\/\/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i '/client_body_temp_path/ i \ \ \ \ $MAP_HASH_BUCKET_SIZE' /etc/nginx/nginx.conf.template && \ From 9f88fc61f0fa4ed1343c59c1403a3a646bb2f834 Mon Sep 17 00:00:00 2001 From: Valeria Bagisheva <104082183+lemmav@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:22:33 +0300 Subject: [PATCH 2/3] Brush up some spaces --- config/nginx/includes/dashboards.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nginx/includes/dashboards.conf b/config/nginx/includes/dashboards.conf index 7fe285a31e1..f338271b030 100644 --- a/config/nginx/includes/dashboards.conf +++ b/config/nginx/includes/dashboards.conf @@ -9,4 +9,4 @@ location ^~ /dashboards/ { proxy_set_header Connection "Keep-Alive"; proxy_set_header Proxy-Connection "Keep-Alive"; -} \ No newline at end of file +} From 58f8ef4d274afd68c1cc29af15135cd9bdc6db67 Mon Sep 17 00:00:00 2001 From: Valeria Bagisheva Date: Wed, 26 Jun 2024 00:11:03 +0300 Subject: [PATCH 3/3] Rename dashboards and mentionings to server-dashboards --- .../includes/{dashboards.conf => server-dashboards.conf} | 0 config/nginx/onlyoffice.conf | 2 +- install/docker/Dockerfile.app | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename config/nginx/includes/{dashboards.conf => server-dashboards.conf} (100%) diff --git a/config/nginx/includes/dashboards.conf b/config/nginx/includes/server-dashboards.conf similarity index 100% rename from config/nginx/includes/dashboards.conf rename to config/nginx/includes/server-dashboards.conf diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 161fb0d4143..437c2ceb037 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -157,7 +157,7 @@ server { } - include /etc/nginx/includes/dashboards*.conf; + include /etc/nginx/includes/server-*.conf; location / { proxy_pass http://127.0.0.1:5001; diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index 085c33ca4a9..139f6519818 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -52,7 +52,7 @@ RUN cd ${SRC_PATH} && \ cd ${SRC_PATH} && \ cp buildtools/config/*.config /app/onlyoffice/config/ && \ mkdir -p /etc/nginx/conf.d && cp -f buildtools/config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \ - mkdir -p /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/dashboards.conf /etc/nginx/includes/ && \ + mkdir -p /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/server-*.conf /etc/nginx/includes/ && \ sed -i "s/\"number\".*,/\"number\": \"${PRODUCT_VERSION}.${BUILD_NUMBER}\",/g" /app/onlyoffice/config/appsettings.json && \ sed -e 's/#//' -i /etc/nginx/conf.d/onlyoffice.conf && \ cd ${SRC_PATH}/buildtools/install/common/ && \ @@ -173,7 +173,7 @@ RUN sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice. if [[ -z "${SERVICE_CLIENT}" ]] ; then sed -i 's/127.0.0.1:5001/$service_client/' /etc/nginx/conf.d/onlyoffice.conf; fi && \ if [[ -z "${SERVICE_MANAGEMENT}" ]] ; then sed -i 's/127.0.0.1:5015/$service_management/' /etc/nginx/conf.d/onlyoffice.conf; fi && \ sed -i 's/127.0.0.1:5033/$service_healthchecks/' /etc/nginx/conf.d/onlyoffice.conf && \ - sed -i 's/127.0.0.1:5601/$dashboards_host:5601/' /etc/nginx/includes/dashboards.conf && \ + sed -i 's/127.0.0.1:5601/$dashboards_host:5601/' /etc/nginx/includes/server-dashboards.conf && \ sed -i 's/$public_root/\/var\/www\/public\//' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i 's/http:\/\/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i '/client_body_temp_path/ i \ \ \ \ $MAP_HASH_BUCKET_SIZE' /etc/nginx/nginx.conf.template && \