mirror of
https://github.com/ONLYOFFICE/Docker-DocumentServer.git
synced 2026-04-07 14:01:38 +08:00
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd02cd6deb | |||
| 94c64d3f6d | |||
| 0ed3f8fbbf | |||
| 85158c3624 | |||
| f24908eb7a | |||
| 1956f98c1d | |||
| ecb77ddb56 | |||
| d3e5246e9a | |||
| 380ac3e227 | |||
| 16107fd3ba | |||
| ee126870b2 | |||
| abe349dad9 | |||
| ac0c135ded | |||
| c5d15c3be7 | |||
| 79e627e080 | |||
| dd5cde1919 | |||
| c47a310683 | |||
| 0d974b9f2a | |||
| be27b2b4d6 | |||
| 98f96d1795 | |||
| 7bfe250035 | |||
| e47d6d8c1a | |||
| 7193b651ec | |||
| 62424ea120 | |||
| c2bcd00322 | |||
| 91815ac24a | |||
| f6b5017b4a | |||
| ab5637a11f | |||
| e721ca102d | |||
| 4a38d6faeb | |||
| 96c0bc432d | |||
| 9d82bb8d1f | |||
| 048a888836 | |||
| a51dc61276 | |||
| 95c59ed2cd | |||
| b72b401e67 | |||
| 37c058d281 | |||
| e361537d32 | |||
| 51b371ff3c | |||
| cc4b0f3b14 | |||
| 75b2232733 | |||
| a553f2eafb | |||
| 82c24e6b4c | |||
| dbab7c36b5 | |||
| 438a41a933 | |||
| a21313bb39 | |||
| 43010e1bd2 | |||
| 9a2d10ceea | |||
| 33d04dc4f4 | |||
| 4468a26a3e | |||
| b639a8ef89 | |||
| efe1d8482f | |||
| 586d1078e6 | |||
| 6b81686cf6 | |||
| f241f36893 | |||
| 9eff99f618 | |||
| df8e19ed90 | |||
| 8988247232 | |||
| 3ff96e8b49 | |||
| a6cda6537b | |||
| 08bb07e2d0 | |||
| be9f986578 | |||
| d59136d477 | |||
| ee8fa827e3 | |||
| 261232e10d | |||
| 2b982778f3 | |||
| 66a293e79d | |||
| f4c0bd13b2 | |||
| f18d04f406 | |||
| 8e1a52566f | |||
| b3055c362c | |||
| 18b8dbe4fe | |||
| 7d1606bc95 | |||
| b590340a10 |
131
.travis.yml
Normal file
131
.travis.yml
Normal file
@ -0,0 +1,131 @@
|
||||
language: generic
|
||||
|
||||
dist: trusty
|
||||
|
||||
env:
|
||||
# community edition
|
||||
- config: standalone.yml
|
||||
|
||||
# integration edition
|
||||
- config: standalone.yml
|
||||
PRODUCT_NAME: documentserver-ie
|
||||
|
||||
|
||||
# certificates (default tls if onlyoffice not exists)
|
||||
- config: certs.yml
|
||||
ssl: true
|
||||
|
||||
# certificates (default onlyoffice if exists)
|
||||
- config: certs.yml
|
||||
ssl: true
|
||||
private_key: onlyoffice.key
|
||||
certificate_request: onlyoffice.csr
|
||||
certificate: onlyoffice.crt
|
||||
|
||||
# custom certificates
|
||||
- config: certs-customized.yml
|
||||
ssl: true
|
||||
private_key: mycert.key
|
||||
certificate_request: mycert.csr
|
||||
certificate: mycert.crt
|
||||
SSL_CERTIFICATE_PATH: /var/www/onlyoffice/Data/certs/mycert.crt
|
||||
SSL_KEY_PATH: /var/www/onlyoffice/Data/certs/mycert.key
|
||||
|
||||
|
||||
# postgresql 12
|
||||
- config: postgres.yml
|
||||
POSTGRES_VERSION: 12
|
||||
|
||||
# postgresql 11
|
||||
- config: postgres.yml
|
||||
POSTGRES_VERSION: 11
|
||||
|
||||
# postgresql 10
|
||||
- config: postgres.yml
|
||||
POSTGRES_VERSION: 10
|
||||
|
||||
# postgresql 9
|
||||
- config: postgres.yml
|
||||
POSTGRES_VERSION: 9
|
||||
|
||||
# postgresql 9.5
|
||||
- config: postgres.yml
|
||||
|
||||
# postgresql custom values
|
||||
- config: postgres.yml
|
||||
DB_NAME: mydb
|
||||
DB_USER: myuser
|
||||
DB_PWD: password
|
||||
POSTGRES_DB: mydb
|
||||
POSTGRES_USER: myuser
|
||||
|
||||
# postgresql deprecated variables
|
||||
- config: postgres-old.yml
|
||||
|
||||
|
||||
# mysql 8
|
||||
- config: mysql.yml
|
||||
MYSQL_VERSION: 8
|
||||
|
||||
# mysql 5
|
||||
- config: mysql.yml
|
||||
MYSQL_VERSION: 5
|
||||
|
||||
# mysql 5.7
|
||||
- config: mysql.yml
|
||||
|
||||
|
||||
# mariadb 10
|
||||
- config: mariadb.yml
|
||||
MARIADB_VERSION: 10
|
||||
|
||||
# mariadb 10.5
|
||||
- config: mariadb.yml
|
||||
|
||||
|
||||
- config: activemq.yml
|
||||
ACTIVEMQ_VERSION: latest
|
||||
|
||||
# activemq 5.14.3
|
||||
- config: activemq.yml
|
||||
|
||||
|
||||
# rabbitmq latest
|
||||
- config: rabbitmq.yml
|
||||
|
||||
# rabbitmq 3
|
||||
- config: rabbitmq.yml
|
||||
RABBITMQ_VERSION: 3
|
||||
|
||||
# rabbitmq old variables
|
||||
- config: rabbitmq-old.yml
|
||||
|
||||
|
||||
# redis latest with community edition
|
||||
- config: redis.yml
|
||||
|
||||
# redis latest with integraion edition
|
||||
- config: redis.yml
|
||||
PRODUCT_NAME: documentserver-ie
|
||||
|
||||
# redis 6
|
||||
- config: redis.yml
|
||||
REDIS_VERSION: 6
|
||||
|
||||
# redis 5
|
||||
- config: redis.yml
|
||||
REDIS_VERSION: 5
|
||||
|
||||
|
||||
# graphite
|
||||
- config: graphite.yml
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
script:
|
||||
# Go to tests dir
|
||||
- cd ${PWD}/tests
|
||||
|
||||
# Run test.
|
||||
- ./test.sh
|
||||
27
Dockerfile
27
Dockerfile
@ -1,4 +1,4 @@
|
||||
FROM ubuntu:16.04
|
||||
FROM ubuntu:18.04
|
||||
LABEL maintainer Ascensio System SIA <support@onlyoffice.com>
|
||||
|
||||
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive
|
||||
@ -7,33 +7,32 @@ ARG ONLYOFFICE_VALUE=onlyoffice
|
||||
|
||||
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
||||
apt-get -y update && \
|
||||
apt-get -yq install wget apt-transport-https curl locales && \
|
||||
apt-get -yq install wget apt-transport-https gnupg locales && \
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \
|
||||
locale-gen en_US.UTF-8 && \
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
|
||||
apt-get -y update && \
|
||||
apt-get -yq install \
|
||||
adduser \
|
||||
apt-utils \
|
||||
bomstrip \
|
||||
htop \
|
||||
libasound2 \
|
||||
libboost-regex-dev \
|
||||
libcairo2 \
|
||||
libcurl3 \
|
||||
libcurl3-gnutls \
|
||||
libgconf2-4 \
|
||||
libgtkglext1 \
|
||||
libgtk-3-0 \
|
||||
libnspr4 \
|
||||
libnss3 \
|
||||
libnss3-nssdb \
|
||||
libstdc++6 \
|
||||
libxml2 \
|
||||
libxss1 \
|
||||
libxtst6 \
|
||||
mysql-client \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
netcat-openbsd \
|
||||
nginx-extras \
|
||||
nodejs \
|
||||
postgresql \
|
||||
postgresql-client \
|
||||
pwgen \
|
||||
@ -44,6 +43,11 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
||||
supervisor \
|
||||
xvfb \
|
||||
zlib1g && \
|
||||
echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \
|
||||
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \
|
||||
sed 's|\(application\/zip.*\)|\1\n application\/wasm wasm;|' -i /etc/nginx/mime.types && \
|
||||
pg_conftool 10 main set listen_addresses 'localhost' && \
|
||||
service postgresql restart && \
|
||||
sudo -u postgres psql -c "CREATE DATABASE $ONLYOFFICE_VALUE;" && \
|
||||
sudo -u postgres psql -c "CREATE USER $ONLYOFFICE_VALUE WITH password '$ONLYOFFICE_VALUE';" && \
|
||||
sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE $ONLYOFFICE_VALUE TO $ONLYOFFICE_VALUE;" && \
|
||||
@ -63,7 +67,8 @@ ARG REPO_URL="deb http://download.onlyoffice.com/repo/debian squeeze main"
|
||||
ARG COMPANY_NAME=onlyoffice
|
||||
ARG PRODUCT_NAME=documentserver
|
||||
|
||||
ENV COMPANY_NAME=$COMPANY_NAME
|
||||
ENV COMPANY_NAME=$COMPANY_NAME \
|
||||
PRODUCT_NAME=$PRODUCT_NAME
|
||||
|
||||
RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \
|
||||
apt-get -y update && \
|
||||
@ -75,6 +80,6 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \
|
||||
rm -rf /var/log/$COMPANY_NAME && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /usr/share/fonts/truetype/custom
|
||||
VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom
|
||||
|
||||
ENTRYPOINT /app/ds/run-document-server.sh
|
||||
ENTRYPOINT ["/app/ds/run-document-server.sh"]
|
||||
|
||||
25
Makefile
25
Makefile
@ -1,13 +1,17 @@
|
||||
COMPANY_NAME ?= onlyoffice
|
||||
COMPANY_NAME ?= ONLYOFFICE
|
||||
GIT_BRANCH ?= develop
|
||||
PRODUCT_NAME ?= documentserver-ie
|
||||
PRODUCT_NAME ?= DocumentServer
|
||||
PRODUCT_VERSION ?= 0.0.0
|
||||
BUILD_NUMBER ?= 0
|
||||
ONLYOFFICE_VALUE ?= onlyoffice
|
||||
|
||||
COMPANY_NAME_LOW = $(shell echo $(COMPANY_NAME) | tr A-Z a-z)
|
||||
PRODUCT_NAME_LOW = $(shell echo $(PRODUCT_NAME) | tr A-Z a-z)
|
||||
COMPANY_NAME_LOW_ESCAPED = $(subst -,,$(COMPANY_NAME_LOW))
|
||||
|
||||
PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER)
|
||||
|
||||
REPO_URL := "deb [trusted=yes] http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/$(COMPANY_NAME)-$(PRODUCT_NAME)/$(GIT_BRANCH)/$(PACKAGE_VERSION)/ repo/"
|
||||
REPO_URL := "deb [trusted=yes] http://repo-doc-onlyoffice-com.s3.amazonaws.com/ubuntu/trusty/$(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)/$(GIT_BRANCH)/$(PACKAGE_VERSION)/ repo/"
|
||||
|
||||
UPDATE_LATEST := false
|
||||
|
||||
@ -24,12 +28,12 @@ endif
|
||||
|
||||
DOCKER_TAGS += $(DOCKER_TAG)
|
||||
|
||||
DOCKER_REPO = $(COMPANY_NAME)/4testing-$(PRODUCT_NAME)
|
||||
DOCKER_REPO = $(COMPANY_NAME_LOW_ESCAPED)/4testing-$(PRODUCT_NAME_LOW)
|
||||
|
||||
COLON := __colon__
|
||||
DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG))
|
||||
|
||||
DOCKER_ARCH := $(COMPANY_NAME)-$(PRODUCT_NAME)_$(PACKAGE_VERSION).tar.gz
|
||||
DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)_$(PACKAGE_VERSION).tar.gz
|
||||
|
||||
.PHONY: all clean clean-docker deploy docker publish
|
||||
|
||||
@ -37,8 +41,8 @@ $(DOCKER_TARGETS): $(DEB_REPO_DATA)
|
||||
|
||||
docker build \
|
||||
--build-arg REPO_URL=$(REPO_URL) \
|
||||
--build-arg COMPANY_NAME=$(COMPANY_NAME) \
|
||||
--build-arg PRODUCT_NAME=$(PRODUCT_NAME) \
|
||||
--build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \
|
||||
--build-arg PRODUCT_NAME=$(PRODUCT_NAME_LOW) \
|
||||
--build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \
|
||||
-t $(subst $(COLON),:,$@) . &&\
|
||||
mkdir -p $$(dirname $@) &&\
|
||||
@ -54,10 +58,13 @@ clean:
|
||||
rm -rfv $(DOCKER_TARGETS) $(DOCKER_ARCH)
|
||||
|
||||
clean-docker:
|
||||
docker rmi -f $$(docker images -q $(COMPANY_NAME)/*) || exit 0
|
||||
docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0
|
||||
|
||||
deploy: $(DOCKER_TARGETS)
|
||||
$(foreach TARGET,$(DOCKER_TARGETS),docker push $(subst $(COLON),:,$(TARGET));)
|
||||
$(foreach TARGET,$(DOCKER_TARGETS), \
|
||||
for i in {1..3}; do \
|
||||
docker push $(subst $(COLON),:,$(TARGET)) && break || sleep 1m; \
|
||||
done;)
|
||||
|
||||
publish: $(DOCKER_ARCH)
|
||||
aws s3 cp \
|
||||
|
||||
55
README.md
55
README.md
@ -67,6 +67,8 @@ To get access to your data from outside the container, you need to mount the vol
|
||||
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
|
||||
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
|
||||
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
|
||||
-v /app/onlyoffice/DocumentServer/rabbitmq:/var/lib/rabbitmq \
|
||||
-v /app/onlyoffice/DocumentServer/redis:/var/lib/redis \
|
||||
-v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver
|
||||
|
||||
Normally, you do not need to store container data because the container's operation does not depend on its state. Saving data will be useful:
|
||||
@ -94,10 +96,10 @@ To secure the application via SSL basically two things are needed:
|
||||
|
||||
So you need to create and install the following files:
|
||||
|
||||
/app/onlyoffice/DocumentServer/data/certs/onlyoffice.key
|
||||
/app/onlyoffice/DocumentServer/data/certs/onlyoffice.crt
|
||||
/app/onlyoffice/DocumentServer/data/certs/tls.key
|
||||
/app/onlyoffice/DocumentServer/data/certs/tls.crt
|
||||
|
||||
When using CA certified certificates, these files are provided to you by the CA. When using self-signed certificates you need to generate these files yourself. Skip the following section if you are have CA certified SSL certificates.
|
||||
When using CA certified certificates, these files are provided to you by the CA. When using self-signed certificates you need to generate these files yourself. Skip the following section if you have CA certified SSL certificates (e.g. [Let's Encrypt](https://letsencrypt.org)).
|
||||
|
||||
#### Generation of Self Signed Certificates
|
||||
|
||||
@ -106,19 +108,19 @@ Generation of self-signed SSL certificates involves a simple 3 step procedure.
|
||||
**STEP 1**: Create the server private key
|
||||
|
||||
```bash
|
||||
openssl genrsa -out onlyoffice.key 2048
|
||||
openssl genrsa -out tls.key 2048
|
||||
```
|
||||
|
||||
**STEP 2**: Create the certificate signing request (CSR)
|
||||
|
||||
```bash
|
||||
openssl req -new -key onlyoffice.key -out onlyoffice.csr
|
||||
openssl req -new -key tls.key -out tls.csr
|
||||
```
|
||||
|
||||
**STEP 3**: Sign the certificate using the private key and CSR
|
||||
|
||||
```bash
|
||||
openssl x509 -req -days 365 -in onlyoffice.csr -signkey onlyoffice.key -out onlyoffice.crt
|
||||
openssl x509 -req -days 365 -in tls.csr -signkey tls.key -out tls.crt
|
||||
```
|
||||
|
||||
You have now generated an SSL certificate that's valid for 365 days.
|
||||
@ -134,18 +136,18 @@ openssl dhparam -out dhparam.pem 2048
|
||||
|
||||
#### Installation of the SSL Certificates
|
||||
|
||||
Out of the four files generated above, you need to install the `onlyoffice.key`, `onlyoffice.crt` and `dhparam.pem` files at the onlyoffice server. The CSR file is not needed, but do make sure you safely backup the file (in case you ever need it again).
|
||||
Out of the four files generated above, you need to install the `tls.key`, `tls.crt` and `dhparam.pem` files at the onlyoffice server. The CSR file is not needed, but do make sure you safely backup the file (in case you ever need it again).
|
||||
|
||||
The default path that the onlyoffice application is configured to look for the SSL certificates is at `/var/www/onlyoffice/Data/certs`, this can however be changed using the `SSL_KEY_PATH`, `SSL_CERTIFICATE_PATH` and `SSL_DHPARAM_PATH` configuration options.
|
||||
|
||||
The `/var/www/onlyoffice/Data/` path is the path of the data store, which means that you have to create a folder named certs inside `/app/onlyoffice/DocumentServer/data/` and copy the files into it and as a measure of security you will update the permission on the `onlyoffice.key` file to only be readable by the owner.
|
||||
The `/var/www/onlyoffice/Data/` path is the path of the data store, which means that you have to create a folder named certs inside `/app/onlyoffice/DocumentServer/data/` and copy the files into it and as a measure of security you will update the permission on the `tls.key` file to only be readable by the owner.
|
||||
|
||||
```bash
|
||||
mkdir -p /app/onlyoffice/DocumentServer/data/certs
|
||||
cp onlyoffice.key /app/onlyoffice/DocumentServer/data/certs/
|
||||
cp onlyoffice.crt /app/onlyoffice/DocumentServer/data/certs/
|
||||
cp tls.key /app/onlyoffice/DocumentServer/data/certs/
|
||||
cp tls.crt /app/onlyoffice/DocumentServer/data/certs/
|
||||
cp dhparam.pem /app/onlyoffice/DocumentServer/data/certs/
|
||||
chmod 400 /app/onlyoffice/DocumentServer/data/certs/onlyoffice.key
|
||||
chmod 400 /app/onlyoffice/DocumentServer/data/certs/tls.key
|
||||
```
|
||||
|
||||
You are now just one step away from having our application secured.
|
||||
@ -158,17 +160,18 @@ Below is the complete list of parameters that can be set using environment varia
|
||||
|
||||
- **ONLYOFFICE_HTTPS_HSTS_ENABLED**: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to `true`.
|
||||
- **ONLYOFFICE_HTTPS_HSTS_MAXAGE**: Advanced configuration option for setting the HSTS max-age in the onlyoffice nginx vHost configuration. Applicable only when SSL is in use. Defaults to `31536000`.
|
||||
- **SSL_CERTIFICATE_PATH**: The path to the SSL certificate to use. Defaults to `/var/www/onlyoffice/Data/certs/onlyoffice.crt`.
|
||||
- **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/onlyoffice.key`.
|
||||
- **SSL_CERTIFICATE_PATH**: The path to the SSL certificate to use. Defaults to `/var/www/onlyoffice/Data/certs/tls.crt`.
|
||||
- **SSL_KEY_PATH**: The path to the SSL certificate's private key. Defaults to `/var/www/onlyoffice/Data/certs/tls.key`.
|
||||
- **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`
|
||||
- **POSTGRESQL_SERVER_HOST**: The IP address or the name of the host where the PostgreSQL server is running.
|
||||
- **POSTGRESQL_SERVER_PORT**: The PostgreSQL server port number.
|
||||
- **POSTGRESQL_SERVER_DB_NAME**: The name of a PostgreSQL database to be created on the image startup.
|
||||
- **POSTGRESQL_SERVER_USER**: The new user name with superuser permissions for the PostgreSQL account.
|
||||
- **POSTGRESQL_SERVER_PASS**: The password set for the PostgreSQL account.
|
||||
- **AMQP_SERVER_URL**: The [AMQP URL](http://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server.
|
||||
- **AMQP_SERVER_TYPE**: The message broker type. Supported values are `rabbitmq` or `activemq`. Defaults to `rabbitmq`.
|
||||
- **DB_TYPE**: The database type. Supported values are `postgres`, `mariadb` or `mysql`. Defaults to `postgres`.
|
||||
- **DB_HOST**: The IP address or the name of the host where the database server is running.
|
||||
- **DB_PORT**: The database server port number.
|
||||
- **DB_NAME**: The name of a database to be created on the image startup.
|
||||
- **DB_USER**: The new user name with superuser permissions for the database account.
|
||||
- **DB_PWD**: The password set for the database account.
|
||||
- **AMQP_URI**: The [AMQP URI](https://www.rabbitmq.com/uri-spec.html "RabbitMQ URI Specification") to connect to message broker server.
|
||||
- **AMQP_TYPE**: The message broker type. Supported values are `rabbitmq` or `activemq`. Defaults to `rabbitmq`.
|
||||
- **REDIS_SERVER_HOST**: The IP address or the name of the host where the Redis server is running.
|
||||
- **REDIS_SERVER_PORT**: The Redis server port number.
|
||||
- **NGINX_WORKER_PROCESSES**: Defines the number of nginx worker processes.
|
||||
@ -176,6 +179,12 @@ Below is the complete list of parameters that can be set using environment varia
|
||||
- **JWT_ENABLED**: Specifies the enabling the JSON Web Token validation by the ONLYOFFICE Document Server. Defaults to `false`.
|
||||
- **JWT_SECRET**: Defines the secret key to validate the JSON Web Token in the request to the ONLYOFFICE Document Server. Defaults to `secret`.
|
||||
- **JWT_HEADER**: Defines the http header that will be used to send the JSON Web Token. Defaults to `Authorization`.
|
||||
- **JWT_IN_BODY**: Specifies the enabling the token validation in the request body to the ONLYOFFICE Document Server. Defaults to `false`.
|
||||
- **USE_UNAUTHORIZED_STORAGE**: Set to `true`if using selfsigned certificates for your storage server e.g. Nextcloud. Defaults to `false`
|
||||
- **METRICS_ENABLED**: Specifies the enabling StatsD for ONLYOFFICE Document Server. Defaults to `false`.
|
||||
- **METRICS_HOST**: Defines StatsD listening host. Defaults to `localhost`.
|
||||
- **METRICS_PORT**: Defines StatsD listening port. Defaults to `8125`.
|
||||
- **METRICS_PREFIX**: Defines StatsD metrics prefix for backend services. Defaults to `ds.`.
|
||||
|
||||
## Installing ONLYOFFICE Document Server integrated with Community and Mail Servers
|
||||
|
||||
@ -259,7 +268,7 @@ Alternatively, you can use an automatic installation script to install the whole
|
||||
**STEP 1**: Download the Community Edition Docker script file
|
||||
|
||||
```bash
|
||||
wget http://download.onlyoffice.com/install/opensource-install.sh
|
||||
wget https://download.onlyoffice.com/install/opensource-install.sh
|
||||
```
|
||||
|
||||
**STEP 2**: Install ONLYOFFICE Community Edition executing the following command:
|
||||
@ -311,5 +320,5 @@ SaaS version: [https://www.onlyoffice.com/cloud-office.aspx](https://www.onlyoff
|
||||
|
||||
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
|
||||
[2]: http://stackoverflow.com/questions/tagged/onlyoffice
|
||||
[1]: https://dev.onlyoffice.org
|
||||
[2]: https://stackoverflow.com/questions/tagged/onlyoffice
|
||||
|
||||
108
cluster.yml
Normal file
108
cluster.yml
Normal file
@ -0,0 +1,108 @@
|
||||
version: '2.1'
|
||||
|
||||
x-ds-image:
|
||||
&ds-image
|
||||
${COMPANY_NAME:-onlyoffice}/${PRODUCT_NAME:-documentserver-de}:${PRODUCT_VERSION:-latest}
|
||||
|
||||
services:
|
||||
onlyoffice-documentserver-data:
|
||||
container_name: onlyoffice-documentserver-data
|
||||
image: *ds-image
|
||||
environment:
|
||||
- ONLYOFFICE_DATA_CONTAINER=true
|
||||
- DB_HOST=onlyoffice-postgresql
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=onlyoffice
|
||||
- DB_USER=onlyoffice
|
||||
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
|
||||
- REDIS_SERVER_HOST=onlyoffice-redis
|
||||
- REDIS_SERVER_PORT=6379
|
||||
# Uncomment strings below to enable the JSON Web Token validation.
|
||||
#- JWT_ENABLED=true
|
||||
#- JWT_SECRET=secret
|
||||
#- JWT_HEADER=Authorization
|
||||
#- JWT_IN_BODY=true
|
||||
stdin_open: true
|
||||
restart: always
|
||||
volumes:
|
||||
- /etc/onlyoffice
|
||||
- /var/www/onlyoffice/Data
|
||||
- /var/log/onlyoffice
|
||||
- /var/lib/onlyoffice/documentserver/App_Data/cache/files
|
||||
- /var/www/onlyoffice/documentserver-example/public/files
|
||||
- /usr/share/fonts
|
||||
|
||||
onlyoffice-documentserver:
|
||||
image: *ds-image
|
||||
depends_on:
|
||||
- onlyoffice-documentserver-data
|
||||
- onlyoffice-postgresql
|
||||
- onlyoffice-redis
|
||||
- onlyoffice-rabbitmq
|
||||
environment:
|
||||
- ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data
|
||||
- BALANCE=uri depth 3
|
||||
- EXCLUDE_PORTS=443
|
||||
- HTTP_CHECK=GET /healthcheck
|
||||
- EXTRA_SETTINGS=http-check expect string true
|
||||
# Uncomment the string below to redirect HTTP request to HTTPS request.
|
||||
#- FORCE_SSL=true
|
||||
stdin_open: true
|
||||
restart: always
|
||||
expose:
|
||||
- '80'
|
||||
volumes_from:
|
||||
- onlyoffice-documentserver-data
|
||||
|
||||
onlyoffice-haproxy:
|
||||
container_name: onlyoffice-haproxy
|
||||
image: dockercloud/haproxy:1.5.1
|
||||
depends_on:
|
||||
- onlyoffice-documentserver
|
||||
environment:
|
||||
- MODE=http
|
||||
# Uncomment the string below to specify the path of ssl certificates
|
||||
#- CERT_FOLDER=/certs/
|
||||
stdin_open: true
|
||||
links:
|
||||
- onlyoffice-documentserver
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
# Uncomment the string below to map a ssl certificate from host
|
||||
# to the proxy container
|
||||
#- /app/onlyoffice/DocumentServer/data/certs/onlyoffice.pem:/certs/cert1.pem
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
- '1936:1936'
|
||||
|
||||
onlyoffice-redis:
|
||||
container_name: onlyoffice-redis
|
||||
image: redis
|
||||
restart: always
|
||||
expose:
|
||||
- '6379'
|
||||
|
||||
onlyoffice-rabbitmq:
|
||||
container_name: onlyoffice-rabbitmq
|
||||
image: rabbitmq
|
||||
restart: always
|
||||
expose:
|
||||
- '5672'
|
||||
|
||||
onlyoffice-postgresql:
|
||||
container_name: onlyoffice-postgresql
|
||||
image: postgres:9.5
|
||||
environment:
|
||||
- POSTGRES_DB=onlyoffice
|
||||
- POSTGRES_USER=onlyoffice
|
||||
- POSTGRES_HOST_AUTH_METHOD=trust
|
||||
restart: always
|
||||
expose:
|
||||
- '5432'
|
||||
volumes:
|
||||
- postgresql_data:/var/lib/postgresql
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
@ -1,97 +1,41 @@
|
||||
version: '2'
|
||||
services:
|
||||
onlyoffice-documentserver-data:
|
||||
container_name: onlyoffice-documentserver-data
|
||||
image: onlyoffice/documentserver:latest
|
||||
onlyoffice-documentserver:
|
||||
build:
|
||||
context: .
|
||||
container_name: onlyoffice-documentserver
|
||||
depends_on:
|
||||
- onlyoffice-postgresql
|
||||
- onlyoffice-rabbitmq
|
||||
environment:
|
||||
- ONLYOFFICE_DATA_CONTAINER=true
|
||||
- POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
|
||||
- POSTGRESQL_SERVER_PORT=5432
|
||||
- POSTGRESQL_SERVER_DB_NAME=onlyoffice
|
||||
- POSTGRESQL_SERVER_USER=onlyoffice
|
||||
- AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq
|
||||
- REDIS_SERVER_HOST=onlyoffice-redis
|
||||
- REDIS_SERVER_PORT=6379
|
||||
- DB_TYPE=postgres
|
||||
- DB_HOST=onlyoffice-postgresql
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=onlyoffice
|
||||
- DB_USER=onlyoffice
|
||||
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
|
||||
# Uncomment strings below to enable the JSON Web Token validation.
|
||||
#- JWT_ENABLED=true
|
||||
#- JWT_SECRET=secret
|
||||
#- JWT_HEADER=Authorization
|
||||
#- JWT_IN_BODY=true
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
stdin_open: true
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
stop_grace_period: 60s
|
||||
volumes:
|
||||
- /etc/onlyoffice
|
||||
- /var/www/onlyoffice/Data
|
||||
- /var/log/onlyoffice
|
||||
- /var/lib/onlyoffice/documentserver/App_Data/cache/files
|
||||
- /var/www/onlyoffice/documentserver-example/public/files
|
||||
- /usr/share/fonts
|
||||
|
||||
onlyoffice-documentserver:
|
||||
image: onlyoffice/documentserver:latest
|
||||
depends_on:
|
||||
- onlyoffice-documentserver-data
|
||||
- onlyoffice-postgresql
|
||||
- onlyoffice-redis
|
||||
- onlyoffice-rabbitmq
|
||||
environment:
|
||||
- ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data
|
||||
- BALANCE=uri depth 3
|
||||
- EXCLUDE_PORTS=443
|
||||
- HTTP_CHECK=GET /healthcheck
|
||||
- EXTRA_SETTINGS=http-check expect string true
|
||||
# Uncomment the string below to redirect HTTP request to HTTPS request.
|
||||
#- FORCE_SSL=true
|
||||
stdin_open: true
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '80'
|
||||
volumes_from:
|
||||
- onlyoffice-documentserver-data
|
||||
|
||||
onlyoffice-haproxy:
|
||||
container_name: onlyoffice-haproxy
|
||||
image: dockercloud/haproxy:1.5.1
|
||||
depends_on:
|
||||
- onlyoffice-documentserver
|
||||
environment:
|
||||
- MODE=http
|
||||
# Uncomment the string below to specify the path of ssl certificates
|
||||
#- CERT_FOLDER=/certs/
|
||||
stdin_open: true
|
||||
links:
|
||||
- onlyoffice-documentserver
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
# Uncomment the string below to map a ssl certificate from host
|
||||
# to the proxy container
|
||||
#- /app/onlyoffice/DocumentServer/data/certs/onlyoffice.pem:/certs/cert1.pem
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
- '1936:1936'
|
||||
|
||||
onlyoffice-redis:
|
||||
container_name: onlyoffice-redis
|
||||
image: redis
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '6379'
|
||||
|
||||
onlyoffice-rabbitmq:
|
||||
container_name: onlyoffice-rabbitmq
|
||||
image: rabbitmq
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '5672'
|
||||
|
||||
@ -101,17 +45,12 @@ services:
|
||||
environment:
|
||||
- POSTGRES_DB=onlyoffice
|
||||
- POSTGRES_USER=onlyoffice
|
||||
networks:
|
||||
- onlyoffice
|
||||
- POSTGRES_HOST_AUTH_METHOD=trust
|
||||
restart: always
|
||||
expose:
|
||||
- '5432'
|
||||
volumes:
|
||||
- postgresql_data:/var/lib/postgresql
|
||||
|
||||
networks:
|
||||
onlyoffice:
|
||||
driver: 'bridge'
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
function clean_exit {
|
||||
/usr/bin/documentserver-prepare4shutdown.sh
|
||||
}
|
||||
|
||||
trap clean_exit SIGTERM
|
||||
|
||||
# Define '**' behavior explicitly
|
||||
shopt -s globstar
|
||||
|
||||
@ -16,11 +22,20 @@ ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost}
|
||||
ONLYOFFICE_DATA_CONTAINER_PORT=80
|
||||
|
||||
SSL_CERTIFICATES_DIR="${DATA_DIR}/certs"
|
||||
SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-${SSL_CERTIFICATES_DIR}/onlyoffice.crt}
|
||||
SSL_KEY_PATH=${SSL_KEY_PATH:-${SSL_CERTIFICATES_DIR}/onlyoffice.key}
|
||||
if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/onlyoffice.crt ]]; then
|
||||
SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/onlyoffice.crt
|
||||
else
|
||||
SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-${SSL_CERTIFICATES_DIR}/tls.crt}
|
||||
fi
|
||||
if [[ -z $SSL_KEY_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/onlyoffice.key ]]; then
|
||||
SSL_KEY_PATH=${SSL_CERTIFICATES_DIR}/onlyoffice.key
|
||||
else
|
||||
SSL_KEY_PATH=${SSL_KEY_PATH:-${SSL_CERTIFICATES_DIR}/tls.key}
|
||||
fi
|
||||
CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-${SSL_CERTIFICATES_DIR}/ca-certificates.pem}
|
||||
SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-${SSL_CERTIFICATES_DIR}/dhparam.pem}
|
||||
SSL_VERIFY_CLIENT=${SSL_VERIFY_CLIENT:-off}
|
||||
USE_UNAUTHORIZED_STORAGE=${USE_UNAUTHORIZED_STORAGE:-false}
|
||||
ONLYOFFICE_HTTPS_HSTS_ENABLED=${ONLYOFFICE_HTTPS_HSTS_ENABLED:-true}
|
||||
ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000}
|
||||
SYSCONF_TEMPLATES_DIR="/app/ds/setup/config"
|
||||
@ -38,12 +53,19 @@ NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
|
||||
JWT_ENABLED=${JWT_ENABLED:-false}
|
||||
JWT_SECRET=${JWT_SECRET:-secret}
|
||||
JWT_HEADER=${JWT_HEADER:-Authorization}
|
||||
JWT_IN_BODY=${JWT_IN_BODY:-false}
|
||||
|
||||
if [[ ${PRODUCT_NAME} == "documentserver" ]]; then
|
||||
REDIS_ENABLED=false
|
||||
else
|
||||
REDIS_ENABLED=true
|
||||
fi
|
||||
|
||||
ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/local.json
|
||||
ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json
|
||||
ONLYOFFICE_EXAMPLE_CONFIG=${CONF_DIR}-example/local.json
|
||||
|
||||
JSON_BIN=${APP_DIR}/npm/node_modules/.bin/json
|
||||
JSON_BIN=${APP_DIR}/npm/json
|
||||
JSON="${JSON_BIN} -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
|
||||
JSON_LOG="${JSON_BIN} -q -f ${ONLYOFFICE_LOG4JS_CONFIG}"
|
||||
JSON_EXAMPLE="${JSON_BIN} -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}"
|
||||
@ -51,22 +73,53 @@ JSON_EXAMPLE="${JSON_BIN} -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}"
|
||||
LOCAL_SERVICES=()
|
||||
|
||||
PG_ROOT=/var/lib/postgresql
|
||||
PG_VERSION=9.5
|
||||
PG_VERSION=10
|
||||
PG_NAME=main
|
||||
PGDATA=${PG_ROOT}/${PG_VERSION}/${PG_NAME}
|
||||
PG_NEW_CLUSTER=false
|
||||
RABBITMQ_DATA=/var/lib/rabbitmq
|
||||
REDIS_DATA=/var/lib/redis
|
||||
|
||||
read_setting(){
|
||||
POSTGRESQL_SERVER_HOST=${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}
|
||||
POSTGRESQL_SERVER_PORT=${POSTGRESQL_SERVER_PORT:-5432}
|
||||
POSTGRESQL_SERVER_DB_NAME=${POSTGRESQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)}
|
||||
POSTGRESQL_SERVER_USER=${POSTGRESQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)}
|
||||
POSTGRESQL_SERVER_PASS=${POSTGRESQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)}
|
||||
deprecated_var POSTGRESQL_SERVER_HOST DB_HOST
|
||||
deprecated_var POSTGRESQL_SERVER_PORT DB_PORT
|
||||
deprecated_var POSTGRESQL_SERVER_DB_NAME DB_NAME
|
||||
deprecated_var POSTGRESQL_SERVER_USER DB_USER
|
||||
deprecated_var POSTGRESQL_SERVER_PASS DB_PWD
|
||||
deprecated_var RABBITMQ_SERVER_URL AMQP_URI
|
||||
deprecated_var AMQP_SERVER_URL AMQP_URI
|
||||
deprecated_var AMQP_SERVER_TYPE AMQP_TYPE
|
||||
|
||||
METRICS_ENABLED="${METRICS_ENABLED:-false}"
|
||||
METRICS_HOST="${METRICS_HOST:-localhost}"
|
||||
METRICS_PORT="${METRICS_PORT:-8125}"
|
||||
METRICS_PREFIX="${METRICS_PREFIX:-.ds}"
|
||||
|
||||
DB_HOST=${DB_HOST:-${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}}
|
||||
case $DB_TYPE in
|
||||
"postgres")
|
||||
DB_PORT=${DB_PORT:-"5432"}
|
||||
;;
|
||||
"mariadb"|"mysql")
|
||||
DB_PORT=${DB_PORT:-"3306"}
|
||||
;;
|
||||
"")
|
||||
DB_PORT=${DB_PORT:-${POSTGRESQL_SERVER_PORT:-$(${JSON} services.CoAuthoring.sql.dbPort)}}
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown database type"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
DB_NAME=${DB_NAME:-${POSTGRESQL_SERVER_DB_NAME:-$(${JSON} services.CoAuthoring.sql.dbName)}}
|
||||
DB_USER=${DB_USER:-${POSTGRESQL_SERVER_USER:-$(${JSON} services.CoAuthoring.sql.dbUser)}}
|
||||
DB_PWD=${DB_PWD:-${POSTGRESQL_SERVER_PASS:-$(${JSON} services.CoAuthoring.sql.dbPass)}}
|
||||
DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)}
|
||||
|
||||
RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)}
|
||||
AMQP_SERVER_URL=${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}
|
||||
AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq}
|
||||
parse_rabbitmq_url ${AMQP_SERVER_URL}
|
||||
AMQP_URI=${AMQP_URI:-${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}}
|
||||
AMQP_TYPE=${AMQP_TYPE:-${AMQP_SERVER_TYPE:-rabbitmq}}
|
||||
parse_rabbitmq_url ${AMQP_URI}
|
||||
|
||||
REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)}
|
||||
REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379}
|
||||
@ -74,6 +127,12 @@ read_setting(){
|
||||
DS_LOG_LEVEL=${DS_LOG_LEVEL:-$(${JSON_LOG} categories.default.level)}
|
||||
}
|
||||
|
||||
deprecated_var() {
|
||||
if [[ -n ${!1} ]]; then
|
||||
echo "Variable $1 is deprecated. Use $2 instead."
|
||||
fi
|
||||
}
|
||||
|
||||
parse_rabbitmq_url(){
|
||||
local amqp=$1
|
||||
|
||||
@ -123,8 +182,8 @@ waiting_for_connection(){
|
||||
done
|
||||
}
|
||||
|
||||
waiting_for_postgresql(){
|
||||
waiting_for_connection ${POSTGRESQL_SERVER_HOST} ${POSTGRESQL_SERVER_PORT}
|
||||
waiting_for_db(){
|
||||
waiting_for_connection $DB_HOST $DB_PORT
|
||||
}
|
||||
|
||||
waiting_for_amqp(){
|
||||
@ -137,22 +196,32 @@ waiting_for_redis(){
|
||||
waiting_for_datacontainer(){
|
||||
waiting_for_connection ${ONLYOFFICE_DATA_CONTAINER_HOST} ${ONLYOFFICE_DATA_CONTAINER_PORT}
|
||||
}
|
||||
update_postgresql_settings(){
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbHost = '${POSTGRESQL_SERVER_HOST}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbPort = '${POSTGRESQL_SERVER_PORT}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbName = '${POSTGRESQL_SERVER_DB_NAME}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbUser = '${POSTGRESQL_SERVER_USER}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbPass = '${POSTGRESQL_SERVER_PASS}'"
|
||||
|
||||
update_statsd_settings(){
|
||||
${JSON} -I -e "if(this.statsd===undefined)this.statsd={};"
|
||||
${JSON} -I -e "this.statsd.useMetrics = '${METRICS_ENABLED}'"
|
||||
${JSON} -I -e "this.statsd.host = '${METRICS_HOST}'"
|
||||
${JSON} -I -e "this.statsd.port = '${METRICS_PORT}'"
|
||||
${JSON} -I -e "this.statsd.prefix = '${METRICS_PREFIX}'"
|
||||
}
|
||||
|
||||
update_db_settings(){
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.type = '${DB_TYPE}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbHost = '${DB_HOST}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbPort = '${DB_PORT}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbName = '${DB_NAME}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbUser = '${DB_USER}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.sql.dbPass = '${DB_PWD}'"
|
||||
}
|
||||
|
||||
update_rabbitmq_setting(){
|
||||
if [ "${AMQP_SERVER_TYPE}" == "rabbitmq" ]; then
|
||||
if [ "${AMQP_TYPE}" == "rabbitmq" ]; then
|
||||
${JSON} -I -e "if(this.queue===undefined)this.queue={};"
|
||||
${JSON} -I -e "this.queue.type = 'rabbitmq'"
|
||||
${JSON} -I -e "this.rabbitmq.url = '${AMQP_SERVER_URL}'"
|
||||
${JSON} -I -e "this.rabbitmq.url = '${AMQP_URI}'"
|
||||
fi
|
||||
|
||||
if [ "${AMQP_SERVER_TYPE}" == "activemq" ]; then
|
||||
if [ "${AMQP_TYPE}" == "activemq" ]; then
|
||||
${JSON} -I -e "if(this.queue===undefined)this.queue={};"
|
||||
${JSON} -I -e "this.queue.type = 'activemq'"
|
||||
${JSON} -I -e "if(this.activemq===undefined)this.activemq={};"
|
||||
@ -194,7 +263,7 @@ update_redis_settings(){
|
||||
${JSON} -I -e "this.services.CoAuthoring.redis.port = '${REDIS_SERVER_PORT}'"
|
||||
}
|
||||
|
||||
update_jwt_settings(){
|
||||
update_ds_settings(){
|
||||
if [ "${JWT_ENABLED}" == "true" ]; then
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.enable.browser = ${JWT_ENABLED}"
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.enable.request.inbox = ${JWT_ENABLED}"
|
||||
@ -207,12 +276,20 @@ update_jwt_settings(){
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.inbox.header = '${JWT_HEADER}'"
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.outbox.header = '${JWT_HEADER}'"
|
||||
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}"
|
||||
${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}"
|
||||
|
||||
if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ] && [ "${JWT_ENABLED}" == "true" ]; then
|
||||
${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}"
|
||||
${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'"
|
||||
${JSON_EXAMPLE} -I -e "this.server.token.authorizationHeader = '${JWT_HEADER}'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${USE_UNAUTHORIZED_STORAGE}" == "true" ]; then
|
||||
${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults===undefined)this.services.CoAuthoring.requestDefaults={}"
|
||||
${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults.rejectUnauthorized===undefined)this.services.CoAuthoring.requestDefaults.rejectUnauthorized=false"
|
||||
fi
|
||||
}
|
||||
|
||||
create_postgresql_cluster(){
|
||||
@ -227,26 +304,60 @@ create_postgresql_cluster(){
|
||||
}
|
||||
|
||||
create_postgresql_db(){
|
||||
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;"
|
||||
sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;"
|
||||
sudo -u postgres psql -c "CREATE USER $DB_USER WITH password '"$DB_PWD"';"
|
||||
sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE $DB_NAME TO $DB_USER;"
|
||||
}
|
||||
|
||||
create_postgresql_tbl(){
|
||||
CONNECTION_PARAMS="-h${POSTGRESQL_SERVER_HOST} -p${POSTGRESQL_SERVER_PORT} -U${POSTGRESQL_SERVER_USER} -w"
|
||||
if [ -n "${POSTGRESQL_SERVER_PASS}" ]; then
|
||||
export PGPASSWORD=${POSTGRESQL_SERVER_PASS}
|
||||
create_db_tbl() {
|
||||
case $DB_TYPE in
|
||||
"postgres")
|
||||
create_postgresql_tbl
|
||||
;;
|
||||
"mariadb"|"mysql")
|
||||
create_mysql_tbl
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
create_postgresql_tbl() {
|
||||
CONNECTION_PARAMS="-h$DB_HOST -p$DB_PORT -U$DB_USER -w"
|
||||
if [ -n "$DB_PWD" ]; then
|
||||
export PGPASSWORD=$DB_PWD
|
||||
fi
|
||||
|
||||
PSQL="psql -q $CONNECTION_PARAMS"
|
||||
CREATEDB="createdb $CONNECTION_PARAMS"
|
||||
|
||||
# Create db on remote server
|
||||
if $PSQL -lt | cut -d\| -f 1 | grep -qw | grep 0; then
|
||||
$CREATEDB $POSTGRESQL_SERVER_DB_NAME
|
||||
if $PSQL -lt | cut -d\| -f 1 | grep -qw $DB_NAME | grep 0; then
|
||||
$CREATEDB $DB_NAME
|
||||
fi
|
||||
|
||||
$PSQL -d "${POSTGRESQL_SERVER_DB_NAME}" -f "${APP_DIR}/server/schema/postgresql/createdb.sql"
|
||||
$PSQL -d "$DB_NAME" -f "$APP_DIR/server/schema/postgresql/createdb.sql"
|
||||
}
|
||||
|
||||
create_mysql_tbl() {
|
||||
CONNECTION_PARAMS="-h$DB_HOST -P$DB_PORT -u$DB_USER -p$DB_PWD -w"
|
||||
MYSQL="mysql -q $CONNECTION_PARAMS"
|
||||
|
||||
# Create db on remote server
|
||||
$MYSQL -e "CREATE DATABASE IF NOT EXISTS $DB_NAME DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;" >/dev/null 2>&1
|
||||
|
||||
$MYSQL $DB_NAME < "$APP_DIR/server/schema/mysql/createdb.sql" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
update_welcome_page() {
|
||||
WELCOME_PAGE="${APP_DIR}-example/welcome/docker.html"
|
||||
if [[ -e $WELCOME_PAGE ]]; then
|
||||
DOCKER_CONTAINER_ID=$(basename $(cat /proc/1/cpuset))
|
||||
if [[ -x $(command -v docker) ]]; then
|
||||
DOCKER_CONTAINER_NAME=$(docker inspect --format="{{.Name}}" $DOCKER_CONTAINER_ID)
|
||||
sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_NAME#/}"'/' -i $WELCOME_PAGE
|
||||
else
|
||||
sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_ID::12}"'/' -i $WELCOME_PAGE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
update_nginx_settings(){
|
||||
@ -314,15 +425,15 @@ update_logrotate_settings(){
|
||||
}
|
||||
|
||||
# create base folders
|
||||
for i in converter docservice spellchecker metrics gc; do
|
||||
for i in converter docservice spellchecker metrics; do
|
||||
mkdir -p "${DS_LOG_DIR}/$i"
|
||||
done
|
||||
|
||||
mkdir -p ${DS_LOG_DIR}-example
|
||||
|
||||
# create app folders
|
||||
for i in App_Data/cache/files App_Data/docbuilder; do
|
||||
mkdir -p "${DS_LIB_DIR}/$i"
|
||||
for i in ${DS_LIB_DIR}/App_Data/cache/files ${DS_LIB_DIR}/App_Data/docbuilder ${DS_LIB_DIR}-example/files; do
|
||||
mkdir -p "$i"
|
||||
done
|
||||
|
||||
# change folder rights
|
||||
@ -335,15 +446,21 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
|
||||
|
||||
read_setting
|
||||
|
||||
if [ $METRICS_ENABLED = "true" ]; then
|
||||
update_statsd_settings
|
||||
fi
|
||||
|
||||
update_welcome_page
|
||||
|
||||
update_log_settings
|
||||
|
||||
update_jwt_settings
|
||||
update_ds_settings
|
||||
|
||||
# update settings by env variables
|
||||
if [ ${POSTGRESQL_SERVER_HOST} != "localhost" ]; then
|
||||
update_postgresql_settings
|
||||
waiting_for_postgresql
|
||||
create_postgresql_tbl
|
||||
if [ $DB_HOST != "localhost" ]; then
|
||||
update_db_settings
|
||||
waiting_for_db
|
||||
create_db_tbl
|
||||
else
|
||||
# change rights for postgres directory
|
||||
chown -R postgres:postgres ${PG_ROOT}
|
||||
@ -360,15 +477,28 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
|
||||
if [ ${AMQP_SERVER_HOST} != "localhost" ]; then
|
||||
update_rabbitmq_setting
|
||||
else
|
||||
# change rights for rabbitmq directory
|
||||
chown -R rabbitmq:rabbitmq ${RABBITMQ_DATA}
|
||||
chmod -R go=rX,u=rwX ${RABBITMQ_DATA}
|
||||
if [ -f ${RABBITMQ_DATA}/.erlang.cookie ]; then
|
||||
chmod 400 ${RABBITMQ_DATA}/.erlang.cookie
|
||||
fi
|
||||
|
||||
LOCAL_SERVICES+=("rabbitmq-server")
|
||||
# allow Rabbitmq startup after container kill
|
||||
rm -rf /var/run/rabbitmq
|
||||
fi
|
||||
|
||||
if [ ${REDIS_SERVER_HOST} != "localhost" ]; then
|
||||
update_redis_settings
|
||||
else
|
||||
LOCAL_SERVICES+=("redis-server")
|
||||
if [ ${REDIS_ENABLED} = "true" ]; then
|
||||
if [ ${REDIS_SERVER_HOST} != "localhost" ]; then
|
||||
update_redis_settings
|
||||
else
|
||||
# change rights for redis directory
|
||||
chown -R redis:redis ${REDIS_DATA}
|
||||
chmod -R 750 ${REDIS_DATA}
|
||||
|
||||
LOCAL_SERVICES+=("redis-server")
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# no need to update settings just wait for remote data
|
||||
@ -377,6 +507,8 @@ else
|
||||
# read settings after the data container in ready state
|
||||
# to prevent get unconfigureted data
|
||||
read_setting
|
||||
|
||||
update_welcome_page
|
||||
fi
|
||||
|
||||
#start needed local services
|
||||
@ -390,9 +522,11 @@ if [ ${PG_NEW_CLUSTER} = "true" ]; then
|
||||
fi
|
||||
|
||||
if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then
|
||||
waiting_for_postgresql
|
||||
waiting_for_db
|
||||
waiting_for_amqp
|
||||
waiting_for_redis
|
||||
if [ ${REDIS_ENABLED} = "true" ]; then
|
||||
waiting_for_redis
|
||||
fi
|
||||
|
||||
update_nginx_settings
|
||||
|
||||
@ -412,4 +546,5 @@ service nginx start
|
||||
documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER}
|
||||
documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}
|
||||
|
||||
tail -f /var/log/${COMPANY_NAME}/**/*.log
|
||||
tail -f /var/log/${COMPANY_NAME}/**/*.log &
|
||||
wait $!
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
version: '2'
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
image: onlyoffice/4testing-documentserver-ie:latest
|
||||
build:
|
||||
context: ../.
|
||||
environment:
|
||||
- AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-activemq
|
||||
- AMQP_SERVER_TYPE=activemq
|
||||
- AMQP_TYPE=${AMQP_TYPE:-activemq}
|
||||
- AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-activemq}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
@ -16,10 +17,10 @@ services:
|
||||
|
||||
onlyoffice-activemq:
|
||||
container_name: onlyoffice-activemq
|
||||
image: webcenter/activemq:5.14.3
|
||||
image: webcenter/activemq:${ACTIVEMQ_VERSION:-5.14.3}
|
||||
environment:
|
||||
- ACTIVEMQ_USERS_guest=guest
|
||||
- ACTIVEMQ_GROUPS_owners=guest
|
||||
- ACTIVEMQ_USERS_guest=${ACTIVEMQ_USERS_guest:-guest}
|
||||
- ACTIVEMQ_GROUPS_owners=${ACTIVEMQ_GROUPS_owners:-guest}
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
18
tests/certs-customized.yml
Normal file
18
tests/certs-customized.yml
Normal file
@ -0,0 +1,18 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
environment:
|
||||
- SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-/var/www/onlyoffice/Data/certs/tls.crt}
|
||||
- SSL_KEY_PATH=${SSL_KEY_PATH:-/var/www/onlyoffice/Data/certs/tls.key}
|
||||
- CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-/var/www/onlyoffice/Data/certs/ca-certificates.pem}
|
||||
- SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-/var/www/onlyoffice/Data/certs/dhparam.pem}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
volumes:
|
||||
- ./data:/var/www/onlyoffice/Data
|
||||
13
tests/certs.yml
Normal file
13
tests/certs.yml
Normal file
@ -0,0 +1,13 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
volumes:
|
||||
- ./data:/var/www/onlyoffice/Data
|
||||
32
tests/graphite.yml
Normal file
32
tests/graphite.yml
Normal file
@ -0,0 +1,32 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
depends_on:
|
||||
- onlyoffice-graphite
|
||||
environment:
|
||||
- METRICS_ENABLED=${METRICS_ENABLED:-true}
|
||||
- METRICS_HOST=${METRICS_HOST:-localhost}
|
||||
- METRICS_PORT=${METRICS_PORT:-8125}
|
||||
- METRICS_PREFIX=${METRICS_PREFIX:-ds.}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
expose:
|
||||
- '2003'
|
||||
ports:
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ./graphite/statsd:/var/www/onlyoffice/documentserver/server/Metrics/config
|
||||
|
||||
onlyoffice-graphite:
|
||||
container_name: onlyoffice-graphite
|
||||
image: graphiteapp/graphite-statsd
|
||||
environment:
|
||||
- GRAPHITE_STATSD_HOST=${GRAPHITE_STATSD_HOST:-onlyoffice-documentserver}
|
||||
- GRAPHITE_TIME_ZONE=${GRAPHITE_TIME_ZONE:-Etc/UTC}
|
||||
ports:
|
||||
- '8888:80'
|
||||
stdin_open: true
|
||||
restart: always
|
||||
7
tests/graphite/statsd/config.js
Normal file
7
tests/graphite/statsd/config.js
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"graphiteHost": "onlyoffice-graphite",
|
||||
"graphitePort": 2003,
|
||||
"port": 8125,
|
||||
"flushInterval": 60000,
|
||||
"backends": [ "./backends/graphite.js" ]
|
||||
}
|
||||
36
tests/mariadb.yml
Normal file
36
tests/mariadb.yml
Normal file
@ -0,0 +1,36 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
ds:
|
||||
container_name: ds
|
||||
build:
|
||||
context: ../.
|
||||
depends_on:
|
||||
- onlyoffice-mariadb
|
||||
environment:
|
||||
- DB_TYPE=${DB_TYPE:-mysql}
|
||||
- DB_HOST=${DB_HOST:-onlyoffice-mariadb}
|
||||
- DB_PORT=${DB_PORT:-3306}
|
||||
- DB_NAME=${DB_NAME:-onlyoffice}
|
||||
- DB_USER=${DB_USER:-onlyoffice}
|
||||
- DB_PWD=${DB_PWD:-onlyoffice}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
|
||||
onlyoffice-mariadb:
|
||||
container_name: onlyoffice-mariadb
|
||||
image: mariadb:${MARIADB_VERSION:-10.5}
|
||||
environment:
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice}
|
||||
- MYSQL_USER=${MYSQL_USER:-onlyoffice}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice}
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes}
|
||||
restart: always
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
expose:
|
||||
- '3306'
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
37
tests/mysql.yml
Normal file
37
tests/mysql.yml
Normal file
@ -0,0 +1,37 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
depends_on:
|
||||
- onlyoffice-mysql
|
||||
environment:
|
||||
- DB_TYPE=${DB_TYPE:-mysql}
|
||||
- DB_HOST=${DB_HOST:-onlyoffice-mysql}
|
||||
- DB_PORT=${DB_PORT:-3306}
|
||||
- DB_NAME=${DB_NAME:-onlyoffice}
|
||||
- DB_USER=${DB_USER:-onlyoffice}
|
||||
- DB_PWD=${DB_PWD:-onlyoffice}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
|
||||
onlyoffice-mysql:
|
||||
container_name: onlyoffice-mysql
|
||||
image: mysql:${MYSQL_VERSION:-5.7}
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
environment:
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice}
|
||||
- MYSQL_USER=${MYSQL_USER:-onlyoffice}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice}
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes}
|
||||
restart: always
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
expose:
|
||||
- '3306'
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
34
tests/postgres-old.yml
Normal file
34
tests/postgres-old.yml
Normal file
@ -0,0 +1,34 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
depends_on:
|
||||
- onlyoffice-postgresql
|
||||
environment:
|
||||
- POSTGRESQL_SERVER_HOST=${DB_HOST:-onlyoffice-postgresql}
|
||||
- POSTGRESQL_SERVER_PORT=${DB_PORT:-5432}
|
||||
- POSTGRESQL_SERVER_DB_NAME=${DB_NAME:-onlyoffice}
|
||||
- POSTGRESQL_SERVER_USER=${DB_USER:-onlyoffice}
|
||||
- POSTGRESQL_SERVER_PASS=${DB_PWD:-onlyoffice}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
|
||||
onlyoffice-postgresql:
|
||||
container_name: onlyoffice-postgresql
|
||||
image: postgres:9.5
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-onlyoffice}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-onlyoffice}
|
||||
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
|
||||
restart: always
|
||||
expose:
|
||||
- '5432'
|
||||
volumes:
|
||||
- postgresql_data:/var/lib/postgresql
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
35
tests/postgres.yml
Normal file
35
tests/postgres.yml
Normal file
@ -0,0 +1,35 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
depends_on:
|
||||
- onlyoffice-postgresql
|
||||
environment:
|
||||
- DB_TYPE=${DB_TYPE:-postgres}
|
||||
- DB_HOST=${DB_HOST:-onlyoffice-postgresql}
|
||||
- DB_PORT=${DB_PORT:-5432}
|
||||
- DB_NAME=${DB_NAME:-onlyoffice}
|
||||
- DB_USER=${DB_USER:-onlyoffice}
|
||||
- DB_PWD=${DB_PWD:-onlyoffice}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
|
||||
onlyoffice-postgresql:
|
||||
container_name: onlyoffice-postgresql
|
||||
image: postgres:${POSTGRES_VERSION:-9.5}
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-onlyoffice}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-onlyoffice}
|
||||
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
|
||||
restart: always
|
||||
expose:
|
||||
- '5432'
|
||||
volumes:
|
||||
- postgresql_data:/var/lib/postgresql
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
29
tests/rabbitmq-old.yml
Normal file
29
tests/rabbitmq-old.yml
Normal file
@ -0,0 +1,29 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
environment:
|
||||
- AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq}
|
||||
- AMQP_SERVER_URL=${AMQP_SERVER_URL:-amqp://guest:guest@onlyoffice-rabbitmq}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
networks:
|
||||
- onlyoffice
|
||||
|
||||
onlyoffice-rabbitmq:
|
||||
container_name: onlyoffice-rabbitmq
|
||||
image: rabbitmq
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '5672'
|
||||
|
||||
networks:
|
||||
onlyoffice:
|
||||
driver: 'bridge'
|
||||
29
tests/rabbitmq.yml
Normal file
29
tests/rabbitmq.yml
Normal file
@ -0,0 +1,29 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
environment:
|
||||
- AMQP_TYPE=${AMQP_TYPE:-rabbitmq}
|
||||
- AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-rabbitmq}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
networks:
|
||||
- onlyoffice
|
||||
|
||||
onlyoffice-rabbitmq:
|
||||
container_name: onlyoffice-rabbitmq
|
||||
image: rabbitmq:${RABBITMQ_VERSION:-latest}
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '5672'
|
||||
|
||||
networks:
|
||||
onlyoffice:
|
||||
driver: 'bridge'
|
||||
31
tests/redis.yml
Normal file
31
tests/redis.yml
Normal file
@ -0,0 +1,31 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
args:
|
||||
- PRODUCT_NAME=${PRODUCT_NAME:-documentserver}
|
||||
environment:
|
||||
- REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-onlyoffice-redis}
|
||||
- REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
- '443:443'
|
||||
networks:
|
||||
- onlyoffice
|
||||
|
||||
onlyoffice-redis:
|
||||
container_name: onlyoffice-redis
|
||||
image: redis:${REDIS_VERSION:-latest}
|
||||
restart: always
|
||||
networks:
|
||||
- onlyoffice
|
||||
expose:
|
||||
- '6379'
|
||||
|
||||
networks:
|
||||
onlyoffice:
|
||||
driver: 'bridge'
|
||||
12
tests/standalone.yml
Normal file
12
tests/standalone.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: '2.1'
|
||||
services:
|
||||
onlyoffice-documentserver:
|
||||
container_name: onlyoffice-documentserver
|
||||
build:
|
||||
context: ../.
|
||||
args:
|
||||
- PRODUCT_NAME=${PRODUCT_NAME:-documentserver}
|
||||
stdin_open: true
|
||||
restart: always
|
||||
ports:
|
||||
- '80:80'
|
||||
54
tests/test.sh
Executable file
54
tests/test.sh
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
ssl=${ssl:-false}
|
||||
private_key=${private_key:-tls.key}
|
||||
certificate_request=${certificate_request:-tls.csr}
|
||||
certificate=${certificate:-tls.crt}
|
||||
|
||||
# Generate certificate
|
||||
if [[ $ssl == "true" ]]; then
|
||||
url=${url:-"https://localhost"}
|
||||
|
||||
mkdir -p data/certs
|
||||
pushd data/certs
|
||||
|
||||
openssl genrsa -out ${private_key} 2048
|
||||
openssl req \
|
||||
-new \
|
||||
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \
|
||||
-key ${private_key} \
|
||||
-out ${certificate_request}
|
||||
openssl x509 -req -days 365 -in ${certificate_request} -signkey ${private_key} -out ${certificate}
|
||||
openssl dhparam -out dhparam.pem 2048
|
||||
chmod 400 ${private_key}
|
||||
|
||||
popd
|
||||
else
|
||||
url=${url:-"http://localhost"}
|
||||
fi
|
||||
|
||||
# Check if the yml exists
|
||||
if [[ ! -f $config ]]; then
|
||||
echo "File $config doesn't exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run test environment
|
||||
docker-compose -p ds -f $config up -d
|
||||
|
||||
wakeup_timeout=30
|
||||
|
||||
# Get documentserver healthcheck status
|
||||
echo "Wait for service wake up"
|
||||
sleep $wakeup_timeout
|
||||
healthcheck_res=$(wget --no-check-certificate -qO - ${url}/healthcheck)
|
||||
|
||||
# Fail if it isn't true
|
||||
if [[ $healthcheck_res == "true" ]]; then
|
||||
echo "Healthcheck passed."
|
||||
else
|
||||
echo "Healthcheck failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker-compose -p ds -f $config down
|
||||
Reference in New Issue
Block a user