diff --git a/Makefile b/Makefile index 1571ba8d..aa8022d4 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/$(DS_PREFIX)/maintenance DEV_NULL := /dev/null endif ifeq ($(UNAME_S),Darwin) @@ -146,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) diff --git a/common/documentserver/bin/documentserver-wait-config.bat b/common/documentserver/bin/documentserver-wait-config.bat new file mode 100644 index 00000000..87a4e826 --- /dev/null +++ b/common/documentserver/bin/documentserver-wait-config.bat @@ -0,0 +1,27 @@ +rem This script in checking document-server status, and after check passed removing maintenance page + +@echo off + +set "MAINTENANCE_NGINX_CONF=..\nginx\conf\includes\ds-0maintenance.conf" +set "SERVER_URL=http://localhost:8000/healthcheck" +set /a "timer=1" + +:loop + for /f "delims=" %%a in (' + curl -s -o nul -w "%%{http_code}" %SERVER_URL% + ') do set "status=%%a"&set "timer=%timer%+1" + + if not "%status%"=="200" ( + if not "%timer%"=="40" ( + echo Server not reachable... trying again... + ) + ) + else ( + echo Server reachable! Success! + del "%MAINTENANCE_NGINX_CONF%" + goto :continue + ) + timeout /t 5 /nobreak + goto :loop + +:continue 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..ae2d46f2 --- /dev/null +++ b/common/documentserver/bin/documentserver-wait-config.sh.m4 @@ -0,0 +1,21 @@ +#!/bin/bash + +NGINX_INCLUDES="/etc/nginx/includes/" +SERVER_URL=http://localhost:8000/healthcheck +TIMER=5 + +echo "DocumentServer starting up, please wait ..." + +while [ $TIMER != 230 ] && [ "$STATUS" != "200" ] +do + STATUS=$(curl -s -o /dev/null -w "%{http_code}\n" $SERVER_URL) + TIMER=$(( $TIMER + 5 )) + sleep 5 +done +echo "DocumentServer is ready" + + # back nginx config links to default condition + rm -f ${NGINX_INCLUDES}ds-0maintenance.conf + service nginx reload >/dev/null 2>&1 + +exit 0 diff --git a/common/documentserver/home/maintenance/css/favicon.ico b/common/documentserver/home/maintenance/css/favicon.ico new file mode 100644 index 00000000..25436dc6 Binary files /dev/null and b/common/documentserver/home/maintenance/css/favicon.ico differ diff --git a/common/documentserver/home/maintenance/css/footer_github.svg b/common/documentserver/home/maintenance/css/footer_github.svg new file mode 100644 index 00000000..f52a2487 --- /dev/null +++ b/common/documentserver/home/maintenance/css/footer_github.svg @@ -0,0 +1,11 @@ + diff --git a/common/documentserver/home/maintenance/css/footer_help.svg b/common/documentserver/home/maintenance/css/footer_help.svg new file mode 100644 index 00000000..3bbbc6d3 --- /dev/null +++ b/common/documentserver/home/maintenance/css/footer_help.svg @@ -0,0 +1,24 @@ + diff --git a/common/documentserver/home/maintenance/css/logo.svg b/common/documentserver/home/maintenance/css/logo.svg new file mode 100644 index 00000000..86d2aa29 --- /dev/null +++ b/common/documentserver/home/maintenance/css/logo.svg @@ -0,0 +1,15 @@ + diff --git a/common/documentserver/home/maintenance/css/stylesheet.css b/common/documentserver/home/maintenance/css/stylesheet.css new file mode 100644 index 00000000..6fa50c2b --- /dev/null +++ b/common/documentserver/home/maintenance/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/maintenance/index.html b/common/documentserver/home/maintenance/index.html new file mode 100644 index 00000000..e13e09ad --- /dev/null +++ b/common/documentserver/home/maintenance/index.html @@ -0,0 +1,105 @@ + +
+ + + + + + + + ++
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ For free Community version, create issues on GitHub or use our forum. + + For commercial versions, contact us here. +
+Want to know what else we’ve got? + Compare editions +
+ +