From 6f3828a5739538e118fad0718a84484e89d7b150 Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 17 May 2022 15:02:35 +0300 Subject: [PATCH 01/36] Add nginx config link for maintains --- deb/template/package.links.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deb/template/package.links.m4 b/deb/template/package.links.m4 index 34f0184c..9df76667 100644 --- a/deb/template/package.links.m4 +++ b/deb/template/package.links.m4 @@ -1,5 +1,6 @@ etc/M4_DS_PREFIX/logrotate/ds.conf etc/logrotate.d/ds.conf +etc/M4_DS_PREFIX/nginx/includes/ds-0maintains.conf etc/nginx/includes/ds-0maintains.conf etc/M4_DS_PREFIX/nginx/includes/ds-common.conf etc/nginx/includes/ds-common.conf etc/M4_DS_PREFIX/nginx/includes/ds-docservice.conf etc/nginx/includes/ds-docservice.conf etc/M4_DS_PREFIX/nginx/includes/ds-letsencrypt.conf etc/nginx/includes/ds-letsencrypt.conf @@ -29,4 +30,4 @@ etc/M4_DS_PREFIX-example/nginx/includes/ds-example.conf etc/nginx/includes/ds-ex etc/M4_DS_PREFIX-example/supervisor/ds-example.conf etc/supervisor/conf.d/ds-example.conf etc/M4_DS_PREFIX-example/supervisor/ds.conf etc/supervisor/conf.d/ds.conf , -etc/M4_DS_PREFIX/supervisor/ds.conf etc/supervisor/conf.d/ds.conf) \ No newline at end of file +etc/M4_DS_PREFIX/supervisor/ds.conf etc/supervisor/conf.d/ds.conf) From d842dfb7d30fe4739fd725e4d2ea608857c70acc Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 17 May 2022 15:02:57 +0300 Subject: [PATCH 02/36] Add maintains page --- .../welcome/css/favicon.ico | Bin 0 -> 466 bytes .../welcome/css/footer_github.svg | 11 + .../welcome/css/footer_help.svg | 24 ++ .../welcome/css/logo.svg | 15 ++ .../welcome/css/stylesheet.css | 222 ++++++++++++++++++ .../welcome/maintains.html | 104 ++++++++ 6 files changed, 376 insertions(+) create mode 100644 common/documentserver-maintains/welcome/css/favicon.ico create mode 100644 common/documentserver-maintains/welcome/css/footer_github.svg create mode 100644 common/documentserver-maintains/welcome/css/footer_help.svg create mode 100644 common/documentserver-maintains/welcome/css/logo.svg create mode 100644 common/documentserver-maintains/welcome/css/stylesheet.css create mode 100644 common/documentserver-maintains/welcome/maintains.html diff --git a/common/documentserver-maintains/welcome/css/favicon.ico b/common/documentserver-maintains/welcome/css/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..25436dc60c20ba5623d29882b1d3a6d11bd184e1 GIT binary patch literal 466 zcmV;@0WJQCP)soG69!yQ z%^xuQ|7{8O*W^7WFfaUr2F`?k(z{>$XJp9*vO}SoS26zoGnwhBs}$4%52yua85bP( z0|jCn)C=lR4Of785)iM3^24C=T2THCAf5=six}Ue8Swxa{{I=7&L2)Ohk3yjhZlCS z{`xz`V&NGHMuvaFK>jqwcX)11fPH8p>;+{Aj2~86^3M;B@e*D-AiJxI?|*hQkXW7xqJA1CkP% zcms0RRC803B*@79{>i&;S4c07*qo IM6N<$g11w^8UO$Q literal 0 HcmV?d00001 diff --git a/common/documentserver-maintains/welcome/css/footer_github.svg b/common/documentserver-maintains/welcome/css/footer_github.svg new file mode 100644 index 00000000..f52a2487 --- /dev/null +++ b/common/documentserver-maintains/welcome/css/footer_github.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/common/documentserver-maintains/welcome/css/footer_help.svg b/common/documentserver-maintains/welcome/css/footer_help.svg new file mode 100644 index 00000000..3bbbc6d3 --- /dev/null +++ b/common/documentserver-maintains/welcome/css/footer_help.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/documentserver-maintains/welcome/css/logo.svg b/common/documentserver-maintains/welcome/css/logo.svg new file mode 100644 index 00000000..86d2aa29 --- /dev/null +++ b/common/documentserver-maintains/welcome/css/logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/common/documentserver-maintains/welcome/css/stylesheet.css b/common/documentserver-maintains/welcome/css/stylesheet.css new file mode 100644 index 00000000..6fa50c2b --- /dev/null +++ b/common/documentserver-maintains/welcome/css/stylesheet.css @@ -0,0 +1,222 @@ +/** + * + * (c) Copyright Ascensio System SIA 2021 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + html { + height: 100%; + width: 100%; +} + +body { + background: #fff; + color: #333333; + font-family: 'Open Sans', sans-serif; + font-size: 12px; + font-weight: normal; + height: 100%; + margin: 0; + padding: 0; + text-decoration: none; +} + +div { + margin: 0; + padding: 0; +} + +a, a:hover, a:visited { + color: #FF6F3D; +} + +a:hover { + text-decoration: none; +} + +.black-block { + background: #333333; + color: #FFFFFF; +} + +.black-block .content-block { + background-image: url(../css/footer_help.svg), url(../css/footer_github.svg); + background-position: 0 64px, 100% 100px; + background-repeat: no-repeat; + box-sizing: border-box; + padding-left: 96px; +} + +.black-block p { + color: #C4C4C4; + max-width: 736px; +} + +.button { + background: #FF6F3D; + border-radius: 3px; + color: #FFFFFF; + display: inline-block; + font-weight: 600; + line-height: 133%; + letter-spacing: 0.04em; + margin-top: 24px; + padding: 16px 40px; + text-align: center; + text-transform: uppercase; +} + +.button:hover { + background: #ff7a4b; +} + +.content-block { + margin: 0 auto; + padding: 64px 0; + width: 1120px; +} + +.content-block p { + font-size: 16px; + line-height: 160%; + margin: 0; + padding-bottom: 24px; +} + +.content-block pre~p { + margin-top: 24px; +} + +.content-block p.p-small { + font-size: 14px; +} + +.features-list{ + font-size: 14px; +} + +h1, h2, h3, h6 { + margin: 0; + padding: 0; +} + +h1 { + font-weight: 700; + font-size: 24px; + letter-spacing: -0.02em; + line-height: 133%; + padding-bottom: 24px; +} + +h2 { + font-weight: 700; + font-size: 18px; + line-height: 133%; + letter-spacing: -0.02em; + padding-bottom: 16px; +} + +h3 { + font-weight: 700; + font-size: 14px; + line-height: 133%; +} + +h6 { + font-weight: normal; + font-size: 18px; + line-height: 160%; +} + +header { + background: #333333; + height: 48px; + margin: 0 auto; + width: auto; +} + +header img { + margin: 10px 0 22px 32px; +} + +.gray-block { + background: #F5F5F5; +} + +.gray-block .content-block { + padding-bottom: 56px; +} + +.links-block { + font-size: 14px; + font-weight: 600; + padding: 8px 0; +} + +.links-block a { + font-size: 14px; + font-weight: normal; + line-height: 160%; + margin: 0 6px 0 2px; +} + +.links-block a:first-child { + margin-left: 0; +} + +.orange-text { + color: #FF6F3D; +} + +pre { + border: 1px solid #666666; + background-color: #F9F9F9; + border-radius: 3px; + color: #666666; + display: block; + font-family: 'Open Sans', Monaco, Andale Mono, Courier New, monospace; + font-weight: normal; + font-size: 14px; + line-height: 160%; + margin: 8px 0 0; + padding: 16px; + white-space: pre-wrap; + word-wrap: break-word; +} + +pre~h3 { + padding-top: 40px; +} + +footer { + color: #AAAAAA; + font-size: 13px; + line-height: 160%; + margin: 0; + padding: 0; + width: auto; +} + +@media screen and (max-width: 1199px) { + .black-block p { + width: 55vw; + } + .content-block { + width: 90.6vw; + } + header img { + margin-left: 4.8vw; + } +} diff --git a/common/documentserver-maintains/welcome/maintains.html b/common/documentserver-maintains/welcome/maintains.html new file mode 100644 index 00000000..47454143 --- /dev/null +++ b/common/documentserver-maintains/welcome/maintains.html @@ -0,0 +1,104 @@ + + + + + + + + + ONLYOFFICE Docs Community Edition + + + + + + + + + +
+ + ONLYOFFICE + +
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+ +
+
+

+

+

+

+

+

+

+

+

+

+

DocumentServer is setting up. Please wait couple of minutes

+

+

+

+

+

+

+

+

+

+ +
+
+ +
+
+

Getting help

+

+ For free Community version, create issues on GitHub or use our forum. +
+ For commercial versions, contact us here. +

+

ONLYOFFICE Docs editions

+

Want to know what else we’ve got? + Compare editions +

+
© Ascensio Systems SIA 2021. All rights reserved.
+
+
+ + + From 3a6ac0fc1b2909ecfa30fd239d61572c46fe122e Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 17 May 2022 15:04:02 +0300 Subject: [PATCH 03/36] Run healthcheck and rm maintains script --- deb/template/postinst.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deb/template/postinst.m4 b/deb/template/postinst.m4 index 112cfebf..2345ff96 100644 --- a/deb/template/postinst.m4 +++ b/deb/template/postinst.m4 @@ -23,6 +23,7 @@ DIR="/var/www/M4_DS_PREFIX" LOG_DIR="/var/log/M4_DS_PREFIX" APP_DIR="/var/lib/M4_DS_PREFIX" CONF_DIR="/etc/M4_DS_PREFIX" +NGINX_INCLUDES="/etc/nginx/includes" LOCAL_CONFIG=${CONF_DIR}/local.json EXAMPLE_CONFIG=${CONF_DIR}-example/local.json JSON_BIN="$DIR/npm/json" @@ -253,7 +254,8 @@ setup_nginx(){ # sed 's/{{EXAMPLE_PORT}}/'${EXAMPLE_PORT}'/' -i $OO_CONF rm -f /etc/nginx/sites-enabled/default - + + service nginx restart >/dev/null 2>&1 } case "$1" in @@ -309,9 +311,11 @@ ifelse(eval(ifelse(M4_PRODUCT_NAME,documentserver-ee,1,0)||ifelse(M4_PRODUCT_NAM # call db_stop to prevent installation hang db_stop - # restart dependent services + # restart supervisor service supervisor restart >/dev/null 2>&1 - service nginx restart >/dev/null 2>&1 + + # pass healthcheck and then restart nginx + documentserver-wait-config.sh true echo "Congratulations, the M4_COMPANY_NAME M4_PRODUCT_NAME has been installed successfully!" ;; From 8a6ad03973c087735f44411f78fc3b4cfdccca4e Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 17 May 2022 15:04:34 +0300 Subject: [PATCH 04/36] Add ds healthcheck script --- .../bin/documentserver-wait-config.sh.m4 | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 common/documentserver/bin/documentserver-wait-config.sh.m4 diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 new file mode 100644 index 00000000..9b15af35 --- /dev/null +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -0,0 +1,37 @@ +#!/bin/bash + +Timeout=240 # 4 minutes + +function timeout_monitor() { + sleep "$Timeout" + echo "Timeout: healthcheck didn't passed" + rm -f ${NGINX_INCLUDES}ds-0maintains.conf + service nginx reload >/dev/null 2>&1 + kill "$1" +} + +# start the timeout monitor in +# background and pass the PID: +timeout_monitor "$$" & +Timeout_monitor_pid=$! + +NGINX_INCLUDES="/etc/nginx/includes/" +SERVER_URL=http://localhost:8000/healthcheck + +echo "DocumentServer is starting up, please wait ..." + +while [ "$STATUS" != "200" ] +do + STATUS=$(curl -s -o /dev/null -w "%{http_code}\n" $SERVER_URL) + sleep 10 +done +echo "Healthcheck passed, DocumentServer is up and ready" + + # back nginx config links to default condition + rm -f ${NGINX_INCLUDES}ds-0maintains.conf + service nginx reload >/dev/null 2>&1 + + # kill timeout monitor when terminating: + kill "$Timeout_monitor_pid" + +exit 0 From c1eabe973c9fc7270ca9db6095e3e898ab479f41 Mon Sep 17 00:00:00 2001 From: danilapog Date: Tue, 17 May 2022 15:04:58 +0300 Subject: [PATCH 05/36] Add nginx config for maintains --- common/documentserver/nginx/includes/ds-0maintains.conf.m4 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 common/documentserver/nginx/includes/ds-0maintains.conf.m4 diff --git a/common/documentserver/nginx/includes/ds-0maintains.conf.m4 b/common/documentserver/nginx/includes/ds-0maintains.conf.m4 new file mode 100644 index 00000000..e67e3e12 --- /dev/null +++ b/common/documentserver/nginx/includes/ds-0maintains.conf.m4 @@ -0,0 +1,5 @@ +location ~ ^(\/welcome\/.*)$ { + expires 365d; + alias /var/www/onlyoffice/documentserver-maintainer/$1; + index maintains.html; +} From 039eaf757f713e14a1cd37493194b41a76d92a37 Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 11:28:54 +0300 Subject: [PATCH 06/36] Add force timeout --- .../bin/documentserver-wait-config.sh.m4 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 index 9b15af35..bc210c08 100644 --- a/common/documentserver/bin/documentserver-wait-config.sh.m4 +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -1,10 +1,10 @@ #!/bin/bash -Timeout=240 # 4 minutes +Timeout=300 # 5 minutes function timeout_monitor() { sleep "$Timeout" - echo "Timeout: healthcheck didn't passed" + echo "Timeout: healthcheck didn't passed" rm -f ${NGINX_INCLUDES}ds-0maintains.conf service nginx reload >/dev/null 2>&1 kill "$1" @@ -17,20 +17,22 @@ Timeout_monitor_pid=$! NGINX_INCLUDES="/etc/nginx/includes/" SERVER_URL=http://localhost:8000/healthcheck +TIMER=5 -echo "DocumentServer is starting up, please wait ..." +echo "DocumentServer starting up, please wait while health check passes..." -while [ "$STATUS" != "200" ] +while [ $TIMER -ne 230 ] && [ "$STATUS" != "200" ] do STATUS=$(curl -s -o /dev/null -w "%{http_code}\n" $SERVER_URL) - sleep 10 + TIMER=$(( $TIMER + 5 )) + sleep 5 done echo "Healthcheck passed, DocumentServer is up and ready" # back nginx config links to default condition rm -f ${NGINX_INCLUDES}ds-0maintains.conf service nginx reload >/dev/null 2>&1 - + # kill timeout monitor when terminating: kill "$Timeout_monitor_pid" From df79ca4d1f496ceca2486ad9d05af9fb3b2dbb07 Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 13:36:44 +0300 Subject: [PATCH 07/36] Cosmetic changes --- common/documentserver/bin/documentserver-wait-config.sh.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 index bc210c08..ff1db3a1 100644 --- a/common/documentserver/bin/documentserver-wait-config.sh.m4 +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -2,6 +2,8 @@ Timeout=300 # 5 minutes +# this block will be activated after 5 minutes +# only if main script didn't exit with 0. function timeout_monitor() { sleep "$Timeout" echo "Timeout: healthcheck didn't passed" From 269820fe8add8dc803194d0a946e605aeabcdfcf Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 18:58:49 +0300 Subject: [PATCH 08/36] Cosmetic changes --- .../welcome/{maintains.html => maintenance.html} | 2 +- common/documentserver/bin/documentserver-wait-config.sh.m4 | 4 ++-- common/documentserver/nginx/includes/ds-0maintains.conf.m4 | 5 ----- common/documentserver/nginx/includes/ds-0maintenance.conf.m4 | 5 +++++ deb/template/package.links.m4 | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename common/documentserver-maintains/welcome/{maintains.html => maintenance.html} (99%) delete mode 100644 common/documentserver/nginx/includes/ds-0maintains.conf.m4 create mode 100644 common/documentserver/nginx/includes/ds-0maintenance.conf.m4 diff --git a/common/documentserver-maintains/welcome/maintains.html b/common/documentserver-maintains/welcome/maintenance.html similarity index 99% rename from common/documentserver-maintains/welcome/maintains.html rename to common/documentserver-maintains/welcome/maintenance.html index 47454143..2ae6793e 100644 --- a/common/documentserver-maintains/welcome/maintains.html +++ b/common/documentserver-maintains/welcome/maintenance.html @@ -1,5 +1,5 @@ - + diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 index ff1db3a1..7be6fe3d 100644 --- a/common/documentserver/bin/documentserver-wait-config.sh.m4 +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -7,7 +7,7 @@ Timeout=300 # 5 minutes function timeout_monitor() { sleep "$Timeout" echo "Timeout: healthcheck didn't passed" - rm -f ${NGINX_INCLUDES}ds-0maintains.conf + rm -f ${NGINX_INCLUDES}ds-0maintenance.conf service nginx reload >/dev/null 2>&1 kill "$1" } @@ -32,7 +32,7 @@ done echo "Healthcheck passed, DocumentServer is up and ready" # back nginx config links to default condition - rm -f ${NGINX_INCLUDES}ds-0maintains.conf + rm -f ${NGINX_INCLUDES}ds-0maintenance.conf service nginx reload >/dev/null 2>&1 # kill timeout monitor when terminating: diff --git a/common/documentserver/nginx/includes/ds-0maintains.conf.m4 b/common/documentserver/nginx/includes/ds-0maintains.conf.m4 deleted file mode 100644 index e67e3e12..00000000 --- a/common/documentserver/nginx/includes/ds-0maintains.conf.m4 +++ /dev/null @@ -1,5 +0,0 @@ -location ~ ^(\/welcome\/.*)$ { - expires 365d; - alias /var/www/onlyoffice/documentserver-maintainer/$1; - index maintains.html; -} diff --git a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 new file mode 100644 index 00000000..9f59a6dc --- /dev/null +++ b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 @@ -0,0 +1,5 @@ +location ~ ^(\/welcome\/.*)$ { + expires 365d; + alias /var/www/onlyoffice/documentserver/home/$1; + index maintenance.html; +} diff --git a/deb/template/package.links.m4 b/deb/template/package.links.m4 index 9df76667..eb4bbc18 100644 --- a/deb/template/package.links.m4 +++ b/deb/template/package.links.m4 @@ -1,6 +1,6 @@ etc/M4_DS_PREFIX/logrotate/ds.conf etc/logrotate.d/ds.conf -etc/M4_DS_PREFIX/nginx/includes/ds-0maintains.conf etc/nginx/includes/ds-0maintains.conf +etc/M4_DS_PREFIX/nginx/includes/ds-0maintenance.conf etc/nginx/includes/ds-0maintenance.conf etc/M4_DS_PREFIX/nginx/includes/ds-common.conf etc/nginx/includes/ds-common.conf etc/M4_DS_PREFIX/nginx/includes/ds-docservice.conf etc/nginx/includes/ds-docservice.conf etc/M4_DS_PREFIX/nginx/includes/ds-letsencrypt.conf etc/nginx/includes/ds-letsencrypt.conf From 186af589921b67b7bc3078d71a1473cd8c4fab06 Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 19:07:38 +0300 Subject: [PATCH 09/36] Refactoring code --- .../bin/documentserver-wait-config.sh.m4 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 index 7be6fe3d..19b1b0eb 100644 --- a/common/documentserver/bin/documentserver-wait-config.sh.m4 +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -1,6 +1,6 @@ #!/bin/bash -Timeout=300 # 5 minutes +Timeout=300 # Seconds # this block will be activated after 5 minutes # only if main script didn't exit with 0. @@ -19,17 +19,16 @@ Timeout_monitor_pid=$! NGINX_INCLUDES="/etc/nginx/includes/" SERVER_URL=http://localhost:8000/healthcheck -TIMER=5 +COUNT=5 -echo "DocumentServer starting up, please wait while health check passes..." +echo "DocumentServer starting up, please wait ..." -while [ $TIMER -ne 230 ] && [ "$STATUS" != "200" ] +while [ $COUNT != 230 ] && [ "$STATUS" != "200" ] do STATUS=$(curl -s -o /dev/null -w "%{http_code}\n" $SERVER_URL) - TIMER=$(( $TIMER + 5 )) + COUNT=$(( $COUNT + 5 )) sleep 5 done -echo "Healthcheck passed, DocumentServer is up and ready" # back nginx config links to default condition rm -f ${NGINX_INCLUDES}ds-0maintenance.conf From cf9cd593c0492281bd8c4723677d1d6558d99a5a Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 19:14:09 +0300 Subject: [PATCH 10/36] Delete /home dir from ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e5c3db29..042fff4f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ common/documentserver*/**/*.conf common/documentserver*/nginx/*.tmpl /common/documentserver/bin/*.sh common/documentserver/config -common/documentserver/home +#common/documentserver/home common/documentserver-example/config common/documentserver-example/home common/fonts From 00a56caa28ccfd6e15d4032805557f949fbfcb80 Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 19:14:29 +0300 Subject: [PATCH 11/36] Add maintenance dir --- .../home/welcome/css/favicon.ico | Bin 0 -> 466 bytes .../home/welcome/css/footer_github.svg | 11 + .../home/welcome/css/footer_help.svg | 24 ++ .../documentserver/home/welcome/css/logo.svg | 15 ++ .../home/welcome/css/stylesheet.css | 222 ++++++++++++++++++ .../home/welcome/maintenance.html | 103 ++++++++ 6 files changed, 375 insertions(+) create mode 100644 common/documentserver/home/welcome/css/favicon.ico create mode 100644 common/documentserver/home/welcome/css/footer_github.svg create mode 100644 common/documentserver/home/welcome/css/footer_help.svg create mode 100644 common/documentserver/home/welcome/css/logo.svg create mode 100644 common/documentserver/home/welcome/css/stylesheet.css create mode 100644 common/documentserver/home/welcome/maintenance.html diff --git a/common/documentserver/home/welcome/css/favicon.ico b/common/documentserver/home/welcome/css/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..25436dc60c20ba5623d29882b1d3a6d11bd184e1 GIT binary patch literal 466 zcmV;@0WJQCP)soG69!yQ z%^xuQ|7{8O*W^7WFfaUr2F`?k(z{>$XJp9*vO}SoS26zoGnwhBs}$4%52yua85bP( z0|jCn)C=lR4Of785)iM3^24C=T2THCAf5=six}Ue8Swxa{{I=7&L2)Ohk3yjhZlCS z{`xz`V&NGHMuvaFK>jqwcX)11fPH8p>;+{Aj2~86^3M;B@e*D-AiJxI?|*hQkXW7xqJA1CkP% zcms0RRC803B*@79{>i&;S4c07*qo IM6N<$g11w^8UO$Q literal 0 HcmV?d00001 diff --git a/common/documentserver/home/welcome/css/footer_github.svg b/common/documentserver/home/welcome/css/footer_github.svg new file mode 100644 index 00000000..f52a2487 --- /dev/null +++ b/common/documentserver/home/welcome/css/footer_github.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/common/documentserver/home/welcome/css/footer_help.svg b/common/documentserver/home/welcome/css/footer_help.svg new file mode 100644 index 00000000..3bbbc6d3 --- /dev/null +++ b/common/documentserver/home/welcome/css/footer_help.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/documentserver/home/welcome/css/logo.svg b/common/documentserver/home/welcome/css/logo.svg new file mode 100644 index 00000000..86d2aa29 --- /dev/null +++ b/common/documentserver/home/welcome/css/logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/common/documentserver/home/welcome/css/stylesheet.css b/common/documentserver/home/welcome/css/stylesheet.css new file mode 100644 index 00000000..6fa50c2b --- /dev/null +++ b/common/documentserver/home/welcome/css/stylesheet.css @@ -0,0 +1,222 @@ +/** + * + * (c) Copyright Ascensio System SIA 2021 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + html { + height: 100%; + width: 100%; +} + +body { + background: #fff; + color: #333333; + font-family: 'Open Sans', sans-serif; + font-size: 12px; + font-weight: normal; + height: 100%; + margin: 0; + padding: 0; + text-decoration: none; +} + +div { + margin: 0; + padding: 0; +} + +a, a:hover, a:visited { + color: #FF6F3D; +} + +a:hover { + text-decoration: none; +} + +.black-block { + background: #333333; + color: #FFFFFF; +} + +.black-block .content-block { + background-image: url(../css/footer_help.svg), url(../css/footer_github.svg); + background-position: 0 64px, 100% 100px; + background-repeat: no-repeat; + box-sizing: border-box; + padding-left: 96px; +} + +.black-block p { + color: #C4C4C4; + max-width: 736px; +} + +.button { + background: #FF6F3D; + border-radius: 3px; + color: #FFFFFF; + display: inline-block; + font-weight: 600; + line-height: 133%; + letter-spacing: 0.04em; + margin-top: 24px; + padding: 16px 40px; + text-align: center; + text-transform: uppercase; +} + +.button:hover { + background: #ff7a4b; +} + +.content-block { + margin: 0 auto; + padding: 64px 0; + width: 1120px; +} + +.content-block p { + font-size: 16px; + line-height: 160%; + margin: 0; + padding-bottom: 24px; +} + +.content-block pre~p { + margin-top: 24px; +} + +.content-block p.p-small { + font-size: 14px; +} + +.features-list{ + font-size: 14px; +} + +h1, h2, h3, h6 { + margin: 0; + padding: 0; +} + +h1 { + font-weight: 700; + font-size: 24px; + letter-spacing: -0.02em; + line-height: 133%; + padding-bottom: 24px; +} + +h2 { + font-weight: 700; + font-size: 18px; + line-height: 133%; + letter-spacing: -0.02em; + padding-bottom: 16px; +} + +h3 { + font-weight: 700; + font-size: 14px; + line-height: 133%; +} + +h6 { + font-weight: normal; + font-size: 18px; + line-height: 160%; +} + +header { + background: #333333; + height: 48px; + margin: 0 auto; + width: auto; +} + +header img { + margin: 10px 0 22px 32px; +} + +.gray-block { + background: #F5F5F5; +} + +.gray-block .content-block { + padding-bottom: 56px; +} + +.links-block { + font-size: 14px; + font-weight: 600; + padding: 8px 0; +} + +.links-block a { + font-size: 14px; + font-weight: normal; + line-height: 160%; + margin: 0 6px 0 2px; +} + +.links-block a:first-child { + margin-left: 0; +} + +.orange-text { + color: #FF6F3D; +} + +pre { + border: 1px solid #666666; + background-color: #F9F9F9; + border-radius: 3px; + color: #666666; + display: block; + font-family: 'Open Sans', Monaco, Andale Mono, Courier New, monospace; + font-weight: normal; + font-size: 14px; + line-height: 160%; + margin: 8px 0 0; + padding: 16px; + white-space: pre-wrap; + word-wrap: break-word; +} + +pre~h3 { + padding-top: 40px; +} + +footer { + color: #AAAAAA; + font-size: 13px; + line-height: 160%; + margin: 0; + padding: 0; + width: auto; +} + +@media screen and (max-width: 1199px) { + .black-block p { + width: 55vw; + } + .content-block { + width: 90.6vw; + } + header img { + margin-left: 4.8vw; + } +} diff --git a/common/documentserver/home/welcome/maintenance.html b/common/documentserver/home/welcome/maintenance.html new file mode 100644 index 00000000..357a1497 --- /dev/null +++ b/common/documentserver/home/welcome/maintenance.html @@ -0,0 +1,103 @@ + + + + + + + + + ONLYOFFICE Docs Community Edition + + + + + + + + + +
+ + ONLYOFFICE + +
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+ +
+
+

+

+

+

+

+

+

+

+

+

+

DocumentServer is setting up. Please wait couple of minutes

+

+

+

+

+

+

+

+

+

+ +
+
+ +
+
+

Getting help

+

+ For free Community version, create issues on GitHub or use our forum. +
+ For commercial versions, contact us here. +

+

ONLYOFFICE Docs editions

+

Want to know what else we’ve got? + Compare editions +

+
© Ascensio Systems SIA 2021. All rights reserved.
+
+
+ + From 084b9d24dab490d987056c93cef09fab7bf456fb Mon Sep 17 00:00:00 2001 From: danilapog Date: Wed, 18 May 2022 19:14:57 +0300 Subject: [PATCH 12/36] Remove old dir --- .../welcome/css/favicon.ico | Bin 466 -> 0 bytes .../welcome/css/footer_github.svg | 11 - .../welcome/css/footer_help.svg | 24 -- .../welcome/css/logo.svg | 15 -- .../welcome/css/stylesheet.css | 222 ------------------ .../welcome/maintenance.html | 104 -------- 6 files changed, 376 deletions(-) delete mode 100644 common/documentserver-maintains/welcome/css/favicon.ico delete mode 100644 common/documentserver-maintains/welcome/css/footer_github.svg delete mode 100644 common/documentserver-maintains/welcome/css/footer_help.svg delete mode 100644 common/documentserver-maintains/welcome/css/logo.svg delete mode 100644 common/documentserver-maintains/welcome/css/stylesheet.css delete mode 100644 common/documentserver-maintains/welcome/maintenance.html diff --git a/common/documentserver-maintains/welcome/css/favicon.ico b/common/documentserver-maintains/welcome/css/favicon.ico deleted file mode 100644 index 25436dc60c20ba5623d29882b1d3a6d11bd184e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 466 zcmV;@0WJQCP)soG69!yQ z%^xuQ|7{8O*W^7WFfaUr2F`?k(z{>$XJp9*vO}SoS26zoGnwhBs}$4%52yua85bP( z0|jCn)C=lR4Of785)iM3^24C=T2THCAf5=six}Ue8Swxa{{I=7&L2)Ohk3yjhZlCS z{`xz`V&NGHMuvaFK>jqwcX)11fPH8p>;+{Aj2~86^3M;B@e*D-AiJxI?|*hQkXW7xqJA1CkP% zcms0RRC803B*@79{>i&;S4c07*qo IM6N<$g11w^8UO$Q diff --git a/common/documentserver-maintains/welcome/css/footer_github.svg b/common/documentserver-maintains/welcome/css/footer_github.svg deleted file mode 100644 index f52a2487..00000000 --- a/common/documentserver-maintains/welcome/css/footer_github.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/common/documentserver-maintains/welcome/css/footer_help.svg b/common/documentserver-maintains/welcome/css/footer_help.svg deleted file mode 100644 index 3bbbc6d3..00000000 --- a/common/documentserver-maintains/welcome/css/footer_help.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/documentserver-maintains/welcome/css/logo.svg b/common/documentserver-maintains/welcome/css/logo.svg deleted file mode 100644 index 86d2aa29..00000000 --- a/common/documentserver-maintains/welcome/css/logo.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/common/documentserver-maintains/welcome/css/stylesheet.css b/common/documentserver-maintains/welcome/css/stylesheet.css deleted file mode 100644 index 6fa50c2b..00000000 --- a/common/documentserver-maintains/welcome/css/stylesheet.css +++ /dev/null @@ -1,222 +0,0 @@ -/** - * - * (c) Copyright Ascensio System SIA 2021 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - html { - height: 100%; - width: 100%; -} - -body { - background: #fff; - color: #333333; - font-family: 'Open Sans', sans-serif; - font-size: 12px; - font-weight: normal; - height: 100%; - margin: 0; - padding: 0; - text-decoration: none; -} - -div { - margin: 0; - padding: 0; -} - -a, a:hover, a:visited { - color: #FF6F3D; -} - -a:hover { - text-decoration: none; -} - -.black-block { - background: #333333; - color: #FFFFFF; -} - -.black-block .content-block { - background-image: url(../css/footer_help.svg), url(../css/footer_github.svg); - background-position: 0 64px, 100% 100px; - background-repeat: no-repeat; - box-sizing: border-box; - padding-left: 96px; -} - -.black-block p { - color: #C4C4C4; - max-width: 736px; -} - -.button { - background: #FF6F3D; - border-radius: 3px; - color: #FFFFFF; - display: inline-block; - font-weight: 600; - line-height: 133%; - letter-spacing: 0.04em; - margin-top: 24px; - padding: 16px 40px; - text-align: center; - text-transform: uppercase; -} - -.button:hover { - background: #ff7a4b; -} - -.content-block { - margin: 0 auto; - padding: 64px 0; - width: 1120px; -} - -.content-block p { - font-size: 16px; - line-height: 160%; - margin: 0; - padding-bottom: 24px; -} - -.content-block pre~p { - margin-top: 24px; -} - -.content-block p.p-small { - font-size: 14px; -} - -.features-list{ - font-size: 14px; -} - -h1, h2, h3, h6 { - margin: 0; - padding: 0; -} - -h1 { - font-weight: 700; - font-size: 24px; - letter-spacing: -0.02em; - line-height: 133%; - padding-bottom: 24px; -} - -h2 { - font-weight: 700; - font-size: 18px; - line-height: 133%; - letter-spacing: -0.02em; - padding-bottom: 16px; -} - -h3 { - font-weight: 700; - font-size: 14px; - line-height: 133%; -} - -h6 { - font-weight: normal; - font-size: 18px; - line-height: 160%; -} - -header { - background: #333333; - height: 48px; - margin: 0 auto; - width: auto; -} - -header img { - margin: 10px 0 22px 32px; -} - -.gray-block { - background: #F5F5F5; -} - -.gray-block .content-block { - padding-bottom: 56px; -} - -.links-block { - font-size: 14px; - font-weight: 600; - padding: 8px 0; -} - -.links-block a { - font-size: 14px; - font-weight: normal; - line-height: 160%; - margin: 0 6px 0 2px; -} - -.links-block a:first-child { - margin-left: 0; -} - -.orange-text { - color: #FF6F3D; -} - -pre { - border: 1px solid #666666; - background-color: #F9F9F9; - border-radius: 3px; - color: #666666; - display: block; - font-family: 'Open Sans', Monaco, Andale Mono, Courier New, monospace; - font-weight: normal; - font-size: 14px; - line-height: 160%; - margin: 8px 0 0; - padding: 16px; - white-space: pre-wrap; - word-wrap: break-word; -} - -pre~h3 { - padding-top: 40px; -} - -footer { - color: #AAAAAA; - font-size: 13px; - line-height: 160%; - margin: 0; - padding: 0; - width: auto; -} - -@media screen and (max-width: 1199px) { - .black-block p { - width: 55vw; - } - .content-block { - width: 90.6vw; - } - header img { - margin-left: 4.8vw; - } -} diff --git a/common/documentserver-maintains/welcome/maintenance.html b/common/documentserver-maintains/welcome/maintenance.html deleted file mode 100644 index 2ae6793e..00000000 --- a/common/documentserver-maintains/welcome/maintenance.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - ONLYOFFICE Docs Community Edition - - - - - - - - - -
- - ONLYOFFICE - -
-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

- -
-
-

-

-

-

-

-

-

-

-

-

-

DocumentServer is setting up. Please wait couple of minutes

-

-

-

-

-

-

-

-

-

- -
-
- -
-
-

Getting help

-

- For free Community version, create issues on GitHub or use our forum. -
- For commercial versions, contact us here. -

-

ONLYOFFICE Docs editions

-

Want to know what else we’ve got? - Compare editions -

-
© Ascensio Systems SIA 2021. All rights reserved.
-
-
- - - From a8c272030aea41bf22bc9637a26d7c49c5c1e359 Mon Sep 17 00:00:00 2001 From: danilapog Date: Thu, 19 May 2022 18:16:09 +0300 Subject: [PATCH 13/36] Add new directory --- .../home/{ => maintenance}/welcome/css/favicon.ico | Bin .../{ => maintenance}/welcome/css/footer_github.svg | 0 .../{ => maintenance}/welcome/css/footer_help.svg | 0 .../home/{ => maintenance}/welcome/css/logo.svg | 0 .../{ => maintenance}/welcome/css/stylesheet.css | 0 .../home/{ => maintenance}/welcome/maintenance.html | 0 .../nginx/includes/ds-0maintenance.conf.m4 | 2 +- 7 files changed, 1 insertion(+), 1 deletion(-) rename common/documentserver/home/{ => maintenance}/welcome/css/favicon.ico (100%) rename common/documentserver/home/{ => maintenance}/welcome/css/footer_github.svg (100%) rename common/documentserver/home/{ => maintenance}/welcome/css/footer_help.svg (100%) rename common/documentserver/home/{ => maintenance}/welcome/css/logo.svg (100%) rename common/documentserver/home/{ => maintenance}/welcome/css/stylesheet.css (100%) rename common/documentserver/home/{ => maintenance}/welcome/maintenance.html (100%) diff --git a/common/documentserver/home/welcome/css/favicon.ico b/common/documentserver/home/maintenance/welcome/css/favicon.ico similarity index 100% rename from common/documentserver/home/welcome/css/favicon.ico rename to common/documentserver/home/maintenance/welcome/css/favicon.ico diff --git a/common/documentserver/home/welcome/css/footer_github.svg b/common/documentserver/home/maintenance/welcome/css/footer_github.svg similarity index 100% rename from common/documentserver/home/welcome/css/footer_github.svg rename to common/documentserver/home/maintenance/welcome/css/footer_github.svg diff --git a/common/documentserver/home/welcome/css/footer_help.svg b/common/documentserver/home/maintenance/welcome/css/footer_help.svg similarity index 100% rename from common/documentserver/home/welcome/css/footer_help.svg rename to common/documentserver/home/maintenance/welcome/css/footer_help.svg diff --git a/common/documentserver/home/welcome/css/logo.svg b/common/documentserver/home/maintenance/welcome/css/logo.svg similarity index 100% rename from common/documentserver/home/welcome/css/logo.svg rename to common/documentserver/home/maintenance/welcome/css/logo.svg diff --git a/common/documentserver/home/welcome/css/stylesheet.css b/common/documentserver/home/maintenance/welcome/css/stylesheet.css similarity index 100% rename from common/documentserver/home/welcome/css/stylesheet.css rename to common/documentserver/home/maintenance/welcome/css/stylesheet.css diff --git a/common/documentserver/home/welcome/maintenance.html b/common/documentserver/home/maintenance/welcome/maintenance.html similarity index 100% rename from common/documentserver/home/welcome/maintenance.html rename to common/documentserver/home/maintenance/welcome/maintenance.html diff --git a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 index 9f59a6dc..baad0e68 100644 --- a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 +++ b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 @@ -1,5 +1,5 @@ location ~ ^(\/welcome\/.*)$ { expires 365d; - alias /var/www/onlyoffice/documentserver/home/$1; + alias /var/www/onlyoffice/documentserver/home/maintenance/$1; index maintenance.html; } From 126f15d9c8371a6d858b7110ee7575671ec7be9f Mon Sep 17 00:00:00 2001 From: danilapog Date: Fri, 20 May 2022 11:10:40 +0300 Subject: [PATCH 14/36] Add maintenance in rpm package --- rpm/common.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rpm/common.spec b/rpm/common.spec index d46632eb..b5754090 100644 --- a/rpm/common.spec +++ b/rpm/common.spec @@ -351,6 +351,9 @@ if systemctl is-active --quiet supervisord; then systemctl restart supervisord >/dev/null 2>&1 fi +# healthcheck and then reload nginx +documentserver-wait-config.sh true + if systemctl is-active --quiet nginx; then systemctl reload nginx >/dev/null 2>&1 fi From acc906b54487b4259c536cca41afa807bb225b29 Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 14:01:46 +0300 Subject: [PATCH 15/36] Add delete maintenance for windows --- .../bin/documentserver-wait-config.bat | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common/documentserver/bin/documentserver-wait-config.bat diff --git a/common/documentserver/bin/documentserver-wait-config.bat b/common/documentserver/bin/documentserver-wait-config.bat new file mode 100644 index 00000000..0e675bb5 --- /dev/null +++ b/common/documentserver/bin/documentserver-wait-config.bat @@ -0,0 +1,21 @@ +@echo off + +set "MAINTENANCE_NGINX_CONF=..\nginx\conf\includes\ds-0maintenance.conf" +set "SERVER_URL=http://localhost:8000/healthcheck" + +:loop + for /f "delims=" %%a in (' + curl -s -o nul -w "%%{http_code}" %SERVER_URL% + ') do set "status=%%a" + + if not "%status%"=="200" ( + echo Server not reachable... trying again... + ) else ( + echo Server reachable! Success! + del "%MAINTENANCE_NGINX_CONF%" + goto :continue + ) + timeout /t 5 /nobreak + goto :loop + +:continue From a7c9804fc360ad2016d2317c8a7ac270fff0caec Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 15:00:50 +0300 Subject: [PATCH 16/36] Add wait-configure script exec --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 1571ba8d..7f160569 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,7 @@ ifeq ($(OS),Windows_NT) DS_ROOT := .. DS_FILES := ../server DS_EXAMLE := ../example + DS_MAINTENANCE:= ../maintenance DEV_NULL := nul ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) ARCHITECTURE := 64 @@ -132,6 +133,7 @@ else DS_ROOT := /var/www/$(DS_PREFIX) DS_FILES := /var/lib/$(DS_PREFIX) DS_EXAMLE := /var/www/$(DS_PREFIX)-example + DS_MAINTENANCE:= ../var/www/onlyoffice/documentserver/maintenance DEV_NULL := /dev/null endif ifeq ($(UNAME_S),Darwin) From 6790e2ca5f23c363ddd33b10232ce18faf31de72 Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 15:03:02 +0300 Subject: [PATCH 17/36] Add m4 template in maintenance config --- common/documentserver/nginx/includes/ds-0maintenance.conf.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 index baad0e68..f5d041d5 100644 --- a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 +++ b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 @@ -1,5 +1,5 @@ location ~ ^(\/welcome\/.*)$ { expires 365d; - alias /var/www/onlyoffice/documentserver/home/maintenance/$1; + alias M4_DS_MAINTENANCE$1; index maintenance.html; } From fa6cb9e64aab0fff82c26aff62ea603fbf19156d Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 15:04:07 +0300 Subject: [PATCH 18/36] Add script launch --- exe/common.iss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exe/common.iss b/exe/common.iss index ccb99da0..75be5127 100644 --- a/exe/common.iss +++ b/exe/common.iss @@ -474,6 +474,8 @@ Filename: "{#NSSM}"; Parameters: "start {#NGINX_SRV}"; Flags: runhidden; StatusM Filename: "sc"; Parameters: "failure ""{#CONVERTER_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#CONVERTER_SRV}}" Filename: "sc"; Parameters: "failure ""{#DOCSERVICE_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#DOCSERVICE_SRV}}" Filename: "sc"; Parameters: "failure ""{#NGINX_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#NGINX_SRV}}" +Filename: "{app}\bin\documentserver-wait-config.bat"; Parameters: "true"; Flags: runhidden; StatusMsg: "{cm:RmPage}" +Filename: "sc"; Parameters: "failure ""{#NGINX_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#NGINX_SRV}}" Filename: "schtasks"; Parameters: "/Create /F /RU ""{#LOCAL_SERVICE}"" /SC DAILY /TN ""{#LogRotateTaskName}"" /TR ""{app}\bin\documentserver-log-rotate.bat"""; Flags: runhidden; StatusMsg: "{cm:AddRotateTask}" From d89d0f7aa9a756499c85e314a25d0dea66b61202 Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 17:55:24 +0300 Subject: [PATCH 19/36] Add ds-prefix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7f160569..0e5b785a 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ else DS_ROOT := /var/www/$(DS_PREFIX) DS_FILES := /var/lib/$(DS_PREFIX) DS_EXAMLE := /var/www/$(DS_PREFIX)-example - DS_MAINTENANCE:= ../var/www/onlyoffice/documentserver/maintenance + DS_MAINTENANCE:= ../var/www/$(DS_PREFIX)/maintenance DEV_NULL := /dev/null endif ifeq ($(UNAME_S),Darwin) From 2f2f0f8cf946cbd9d2e36086dd8279ddfe55a55d Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 17:56:21 +0300 Subject: [PATCH 20/36] Removing extra timeout --- .../bin/documentserver-wait-config.sh.m4 | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/common/documentserver/bin/documentserver-wait-config.sh.m4 b/common/documentserver/bin/documentserver-wait-config.sh.m4 index 19b1b0eb..52f23a1b 100644 --- a/common/documentserver/bin/documentserver-wait-config.sh.m4 +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -1,32 +1,15 @@ #!/bin/bash -Timeout=300 # Seconds - -# this block will be activated after 5 minutes -# only if main script didn't exit with 0. -function timeout_monitor() { - sleep "$Timeout" - echo "Timeout: healthcheck didn't passed" - rm -f ${NGINX_INCLUDES}ds-0maintenance.conf - service nginx reload >/dev/null 2>&1 - kill "$1" -} - -# start the timeout monitor in -# background and pass the PID: -timeout_monitor "$$" & -Timeout_monitor_pid=$! - NGINX_INCLUDES="/etc/nginx/includes/" SERVER_URL=http://localhost:8000/healthcheck -COUNT=5 +TIMER=5 echo "DocumentServer starting up, please wait ..." -while [ $COUNT != 230 ] && [ "$STATUS" != "200" ] +while [ $TIMER != 230 ] && [ "$STATUS" != "200" ] do STATUS=$(curl -s -o /dev/null -w "%{http_code}\n" $SERVER_URL) - COUNT=$(( $COUNT + 5 )) + TIMER=$(( $TIMER + 5 )) sleep 5 done @@ -34,7 +17,4 @@ done rm -f ${NGINX_INCLUDES}ds-0maintenance.conf service nginx reload >/dev/null 2>&1 - # kill timeout monitor when terminating: - kill "$Timeout_monitor_pid" - exit 0 From 075e920ee5f7788a557fc3fa85a45f6ffe52478c Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 17:57:24 +0300 Subject: [PATCH 21/36] Change page name --- common/documentserver/nginx/includes/ds-0maintenance.conf.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 index f5d041d5..d33708f4 100644 --- a/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 +++ b/common/documentserver/nginx/includes/ds-0maintenance.conf.m4 @@ -1,5 +1,5 @@ location ~ ^(\/welcome\/.*)$ { expires 365d; alias M4_DS_MAINTENANCE$1; - index maintenance.html; + index index.html; } From b631b486a79ec57c38fa46701ae1ba8ce1737aec Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 17:58:26 +0300 Subject: [PATCH 22/36] Move the script run to the end --- exe/common.iss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exe/common.iss b/exe/common.iss index 75be5127..abf2fa19 100644 --- a/exe/common.iss +++ b/exe/common.iss @@ -474,13 +474,12 @@ Filename: "{#NSSM}"; Parameters: "start {#NGINX_SRV}"; Flags: runhidden; StatusM Filename: "sc"; Parameters: "failure ""{#CONVERTER_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#CONVERTER_SRV}}" Filename: "sc"; Parameters: "failure ""{#DOCSERVICE_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#DOCSERVICE_SRV}}" Filename: "sc"; Parameters: "failure ""{#NGINX_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#NGINX_SRV}}" -Filename: "{app}\bin\documentserver-wait-config.bat"; Parameters: "true"; Flags: runhidden; StatusMsg: "{cm:RmPage}" -Filename: "sc"; Parameters: "failure ""{#NGINX_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#NGINX_SRV}}" - Filename: "schtasks"; Parameters: "/Create /F /RU ""{#LOCAL_SERVICE}"" /SC DAILY /TN ""{#LogRotateTaskName}"" /TR ""{app}\bin\documentserver-log-rotate.bat"""; Flags: runhidden; StatusMsg: "{cm:AddRotateTask}" Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{#DOCSERVICE_SRV_DIR}\docservice.exe"" ""{#DOCSERVICE_SRV_DESCR}"" ENABLE ALL"; Flags: runhidden; StatusMsg: "{cm:FireWallExt}" Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{#NGINX_SRV_DIR}\nginx.exe"" ""{#NGINX_SRV_DESCR}"" ENABLE ALL"; Flags: runhidden; StatusMsg: "{cm:FireWallExt}" +Filename: "{app}\bin\documentserver-wait-config.bat"; Parameters: "true"; Flags: runhidden; StatusMsg: "{cm:RmPage}" +Filename: "sc"; Parameters: "failure ""{#NGINX_SRV}"" actions= restart/60000/restart/60000/restart/60000 reset= 86400"; Flags: runhidden; StatusMsg: "{cm:CfgSrv,{#NGINX_SRV}}" [UninstallRun] Filename: "{app}\bin\documentserver-prepare4shutdown.bat"; Flags: runhidden From 6f9b8554645ec2acfffbe732a3ffff0dfa5d5a44 Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 17:59:25 +0300 Subject: [PATCH 23/36] Remove useless subdir --- .../home/maintenance/{welcome => }/css/favicon.ico | Bin .../maintenance/{welcome => }/css/footer_github.svg | 0 .../maintenance/{welcome => }/css/footer_help.svg | 0 .../home/maintenance/{welcome => }/css/logo.svg | 0 .../maintenance/{welcome => }/css/stylesheet.css | 0 .../{welcome/maintenance.html => index.html} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename common/documentserver/home/maintenance/{welcome => }/css/favicon.ico (100%) rename common/documentserver/home/maintenance/{welcome => }/css/footer_github.svg (100%) rename common/documentserver/home/maintenance/{welcome => }/css/footer_help.svg (100%) rename common/documentserver/home/maintenance/{welcome => }/css/logo.svg (100%) rename common/documentserver/home/maintenance/{welcome => }/css/stylesheet.css (100%) rename common/documentserver/home/maintenance/{welcome/maintenance.html => index.html} (100%) diff --git a/common/documentserver/home/maintenance/welcome/css/favicon.ico b/common/documentserver/home/maintenance/css/favicon.ico similarity index 100% rename from common/documentserver/home/maintenance/welcome/css/favicon.ico rename to common/documentserver/home/maintenance/css/favicon.ico diff --git a/common/documentserver/home/maintenance/welcome/css/footer_github.svg b/common/documentserver/home/maintenance/css/footer_github.svg similarity index 100% rename from common/documentserver/home/maintenance/welcome/css/footer_github.svg rename to common/documentserver/home/maintenance/css/footer_github.svg diff --git a/common/documentserver/home/maintenance/welcome/css/footer_help.svg b/common/documentserver/home/maintenance/css/footer_help.svg similarity index 100% rename from common/documentserver/home/maintenance/welcome/css/footer_help.svg rename to common/documentserver/home/maintenance/css/footer_help.svg diff --git a/common/documentserver/home/maintenance/welcome/css/logo.svg b/common/documentserver/home/maintenance/css/logo.svg similarity index 100% rename from common/documentserver/home/maintenance/welcome/css/logo.svg rename to common/documentserver/home/maintenance/css/logo.svg diff --git a/common/documentserver/home/maintenance/welcome/css/stylesheet.css b/common/documentserver/home/maintenance/css/stylesheet.css similarity index 100% rename from common/documentserver/home/maintenance/welcome/css/stylesheet.css rename to common/documentserver/home/maintenance/css/stylesheet.css diff --git a/common/documentserver/home/maintenance/welcome/maintenance.html b/common/documentserver/home/maintenance/index.html similarity index 100% rename from common/documentserver/home/maintenance/welcome/maintenance.html rename to common/documentserver/home/maintenance/index.html From 54cfb65143ed730b41e22bb2a6bea68a94b4c9e7 Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 18:01:58 +0300 Subject: [PATCH 24/36] Add dir for Darwin --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0e5b785a..aa8022d4 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,7 @@ else DS_ROOT := /var/www/onlyoffice/documentserver/ DS_FILES := /var/lib/onlyoffice/documentserver/ DS_EXAMLE := /var/www/onlyoffice/documentserver-example + DS_MAINTENANCE := /var/www/onlyoffice/documentserver/maintenance DEV_NULL := /dev/null endif UNAME_M := $(shell uname -m) From 7bd17acc7018d3f315cd4f0605ff5fb1b88c099f Mon Sep 17 00:00:00 2001 From: danilapog Date: Mon, 23 May 2022 18:06:52 +0300 Subject: [PATCH 25/36] Disable cache --- common/documentserver/home/maintenance/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/documentserver/home/maintenance/index.html b/common/documentserver/home/maintenance/index.html index 357a1497..e13e09ad 100644 --- a/common/documentserver/home/maintenance/index.html +++ b/common/documentserver/home/maintenance/index.html @@ -3,7 +3,9 @@ - + + +