Rename AMQP variables (#205)

This commit is contained in:
Roman Demidov 2019-12-23 12:27:47 +03:00 committed by Alexey Golubev
parent ee8fa827e3
commit 08bb07e2d0
8 changed files with 84 additions and 15 deletions

View file

@ -30,8 +30,18 @@ env:
# activemq # activemq
- config: activemq.yml - config: activemq.yml
AMQP_SERVER_TYPE: activemq AMQP_TYPE: activemq
AMQP_SERVER_URL: amqp://guest:guest@onlyoffice-activemq AMQP_URI: amqp://guest:guest@onlyoffice-activemq
# rabbitmq
- config: rabbitmq.yml
AMQP_TYPE: rabbitmq
AMQP_URI: amqp://guest:guest@onlyoffice-rabbitmq
# rabbitmq old variables
- config: rabbitmq-old.yml
AMQP_SERVER_TYPE: rabbitmq
AMQP_SERVER_URL: amqp://guest:guest@onlyoffice-rabbitmq
services: services:
- docker - docker

View file

@ -170,8 +170,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_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_USER**: The new user name with superuser permissions for the database account.
- **DB_PWD**: The password set 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_URI**: The [AMQP URI](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_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_HOST**: The IP address or the name of the host where the Redis server is running.
- **REDIS_SERVER_PORT**: The Redis server port number. - **REDIS_SERVER_PORT**: The Redis server port number.
- **NGINX_WORKER_PROCESSES**: Defines the number of nginx worker processes. - **NGINX_WORKER_PROCESSES**: Defines the number of nginx worker processes.

View file

@ -10,7 +10,7 @@ services:
- DB_PORT=5432 - DB_PORT=5432
- DB_NAME=onlyoffice - DB_NAME=onlyoffice
- DB_USER=onlyoffice - DB_USER=onlyoffice
- AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
- REDIS_SERVER_HOST=onlyoffice-redis - REDIS_SERVER_HOST=onlyoffice-redis
- REDIS_SERVER_PORT=6379 - REDIS_SERVER_PORT=6379
# Uncomment strings below to enable the JSON Web Token validation. # Uncomment strings below to enable the JSON Web Token validation.

View file

@ -66,6 +66,9 @@ read_setting(){
deprecated_var POSTGRESQL_SERVER_DB_NAME DB_NAME deprecated_var POSTGRESQL_SERVER_DB_NAME DB_NAME
deprecated_var POSTGRESQL_SERVER_USER DB_USER deprecated_var POSTGRESQL_SERVER_USER DB_USER
deprecated_var POSTGRESQL_SERVER_PASS DB_PWD 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
DB_HOST=${DB_HOST:-${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}} DB_HOST=${DB_HOST:-${POSTGRESQL_SERVER_HOST:-$(${JSON} services.CoAuthoring.sql.dbHost)}}
case $DB_TYPE in case $DB_TYPE in
@ -89,9 +92,9 @@ read_setting(){
DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)} DB_TYPE=${DB_TYPE:-$(${JSON} services.CoAuthoring.sql.type)}
RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)} RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)}
AMQP_SERVER_URL=${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}} AMQP_URI=${AMQP_URI:-${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}}}
AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq} AMQP_TYPE=${AMQP_TYPE:-${AMQP_SERVER_TYPE:-rabbitmq}}
parse_rabbitmq_url ${AMQP_SERVER_URL} parse_rabbitmq_url ${AMQP_URI}
REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)} REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)}
REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379}
@ -178,13 +181,13 @@ update_db_settings(){
} }
update_rabbitmq_setting(){ 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 "if(this.queue===undefined)this.queue={};"
${JSON} -I -e "this.queue.type = 'rabbitmq'" ${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 fi
if [ "${AMQP_SERVER_TYPE}" == "activemq" ]; then if [ "${AMQP_TYPE}" == "activemq" ]; then
${JSON} -I -e "if(this.queue===undefined)this.queue={};" ${JSON} -I -e "if(this.queue===undefined)this.queue={};"
${JSON} -I -e "this.queue.type = 'activemq'" ${JSON} -I -e "this.queue.type = 'activemq'"
${JSON} -I -e "if(this.activemq===undefined)this.activemq={};" ${JSON} -I -e "if(this.activemq===undefined)this.activemq={};"

View file

@ -4,8 +4,8 @@ services:
container_name: onlyoffice-documentserver container_name: onlyoffice-documentserver
image: onlyoffice/4testing-documentserver-ie:latest image: onlyoffice/4testing-documentserver-ie:latest
environment: environment:
- AMQP_SERVER_TYPE - AMQP_TYPE
- AMQP_SERVER_URL - AMQP_URI
stdin_open: true stdin_open: true
restart: always restart: always
ports: ports:

View file

@ -6,8 +6,8 @@ DB_PORT=5432
DB_NAME=onlyoffice DB_NAME=onlyoffice
DB_USER=onlyoffice DB_USER=onlyoffice
DB_PWD=onlyoffice DB_PWD=onlyoffice
AMQP_SERVER_TYPE=rabbitmq AMQP_TYPE=rabbitmq
AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
REDIS_SERVER_HOST=onlyoffice-redis REDIS_SERVER_HOST=onlyoffice-redis
REDIS_SERVER_PORT=6379 REDIS_SERVER_PORT=6379
JWT_ENABLED=true JWT_ENABLED=true

28
tests/rabbitmq-old.yml Normal file
View file

@ -0,0 +1,28 @@
version: '2'
services:
onlyoffice-documentserver:
container_name: onlyoffice-documentserver
image: onlyoffice/4testing-documentserver-ie:latest
environment:
- AMQP_SERVER_TYPE
- AMQP_SERVER_URL
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'

28
tests/rabbitmq.yml Normal file
View file

@ -0,0 +1,28 @@
version: '2'
services:
onlyoffice-documentserver:
container_name: onlyoffice-documentserver
image: onlyoffice/4testing-documentserver-ie:latest
environment:
- AMQP_TYPE
- AMQP_URI
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'