From ad4b496181ae9c05b6d8db9810d98b6d789221a5 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 5 Mar 2019 18:12:54 +0300 Subject: [PATCH 1/6] Rename AMQP_SERVER_ENGINE->AMQP_SERVER_TYPE --- README.md | 2 +- activemq.yml | 2 +- run-document-server.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 524ca68..df1eb84 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Below is the complete list of parameters that can be set using environment varia - **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_ENGINE**: The message broker engine. Supported values are 'rabbitmq' or 'activemq'. Defaults to 'rabbitmq'. +- **AMQP_SERVER_TYPE**: The message broker engine. 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/activemq.yml b/activemq.yml index 4f39e77..f6a5fed 100644 --- a/activemq.yml +++ b/activemq.yml @@ -5,7 +5,7 @@ services: image: onlyoffice/4testing-documentserver-ie:latest environment: - AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-activemq - - AMQP_SERVER_ENGINE=activemq + - AMQP_SERVER_TYPE=activemq stdin_open: true restart: always ports: diff --git a/run-document-server.sh b/run-document-server.sh index 11aa8f4..82f1b85 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -64,7 +64,7 @@ read_setting(){ RABBITMQ_SERVER_URL=${RABBITMQ_SERVER_URL:-$(${JSON} rabbitmq.url)} AMQP_SERVER_URL=${AMQP_SERVER_URL:-${RABBITMQ_SERVER_URL}} - AMQP_SERVER_ENGINE=${AMQP_SERVER_ENGINE:-rabbitmq} + AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq} parse_rabbitmq_url ${AMQP_SERVER_URL} REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)} @@ -144,12 +144,12 @@ update_postgresql_settings(){ } update_rabbitmq_setting(){ - if [ "${AMQP_SERVER_ENGINE}" == "rabbitmq" ]; then + if [ "${AMQP_SERVER_TYPE}" == "rabbitmq" ]; then ${JSON} -I -e "this.rabbitmq.url = '${RABBITMQ_SERVER_URL}'" sed 's/\(exports\.USE_RABBIT_MQ = \).*\(;\)/'"\1true\2"'/' -i ${APP_DIR}/server/Common/sources/constants.js fi - if [ "${AMQP_SERVER_ENGINE}" == "activemq" ]; then + if [ "${AMQP_SERVER_TYPE}" == "activemq" ]; then ${JSON} -I -e "if(this.activemq===undefined)this.activemq={};" ${JSON} -I -e "if(this.activemq.connectOptions===undefined)this.activemq.connectOptions={};" From f999dd421450b8410000fdfbbb4f2fec58f5cdda Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 5 Mar 2019 18:14:50 +0300 Subject: [PATCH 2/6] Cosmetic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df1eb84..e438d83 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ Below is the complete list of parameters that can be set using environment varia - **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 engine. Supported values are 'rabbitmq' or 'activemq'. Defaults to 'rabbitmq'. +- **AMQP_SERVER_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. From 2c44e3833d2664a1de54c1d282602f4eece5ca4f Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 6 Mar 2019 12:30:54 +0300 Subject: [PATCH 3/6] Change setup amqp server type --- run-document-server.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 82f1b85..da091d9 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -145,11 +145,12 @@ update_postgresql_settings(){ update_rabbitmq_setting(){ if [ "${AMQP_SERVER_TYPE}" == "rabbitmq" ]; then + ${JSON} -I -e "this.queue.type = 'rabbitmq'" ${JSON} -I -e "this.rabbitmq.url = '${RABBITMQ_SERVER_URL}'" - sed 's/\(exports\.USE_RABBIT_MQ = \).*\(;\)/'"\1true\2"'/' -i ${APP_DIR}/server/Common/sources/constants.js fi if [ "${AMQP_SERVER_TYPE}" == "activemq" ]; then + ${JSON} -I -e "this.queue.type = 'activemq'" ${JSON} -I -e "if(this.activemq===undefined)this.activemq={};" ${JSON} -I -e "if(this.activemq.connectOptions===undefined)this.activemq.connectOptions={};" @@ -172,8 +173,6 @@ update_rabbitmq_setting(){ else ${JSON} -I -e "delete this.activemq.connectOptions.password" fi - - sed 's/\(exports\.USE_RABBIT_MQ = \).*\(;\)/'"\1false\2"'/' -i ${APP_DIR}/server/Common/sources/constants.js fi } From 796fce01cd09ada1a786791353f6b5d97ceed6a7 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Thu, 7 Mar 2019 15:21:52 +0300 Subject: [PATCH 4/6] Fix setup amqp type --- run-document-server.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run-document-server.sh b/run-document-server.sh index da091d9..008de7b 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -145,11 +145,13 @@ update_postgresql_settings(){ update_rabbitmq_setting(){ if [ "${AMQP_SERVER_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 = '${RABBITMQ_SERVER_URL}'" fi if [ "${AMQP_SERVER_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={};" ${JSON} -I -e "if(this.activemq.connectOptions===undefined)this.activemq.connectOptions={};" From 93a69e601da259f87f0d1943662f59d9298b605f Mon Sep 17 00:00:00 2001 From: leo-lb Date: Fri, 12 Jul 2019 11:15:37 +0200 Subject: [PATCH 5/6] Specify POSTGRESQL_SERVER_PORT for new databases (#170) --- run-document-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index c673029..bebec70 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -223,7 +223,7 @@ create_postgresql_db(){ } create_postgresql_tbl(){ - CONNECTION_PARAMS="-h${POSTGRESQL_SERVER_HOST} -U${POSTGRESQL_SERVER_USER} -w" + 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} fi From acc4da29d5a33896d695c43b531b1cf8e12b082a Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Mon, 19 Aug 2019 14:04:56 +0300 Subject: [PATCH 6/6] Remove sudo --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3065889..5d21695 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG)) $(DOCKER_TARGETS): $(DEB_REPO_DATA) - sudo docker build --build-arg REPO_URL=$(REPO_URL) --build-arg PRODUCT_NAME=$(COMPANY_NAME)-$(PRODUCT_NAME) -t $(subst $(COLON),:,$@) . &&\ + docker build --build-arg REPO_URL=$(REPO_URL) --build-arg PRODUCT_NAME=$(COMPANY_NAME)-$(PRODUCT_NAME) -t $(subst $(COLON),:,$@) . &&\ mkdir -p $$(dirname $@) &&\ echo "Done" > $@ @@ -40,7 +40,7 @@ clean: rm -rfv $(DOCKER_TARGETS) clean-docker: - sudo docker rmi -f $$(sudo docker images -q $(COMPANY_NAME)/*) || exit 0 + docker rmi -f $$(docker images -q $(COMPANY_NAME)/*) || exit 0 deploy: $(DOCKER_TARGETS) - $(foreach TARGET,$(DOCKER_TARGETS),sudo docker push $(subst $(COLON),:,$(TARGET));) + $(foreach TARGET,$(DOCKER_TARGETS),docker push $(subst $(COLON),:,$(TARGET));)