diff --git a/.travis.yml b/.travis.yml index 5877421..c96efd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,11 @@ env: AMQP_SERVER_TYPE: activemq AMQP_SERVER_URL: amqp://guest:guest@onlyoffice-activemq + # amqp variables + - config: amqp.yml + AMQP_TYPE: activemq + AMQP_URL: amqp://guest:guest@onlyoffice-activemq + services: - docker diff --git a/README.md b/README.md index 29e3a46..7bbfa29 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ Below is the complete list of parameters that can be set using environment varia - **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_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`. +- **AMQP_URL**: The [AMQP URL](http://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. diff --git a/docker-compose.yml b/docker-compose.yml index 6e73ff5..ce7f285 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: - DB_PORT=5432 - DB_NAME=onlyoffice - DB_USER=onlyoffice - - AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq + - AMQP_URL=amqp://guest:guest@onlyoffice-rabbitmq - REDIS_SERVER_HOST=onlyoffice-redis - REDIS_SERVER_PORT=6379 # Uncomment strings below to enable the JSON Web Token validation. diff --git a/run-document-server.sh b/run-document-server.sh index d61be11..94c4d9a 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -87,9 +87,9 @@ read_setting(){ 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_URL=${AMQP_URL:-${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}} + AMQP_TYPE=${AMQP_TYPE:-${AMQP_SERVER_TYPE:-rabbitmq}} + parse_rabbitmq_url ${AMQP_URL} REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)} REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} @@ -176,13 +176,13 @@ update_db_settings(){ } 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_URL}'" 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={};" diff --git a/tests/amqp.yml b/tests/amqp.yml new file mode 100644 index 0000000..468efee --- /dev/null +++ b/tests/amqp.yml @@ -0,0 +1,31 @@ +version: '2' +services: + onlyoffice-documentserver: + container_name: onlyoffice-documentserver + image: onlyoffice/4testing-documentserver-ie:latest + environment: + - AMQP_TYPE + - AMQP_URL + stdin_open: true + restart: always + ports: + - '80:80' + - '443:443' + networks: + - onlyoffice + + onlyoffice-activemq: + container_name: onlyoffice-activemq + image: webcenter/activemq:5.14.3 + environment: + - ACTIVEMQ_USERS_guest + - ACTIVEMQ_GROUPS_owners + restart: always + networks: + - onlyoffice + expose: + - '5672' + +networks: + onlyoffice: + driver: 'bridge' diff --git a/tests/defaults.env b/tests/defaults.env index 664f342..1ddf9ae 100644 --- a/tests/defaults.env +++ b/tests/defaults.env @@ -6,8 +6,8 @@ DB_PORT=5432 DB_NAME=onlyoffice DB_USER=onlyoffice DB_PWD=onlyoffice -AMQP_SERVER_TYPE=rabbitmq -AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq +AMQP_TYPE=rabbitmq +AMQP_URL=amqp://guest:guest@onlyoffice-rabbitmq REDIS_SERVER_HOST=onlyoffice-redis REDIS_SERVER_PORT=6379 JWT_ENABLED=true