Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maintenance page #285

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6f3828a
Add nginx config link for maintains
danilapog May 17, 2022
d842dfb
Add maintains page
danilapog May 17, 2022
3a6ac0f
Run healthcheck and rm maintains script
danilapog May 17, 2022
8a6ad03
Add ds healthcheck script
danilapog May 17, 2022
c1eabe9
Add nginx config for maintains
danilapog May 17, 2022
039eaf7
Add force timeout
danilapog May 18, 2022
df79ca4
Cosmetic changes
danilapog May 18, 2022
269820f
Cosmetic changes
danilapog May 18, 2022
186af58
Refactoring code
danilapog May 18, 2022
cf9cd59
Delete /home dir from ignore
danilapog May 18, 2022
00a56ca
Add maintenance dir
danilapog May 18, 2022
084b9d2
Remove old dir
danilapog May 18, 2022
a8c2720
Add new directory
danilapog May 19, 2022
126f15d
Add maintenance in rpm package
danilapog May 20, 2022
acc906b
Add delete maintenance for windows
danilapog May 23, 2022
a7c9804
Add wait-configure script exec
danilapog May 23, 2022
6790e2c
Add m4 template in maintenance config
danilapog May 23, 2022
fa6cb9e
Add script launch
danilapog May 23, 2022
d89d0f7
Add ds-prefix
danilapog May 23, 2022
2f2f0f8
Removing extra timeout
danilapog May 23, 2022
075e920
Change page name
danilapog May 23, 2022
b631b48
Move the script run to the end
danilapog May 23, 2022
6f9b855
Remove useless subdir
danilapog May 23, 2022
54cfb65
Add dir for Darwin
danilapog May 23, 2022
7bd17ac
Disable cache
danilapog May 23, 2022
fad9a01
Add rewrite and change location
danilapog May 24, 2022
a6f6649
Refactor: refactoring comments
danilapog May 24, 2022
ba49d8f
Refactor: add echo command
danilapog May 24, 2022
5a93b8f
Add timeout in maintenance script for win
danilapog May 24, 2022
3feac32
Refactoring code
danilapog May 24, 2022
7468fb9
Refactoring code
danilapog May 24, 2022
66c1a2b
Ignore home folder
danilapog May 25, 2022
09fc619
refactoring code
danilapog May 25, 2022
29ae324
Refactoring code
danilapog May 25, 2022
b67a916
Refactoring code
danilapog May 25, 2022
17c2b9c
Refactoring code
danilapog May 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
27 changes: 27 additions & 0 deletions common/documentserver/bin/documentserver-wait-config.bat
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions common/documentserver/bin/documentserver-wait-config.sh.m4
Original file line number Diff line number Diff line change
@@ -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
Binary file not shown.
11 changes: 11 additions & 0 deletions common/documentserver/home/maintenance/css/footer_github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions common/documentserver/home/maintenance/css/footer_help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions common/documentserver/home/maintenance/css/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions common/documentserver/home/maintenance/css/stylesheet.css
Original file line number Diff line number Diff line change
@@ -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;
}
}
Loading