Merge tag 'v4.1.0' into develop

v4.1.0
This commit is contained in:
Alexey Golubev 2016-09-05 13:48:07 +03:00
commit 24d8fd6a97
5 changed files with 69 additions and 64 deletions

@ -5,7 +5,7 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=nonint
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
apt-get -y update && \ apt-get -y update && \
apt-get --force-yes -yq install apt-transport-https && \ apt-get --force-yes -yq install wget apt-transport-https && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D9D0BF019CC8AC0D && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D9D0BF019CC8AC0D && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1655A0AB68576280 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1655A0AB68576280 && \
echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse" >> /etc/apt/sources.list && \ echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse" >> /etc/apt/sources.list && \
@ -16,8 +16,11 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
apt-get install --force-yes -yq software-properties-common && \ apt-get install --force-yes -yq software-properties-common && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \ add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt-get -y update && \ apt-get -y update && \
apt-get --force-yes -yq install software-properties-common adduser mysql-server redis-server rabbitmq-server nginx-extras nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g supervisor fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libgtkglext1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2 bomstrip libnspr4 libnss3 libnss3-nssdb nano htop && \ apt-get --force-yes -yq install software-properties-common adduser postgresql redis-server rabbitmq-server nginx-extras nodejs libstdc++6 libcurl3 libxml2 libboost-regex-dev zlib1g supervisor fonts-dejavu fonts-liberation ttf-mscorefonts-installer fonts-crosextra-carlito fonts-takao-gothic fonts-opensymbol libxss1 libgtkglext1 libcairo2 xvfb libxtst6 libgconf2-4 libasound2 bomstrip libnspr4 libnss3 libnss3-nssdb nano htop && \
service mysql stop && \ 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;" && \
service postgresql stop && \
service redis-server stop && \ service redis-server stop && \
service rabbitmq-server stop && \ service rabbitmq-server stop && \
service supervisor stop && \ service supervisor stop && \
@ -29,11 +32,14 @@ ADD run-document-server.sh /app/onlyoffice/run-document-server.sh
EXPOSE 80 443 EXPOSE 80 443
RUN echo "deb http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/onlyoffice-documentserver/{{GIT_BRANCH}}/{{PACKAGE_VERSION}}/ repo/" | tee /etc/apt/sources.list.d/onlyoffice.list && \ ARG REPO_URL="deb http://static.teamlab.com/repo/debian/ squeeze main"
ARG PRODUCT_NAME=onlyoffice-documentserver
RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/onlyoffice.list && \
apt-get -y update && \ apt-get -y update && \
service mysql start && \ service postgresql start && \
apt-get --force-yes -yq install onlyoffice-documentserver && \ apt-get --force-yes -yq install $PRODUCT_NAME && \
service mysql stop && \ service postgresql stop && \
service supervisor stop && \ service supervisor stop && \
chmod 755 /app/onlyoffice/*.sh && \ chmod 755 /app/onlyoffice/*.sh && \
rm -rf /var/log/onlyoffice && \ rm -rf /var/log/onlyoffice && \

@ -1,5 +1,7 @@
PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER)
REPO_URL := "deb http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/$(COMPANY_NAME)-$(PRODUCT_NAME)/$(GIT_BRANCH)/$(PACKAGE_VERSION)/ repo/"
ifeq ($(GIT_BRANCH), origin/develop) ifeq ($(GIT_BRANCH), origin/develop)
DOCKER_TAGS += $(subst -,.,$(PACKAGE_VERSION)) DOCKER_TAGS += $(subst -,.,$(PACKAGE_VERSION))
DOCKER_TAGS += latest DOCKER_TAGS += latest
@ -15,10 +17,8 @@ DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG))
.PHONY: all clean clean-docker deploy docker .PHONY: all clean clean-docker deploy docker
$(DOCKER_TARGETS): $(DEB_REPO_DATA) $(DOCKER_TARGETS): $(DEB_REPO_DATA)
sed "s|{{GIT_BRANCH}}|$(GIT_BRANCH)|" -i Dockerfile
sed 's/{{PACKAGE_VERSION}}/'$(PACKAGE_VERSION)'/' -i Dockerfile
sudo docker build -t $(subst $(COLON),:,$@) . &&\ sudo docker build --build-arg REPO_URL=$(REPO_URL) --build-arg PRODUCT_NAME=$(COMPANY_NAME)-$(PRODUCT_NAME) -t $(subst $(COLON),:,$@) . &&\
mkdir -p $$(dirname $@) &&\ mkdir -p $$(dirname $@) &&\
echo "Done" > $@ echo "Done" > $@

@ -4,7 +4,6 @@
* [Running Docker Image](#running-docker-image) * [Running Docker Image](#running-docker-image)
* [Configuring Docker Image](#configuring-docker-image) * [Configuring Docker Image](#configuring-docker-image)
- [Storing Data](#storing-data) - [Storing Data](#storing-data)
- [Running ONLYOFFICE Document Server on Different Port](#running-onlyoffice-document-server-on-different-port)
- [Running ONLYOFFICE Document Server using HTTPS](#running-onlyoffice-document-server-using-https) - [Running ONLYOFFICE Document Server using HTTPS](#running-onlyoffice-document-server-using-https)
+ [Generation of Self Signed Certificates](#generation-of-self-signed-certificates) + [Generation of Self Signed Certificates](#generation-of-self-signed-certificates)
+ [Strengthening the Server Security](#strengthening-the-server-security) + [Strengthening the Server Security](#strengthening-the-server-security)
@ -67,12 +66,6 @@ To get access to your data from outside the container, you need to mount the vol
Storing the data on the host machine allows you to easily update ONLYOFFICE once the new version is released without losing your data. Storing the data on the host machine allows you to easily update ONLYOFFICE once the new version is released without losing your data.
### Running ONLYOFFICE Document Server on Different Port
To change the port, use the -p command. E.g.: to make your portal accessible via port 8080 execute the following command:
sudo docker run -i -t -d -p 8080:80 onlyoffice/documentserver
### Running ONLYOFFICE Document Server using HTTPS ### Running ONLYOFFICE Document Server using HTTPS
sudo docker run -i -t -d -p 443:443 \ sudo docker run -i -t -d -p 443:443 \
@ -155,11 +148,11 @@ Below is the complete list of parameters that can be set using environment varia
- **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/onlyoffice.key`. - **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/onlyoffice.key`.
- **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`. - **SSL_DHPARAM_PATH**: The path to the Diffie-Hellman parameter. Defaults to `/var/www/onlyoffice/Data/certs/dhparam.pem`.
- **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false` - **SSL_VERIFY_CLIENT**: Enable verification of client certificates using the `CA_CERTIFICATES_PATH` file. Defaults to `false`
- **MYSQL_SERVER_HOST**: The IP address or the name of the host where the MySQL server is running. - **POSTGRESQL_SERVER_HOST**: The IP address or the name of the host where the PostgreSQL server is running.
- **MYSQL_SERVER_PORT**: The MySQL server port number. - **POSTGRESQL_SERVER_PORT**: The PostgreSQL server port number.
- **MYSQL_SERVER_DB_NAME**: The name of a MySQL database to be created on the image startup. - **POSTGRESQL_SERVER_DB_NAME**: The name of a PostgreSQL database to be created on the image startup.
- **MYSQL_SERVER_USER**: The new user name with superuser permissions for the MySQL account. - **POSTGRESQL_SERVER_USER**: The new user name with superuser permissions for the PostgreSQL account.
- **MYSQL_SERVER_PASS**: The password set for the MySQL account. - **POSTGRESQL_SERVER_PASS**: The password set for the PostgreSQL account.
- **RABBITMQ_SERVER_HOST**: The IP address or the name of the host where the RabbitMQ server is running. - **RABBITMQ_SERVER_HOST**: The IP address or the name of the host where the RabbitMQ server is running.
- **RABBITMQ_SERVER_USER**: The RabbitMQ server user name. - **RABBITMQ_SERVER_USER**: The RabbitMQ server user name.
- **RABBITMQ_SERVER_PASS**: The password set for the RabbitMQ account. - **RABBITMQ_SERVER_PASS**: The password set for the RabbitMQ account.
@ -264,6 +257,7 @@ SaaS version: [http://www.onlyoffice.com](http://www.onlyoffice.com "http://www.
## User Feedback and Support ## User Feedback and Support
If you have any problems with or questions about this image, please contact us through [dev.onlyoffice.org][1]. If you have any problems with or questions about this image, please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][2].
[1]: http://dev.onlyoffice.org [1]: http://dev.onlyoffice.org
[2]: http://stackoverflow.com/questions/tagged/onlyoffice

@ -5,10 +5,10 @@ services:
image: onlyoffice/4testing-documentserver:latest image: onlyoffice/4testing-documentserver:latest
environment: environment:
- ONLYOFFICE_DATA_CONTAINER=true - ONLYOFFICE_DATA_CONTAINER=true
- MYSQL_SERVER_HOST=onlyoffice-mysql - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
- MYSQL_SERVER_PORT=3306 - POSTGRESQL_SERVER_PORT=5432
- MYSQL_SERVER_DB_NAME=onlyoffice - POSTGRESQL_SERVER_DB_NAME=onlyoffice
- MYSQL_SERVER_USER=root - POSTGRESQL_SERVER_USER=onlyoffice
- RABBITMQ_SERVER_HOST=onlyoffice-rabbitmq - RABBITMQ_SERVER_HOST=onlyoffice-rabbitmq
- RABBITMQ_SERVER_USER=guest - RABBITMQ_SERVER_USER=guest
- RABBITMQ_SERVER_PASS=guest - RABBITMQ_SERVER_PASS=guest
@ -29,7 +29,7 @@ services:
image: onlyoffice/4testing-documentserver:latest image: onlyoffice/4testing-documentserver:latest
depends_on: depends_on:
- onlyoffice-documentserver-data - onlyoffice-documentserver-data
- onlyoffice-mysql - onlyoffice-postgresql
- onlyoffice-redis - onlyoffice-redis
- onlyoffice-rabbitmq - onlyoffice-rabbitmq
environment: environment:
@ -92,24 +92,23 @@ services:
expose: expose:
- '5672' - '5672'
onlyoffice-mysql: onlyoffice-postgresql:
container_name: onlyoffice-mysql container_name: onlyoffice-postgresql
image: mysql:5.5 image: postgres:9.5
environment: environment:
- MYSQL_DATABASE=onlyoffice - POSTGRES_DB=onlyoffice
- MYSQL_USER=root - POSTGRES_USER=onlyoffice
- MYSQL_ALLOW_EMPTY_PASSWORD='true'
networks: networks:
- onlyoffice - onlyoffice
restart: always restart: always
expose: expose:
- '3306' - '5432'
volumes: volumes:
- mysql_data:/var/lib/mysql - postgresql_data:/var/lib/postgresql
networks: networks:
onlyoffice: onlyoffice:
driver: 'bridge' driver: 'bridge'
volumes: volumes:
mysql_data: postgresql_data:

@ -31,11 +31,11 @@ JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
LOCAL_SERVICES=() LOCAL_SERVICES=()
read_setting(){ read_setting(){
MYSQL_SERVER_HOST=${MYSQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)} POSTGRESQL_SERVER_HOST=${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}
MYSQL_SERVER_PORT=${MYSQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)} POSTGRESQL_SERVER_PORT=${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}
MYSQL_SERVER_DB_NAME=${MYSQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)} POSTGRESQL_SERVER_DB_NAME=${POSTGRESQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)}
MYSQL_SERVER_USER=${MYSQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)} POSTGRESQL_SERVER_USER=${POSTGRESQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)}
MYSQL_SERVER_PASS=${MYSQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)} POSTGRESQL_SERVER_PASS=${POSTGRESQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)}
RABBITMQ_SERVER_URL=$(${JSON} rabbitmq.url) RABBITMQ_SERVER_URL=$(${JSON} rabbitmq.url)
RABBITMQ_SERVER_HOST=${RABBITMQ_SERVER_HOST:-${RABBITMQ_SERVER_URL#'amqp://'}} RABBITMQ_SERVER_HOST=${RABBITMQ_SERVER_HOST:-${RABBITMQ_SERVER_URL#'amqp://'}}
@ -54,8 +54,8 @@ waiting_for_connection(){
done done
} }
waiting_for_mysql(){ waiting_for_postgresql(){
waiting_for_connection ${MYSQL_SERVER_HOST} ${MYSQL_SERVER_PORT} waiting_for_connection ${POSTGRESQL_SERVER_HOST} ${POSTGRESQL_SERVER_PORT}
} }
waiting_for_rabbitmq(){ waiting_for_rabbitmq(){
@ -68,12 +68,12 @@ waiting_for_redis(){
waiting_for_datacontainer(){ waiting_for_datacontainer(){
waiting_for_connection ${ONLYOFFICE_DATA_CONTAINER_HOST} ${ONLYOFFICE_DATA_CONTAINER_PORT} waiting_for_connection ${ONLYOFFICE_DATA_CONTAINER_HOST} ${ONLYOFFICE_DATA_CONTAINER_PORT}
} }
update_mysql_settings(){ update_postgresql_settings(){
${JSON} -I -e "this.services.CoAuthoring.sql.dbHost = '${MYSQL_SERVER_HOST}'" ${JSON} -I -e "this.services.CoAuthoring.sql.dbHost = '${POSTGRESQL_SERVER_HOST}'"
${JSON} -I -e "this.services.CoAuthoring.sql.dbPort = '${MYSQL_SERVER_PORT}'" ${JSON} -I -e "this.services.CoAuthoring.sql.dbPort = '${POSTGRESQL_SERVER_PORT}'"
${JSON} -I -e "this.services.CoAuthoring.sql.dbName = '${MYSQL_SERVER_DB_NAME}'" ${JSON} -I -e "this.services.CoAuthoring.sql.dbName = '${POSTGRESQL_SERVER_DB_NAME}'"
${JSON} -I -e "this.services.CoAuthoring.sql.dbUser = '${MYSQL_SERVER_USER}'" ${JSON} -I -e "this.services.CoAuthoring.sql.dbUser = '${POSTGRESQL_SERVER_USER}'"
${JSON} -I -e "this.services.CoAuthoring.sql.dbPass = '${MYSQL_SERVER_PASS}'" ${JSON} -I -e "this.services.CoAuthoring.sql.dbPass = '${POSTGRESQL_SERVER_PASS}'"
} }
update_rabbitmq_setting(){ update_rabbitmq_setting(){
@ -87,15 +87,21 @@ update_redis_settings(){
${JSON} -I -e "this.services.CoAuthoring.redis.port = '${REDIS_SERVER_PORT}'" ${JSON} -I -e "this.services.CoAuthoring.redis.port = '${REDIS_SERVER_PORT}'"
} }
create_mysql_db(){ create_postgresql_db(){
MYSQL="mysql -s -h${MYSQL_SERVER_HOST} -u${MYSQL_SERVER_USER}" CONNECTION_PARAMS="-h${POSTGRESQL_SERVER_HOST} -U${POSTGRESQL_SERVER_USER} -w"
if [ -n "${MYSQL_SERVER_PASS}" ]; then if [ -n "${POSTGRESQL_SERVER_PASS}" ]; then
MYSQL="$MYSQL -p${MYSQL_SERVER_PASS}" export PGPASSWORD=${POSTGRESQL_SERVER_PASS}
fi fi
# Create db on remote server PSQL="psql -q $CONNECTION_PARAMS"
${MYSQL} -e "CREATE DATABASE IF NOT EXISTS ${MYSQL_SERVER_DB_NAME} CHARACTER SET utf8 COLLATE 'utf8_general_ci';" CREATEDB="createdb $CONNECTION_PARAMS"
${MYSQL} "${MYSQL_SERVER_DB_NAME}" < "${APP_DIR}/server/schema/createdb.sql"
# Create db on remote server
if $PSQL -lt | cut -d\| -f 1 | grep -qw | grep 0; then
$CREATEDB $DB_NAME
fi
$PSQL -d "${POSTGRESQL_SERVER_DB_NAME}" -f "${APP_DIR}/server/schema/postgresql/createdb.sql"
} }
update_nginx_settings(){ update_nginx_settings(){
@ -156,12 +162,12 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
read_setting read_setting
# update settings by env variables # update settings by env variables
if [ ${MYSQL_SERVER_HOST} != "localhost" ]; then if [ ${POSTGRESQL_SERVER_HOST} != "localhost" ]; then
update_mysql_settings update_postgresql_settings
waiting_for_mysql waiting_for_postgresql
create_mysql_db create_postgresql_db
else else
LOCAL_SERVICES+=("mysql") LOCAL_SERVICES+=("postgresql")
fi fi
if [ ${RABBITMQ_SERVER_HOST} != "localhost" ]; then if [ ${RABBITMQ_SERVER_HOST} != "localhost" ]; then
@ -190,7 +196,7 @@ for i in ${LOCAL_SERVICES[@]}; do
done done
if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then
waiting_for_mysql waiting_for_postgresql
waiting_for_rabbitmq waiting_for_rabbitmq
waiting_for_redis waiting_for_redis