From 5fbfe49fbdee611abd38316312c3a6bf3d5250a9 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 29 Nov 2017 12:52:57 +0300 Subject: [PATCH 01/10] Change nginx config path --- run-document-server.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 8d15289..6e24556 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -22,9 +22,14 @@ ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000} SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config" NGINX_CONFD_PATH="/etc/nginx/conf.d"; -NGINX_ONLYOFFICE_PATH="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"; -NGINX_ONLYOFFICE_INCLUDES_PATH="/etc/nginx/includes"; -NGINX_ONLYOFFICE_EXAMPLE_PATH=${NGINX_ONLYOFFICE_INCLUDES_PATH}/onlyoffice-documentserver-example.conf +NGINX_ONLYOFFICE_CONF="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf" +NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx" +NGINX_ONLYOFFICE_EXAMPLE_PATH="${NGINX_ONLYOFFICE_PATH}/includes/onlyoffice-documentserver-example.conf" + +#NGINX_CONFD_PATH="/etc/nginx/conf.d"; +#NGINX_ONLYOFFICE_PATH="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"; +#NGINX_ONLYOFFICE_INCLUDES_PATH="${NGINX_CONFD_PATH}/includes"; +#NGINX_ONLYOFFICE_EXAMPLE_PATH=${NGINX_ONLYOFFICE_INCLUDES_PATH}/onlyoffice-documentserver-example.conf NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} @@ -207,32 +212,32 @@ update_nginx_settings(){ # setup HTTPS if [ -f "${SSL_CERTIFICATE_PATH}" -a -f "${SSL_KEY_PATH}" ]; then - cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver-ssl.conf.template ${NGINX_ONLYOFFICE_PATH} + ln -sf ${NGINX_ONLYOFFICE_PATH}/onlyoffice-documentserver-ssl.conf.template ${NGINX_ONLYOFFICE_CONF} # configure nginx - sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH} - sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH} + sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} + sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} # if dhparam path is valid, add to the config, otherwise remove the option if [ -r "${SSL_DHPARAM_PATH}" ]; then - sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_PATH} + sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_CONF} else - sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_PATH} + sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_CONF} fi - sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_PATH} + sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_CONF} if [ -f "${CA_CERTIFICATES_PATH}" ]; then - sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_PATH} + sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_CONF} fi if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then - sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_PATH} + sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_CONF} else - sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_PATH} + sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_CONF} fi else - cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_PATH} + ln -sf ${NGINX_ONLYOFFICE_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_CONF} fi if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then From 2060a03b2cb1dcba77dfe3bba237db30aef4bd35 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 29 Nov 2017 13:06:55 +0300 Subject: [PATCH 02/10] Remove unused code --- run-document-server.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 6e24556..d4d26d1 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -26,11 +26,6 @@ NGINX_ONLYOFFICE_CONF="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf" NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx" NGINX_ONLYOFFICE_EXAMPLE_PATH="${NGINX_ONLYOFFICE_PATH}/includes/onlyoffice-documentserver-example.conf" -#NGINX_CONFD_PATH="/etc/nginx/conf.d"; -#NGINX_ONLYOFFICE_PATH="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf"; -#NGINX_ONLYOFFICE_INCLUDES_PATH="${NGINX_CONFD_PATH}/includes"; -#NGINX_ONLYOFFICE_EXAMPLE_PATH=${NGINX_ONLYOFFICE_INCLUDES_PATH}/onlyoffice-documentserver-example.conf - NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} From e0a4fc60abdbead45687f674c0abd5235e157295 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 29 Nov 2017 14:37:21 +0300 Subject: [PATCH 03/10] Fixed default welcome page --- run-document-server.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index d4d26d1..f17c244 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -24,7 +24,8 @@ SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config" NGINX_CONFD_PATH="/etc/nginx/conf.d"; NGINX_ONLYOFFICE_CONF="${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf" NGINX_ONLYOFFICE_PATH="${CONF_DIR}/nginx" -NGINX_ONLYOFFICE_EXAMPLE_PATH="${NGINX_ONLYOFFICE_PATH}/includes/onlyoffice-documentserver-example.conf" +NGINX_ONLYOFFICE_EXAMPLE_PATH="${CONF_DIR}-example/nginx" +NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/onlyoffice-documentserver-example.conf" NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} @@ -235,8 +236,8 @@ update_nginx_settings(){ ln -sf ${NGINX_ONLYOFFICE_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_CONF} fi - if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then - sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH} + if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_CONF}" ]; then + sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_CONF} fi } From 7ce422f66212f2568ffb2df16acb60dbf01bc4cf Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Mon, 4 Dec 2017 14:27:22 +0300 Subject: [PATCH 04/10] Since v4.0 Documentserver not use `mono` in any form --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 1511132..b421d55 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ * [Installing ONLYOFFICE Document Server integrated with Community and Mail Servers](#installing-onlyoffice-document-server-integrated-with-community-and-mail-servers) * [Issues](#issues) - [Docker Issues](#docker-issues) - - [Mono Issues](#mono-issues) * [Project Information](#project-information) * [User Feedback and Support](#user-feedback-and-support) @@ -282,11 +281,6 @@ As a relatively new project Docker is being worked on and actively developed by The known Docker issue with ONLYOFFICE Document Server with rpm-based distributives is that sometimes the processes fail to start inside Docker container. Fedora and RHEL/CentOS users should try disabling selinux with setenforce 0. If it fixes the issue then you can either stick with SELinux disabled which is not recommended by RedHat, or switch to using Ubuntu. -### Mono Issues - -ONLYOFFICE installation requires the presence of mono (tested for version 3.12.1 or [older](http://www.mono-project.com/docs/getting-started/install/linux/#accessing-older-releases "older")) that may cause problems for some Linux kernel versions. The full list of supported kernel versions is available [here](http://onlyo.co/1PABPEI "here"). - - ## Project Information Official website: [http://www.onlyoffice.org](http://onlyoffice.org "http://www.onlyoffice.org") From 89fd25980444a1ad283922dec49cdbc957c66926 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 12 Dec 2017 17:02:14 +0300 Subject: [PATCH 05/10] update base image version to 16.04 --- Dockerfile | 79 ++++++++++++++++++++++-------------------- run-document-server.sh | 5 ++- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/Dockerfile b/Dockerfile index a00c1a3..6602cf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,51 +1,54 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 LABEL maintainer Ascensio System SIA ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ apt-get -y update && \ - apt-get --force-yes -yq install wget apt-transport-https curl && \ + apt-get -yq install wget apt-transport-https curl locales && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CB2DE8E5 && \ - echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse" >> /etc/apt/sources.list && \ locale-gen en_US.UTF-8 && \ curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ apt-get -y update && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ - apt-get --force-yes -yq install adduser \ - bomstrip \ - fonts-crosextra-carlito \ - fonts-dejavu \ - fonts-liberation \ - fonts-opensymbol \ - fonts-takao-gothic \ - htop \ - libasound2 \ - libboost-regex-dev \ - libcairo2 \ - libcurl3 \ - libgconf2-4 \ - libgtkglext1 \ - libnspr4 \ - libnss3 \ - libnss3-nssdb \ - libstdc++6 \ - libxml2 \ - libxss1 \ - libxtst6 \ - nano \ - nginx-extras \ - nodejs \ - postgresql \ - postgresql-client \ - pwgen \ - rabbitmq-server \ - redis-server \ - software-properties-common \ - supervisor \ - ttf-mscorefonts-installer \ - xvfb \ - zlib1g && \ + apt-get -yq install \ + adduser \ + bomstrip \ + fonts-crosextra-carlito \ + fonts-dejavu \ + fonts-liberation \ + fonts-opensymbol \ + fonts-takao-gothic \ + htop \ + libasound2 \ + libboost-regex-dev \ + libcairo2 \ + libcurl3 \ + libgconf2-4 \ + libgtkglext1 \ + libnspr4 \ + libnss3 \ + libnss3-nssdb \ + libstdc++6 \ + libxml2 \ + libxss1 \ + libxtst6 \ + nano \ + net-tools \ + netcat \ + nginx-extras \ + nodejs \ + postgresql \ + postgresql-client \ + pwgen \ + rabbitmq-server \ + redis-server \ + software-properties-common \ + sudo \ + supervisor \ + ttf-mscorefonts-installer \ + xvfb \ + zlib1g && \ [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -eq 61 ] && \ sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" && \ sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';" && \ @@ -68,7 +71,7 @@ ARG PRODUCT_NAME=onlyoffice-documentserver RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \ apt-get -y update && \ service postgresql start && \ - apt-get --force-yes -yq install $PRODUCT_NAME && \ + apt-get --allow-unauthenticated -yq install $PRODUCT_NAME && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/onlyoffice/*.sh && \ diff --git a/run-document-server.sh b/run-document-server.sh index f17c244..e3229b4 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -45,7 +45,7 @@ JSON_EXAMPLE="json -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}" LOCAL_SERVICES=() -PG_VERSION=9.3 +PG_VERSION=9.5 PG_NAME=main PGDATA=/var/lib/postgresql/${PG_VERSION}/${PG_NAME} PG_NEW_CLUSTER=false @@ -214,6 +214,9 @@ update_nginx_settings(){ sed 's,{{SSL_CERTIFICATE_PATH}},'"${SSL_CERTIFICATE_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} sed 's,{{SSL_KEY_PATH}},'"${SSL_KEY_PATH}"',' -i ${NGINX_ONLYOFFICE_CONF} + # turn on http2 + sed 's,\(443 ssl\),\1 http2,' -i ${NGINX_ONLYOFFICE_CONF} + # if dhparam path is valid, add to the config, otherwise remove the option if [ -r "${SSL_DHPARAM_PATH}" ]; then sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_CONF} From 428b616681486d07fbf906a31d4374ab8da01957 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Tue, 19 Dec 2017 15:02:48 +0300 Subject: [PATCH 06/10] Add detailed message for msttcorefonts failed to download This is workaround of https://bugs.launchpad.net/ubuntu/+source/msttcorefonts/+bug/1465721 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6602cf5..c344370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,8 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ ttf-mscorefonts-installer \ xvfb \ zlib1g && \ - [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -eq 61 ] && \ + if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ + then echo 'msttcorefonts failed to download'; exit 1; fi && \ sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" && \ sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';" && \ sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" && \ From 3f3a4935077ab9ceafb3e75545672b46b8f428e4 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 24 Jan 2018 13:02:26 +0300 Subject: [PATCH 07/10] Turn on static gzip --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index c344370..ba56f90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,7 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \ apt-get -y update && \ service postgresql start && \ apt-get --allow-unauthenticated -yq install $PRODUCT_NAME && \ + documentserver-static-gzip.sh && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/onlyoffice/*.sh && \ From b2d8ce41f47d6124bfa0251c73d90a153b080371 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Mon, 29 Jan 2018 11:56:51 +0300 Subject: [PATCH 08/10] Move turning on gzip to the run script --- Dockerfile | 1 - run-document-server.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba56f90..c344370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,6 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \ apt-get -y update && \ service postgresql start && \ apt-get --allow-unauthenticated -yq install $PRODUCT_NAME && \ - documentserver-static-gzip.sh && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/onlyoffice/*.sh && \ diff --git a/run-document-server.sh b/run-document-server.sh index e3229b4..d95673e 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -336,3 +336,4 @@ service nginx start # Regenerate the fonts list and the fonts thumbnails documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER} +documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER} From 56c0805754170106f2c3d146969e34a48ca07209 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Fri, 2 Mar 2018 18:00:21 +0300 Subject: [PATCH 09/10] Remove font dependency --- Dockerfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c344370..16fb9a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,11 +14,6 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ apt-get -yq install \ adduser \ bomstrip \ - fonts-crosextra-carlito \ - fonts-dejavu \ - fonts-liberation \ - fonts-opensymbol \ - fonts-takao-gothic \ htop \ libasound2 \ libboost-regex-dev \ @@ -46,11 +41,8 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ software-properties-common \ sudo \ supervisor \ - ttf-mscorefonts-installer \ xvfb \ zlib1g && \ - if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ - then echo 'msttcorefonts failed to download'; exit 1; fi && \ sudo -u postgres psql -c "CREATE DATABASE onlyoffice;" && \ sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';" && \ sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;" && \ From 1546c72cf0170f018881f767e01a9aedc2533a60 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Fri, 2 Mar 2018 18:07:51 +0300 Subject: [PATCH 10/10] Remove unused code --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 16fb9a9..f976774 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ locale-gen en_US.UTF-8 && \ curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ apt-get -y update && \ - echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ apt-get -yq install \ adduser \ bomstrip \