Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker-onlyoffice-documentserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
docker-onlyoffice-documentserver
Commits
f8180d13
Commit
f8180d13
authored
6 years ago
by
Alexey Golubev
Committed by
Alexey Golubev
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add amqp server params
parent
fbc9f8d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run-document-server.sh
+43
-11
43 additions, 11 deletions
run-document-server.sh
with
43 additions
and
11 deletions
run-document-server.sh
+
43
−
11
View file @
f8180d13
...
@@ -62,7 +62,9 @@ read_setting(){
...
@@ -62,7 +62,9 @@ read_setting(){
POSTGRESQL_SERVER_PASS
=
${
POSTGRESQL_SERVER_PASS
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPass
)
}
POSTGRESQL_SERVER_PASS
=
${
POSTGRESQL_SERVER_PASS
:-
$(
${
JSON
}
services.CoAuthoring.sql.dbPass
)
}
RABBITMQ_SERVER_URL
=
${
RABBITMQ_SERVER_URL
:-
$(
${
JSON
}
rabbitmq.url
)
}
RABBITMQ_SERVER_URL
=
${
RABBITMQ_SERVER_URL
:-
$(
${
JSON
}
rabbitmq.url
)
}
parse_rabbitmq_url
AMQP_SERVER_URL
=
${
AMQP_SERVER_URL
:-${
RABBITMQ_SERVER_URL
}}
AMQP_SERVER_ENGINE
=
${
AMQP_SERVER_ENGINE
:-
rabbitmq
}
parse_rabbitmq_url
${
AMQP_SERVER_URL
}
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
}
...
@@ -71,7 +73,7 @@ read_setting(){
...
@@ -71,7 +73,7 @@ read_setting(){
}
}
parse_rabbitmq_url
(){
parse_rabbitmq_url
(){
local
amqp
=
$
{
RABBITMQ_SERVER_URL
}
local
amqp
=
$
1
# extract the protocol
# extract the protocol
local
proto
=
"
$(
echo
$amqp
|
grep
:// |
sed
-e
's,^\(.*://\).*,\1,g'
)
"
local
proto
=
"
$(
echo
$amqp
|
grep
:// |
sed
-e
's,^\(.*://\).*,\1,g'
)
"
...
@@ -105,10 +107,10 @@ parse_rabbitmq_url(){
...
@@ -105,10 +107,10 @@ parse_rabbitmq_url(){
# extract the path (if any)
# extract the path (if any)
local
path
=
"
$(
echo
$url
|
grep
/ |
cut
-d
/
-f2-
)
"
local
path
=
"
$(
echo
$url
|
grep
/ |
cut
-d
/
-f2-
)
"
RABBIT
MQ_SERVER_HOST
=
$host
A
MQ
P
_SERVER_HOST
=
$host
RABBIT
MQ_SERVER_USER
=
$user
A
MQ
P
_SERVER_USER
=
$user
RABBIT
MQ_SERVER_PASS
=
$pass
A
MQ
P
_SERVER_PASS
=
$pass
RABBIT
MQ_SERVER_PORT
=
$port
A
MQ
P
_SERVER_PORT
=
$port
}
}
waiting_for_connection
(){
waiting_for_connection
(){
...
@@ -122,8 +124,8 @@ waiting_for_postgresql(){
...
@@ -122,8 +124,8 @@ waiting_for_postgresql(){
waiting_for_connection
${
POSTGRESQL_SERVER_HOST
}
${
POSTGRESQL_SERVER_PORT
}
waiting_for_connection
${
POSTGRESQL_SERVER_HOST
}
${
POSTGRESQL_SERVER_PORT
}
}
}
waiting_for_
rabbit
mq
(){
waiting_for_
a
mq
p
(){
waiting_for_connection
${
RABBIT
MQ_SERVER_HOST
}
${
RABBIT
MQ_SERVER_PORT
}
waiting_for_connection
${
A
MQ
P
_SERVER_HOST
}
${
A
MQ
P
_SERVER_PORT
}
}
}
waiting_for_redis
(){
waiting_for_redis
(){
...
@@ -141,7 +143,37 @@ update_postgresql_settings(){
...
@@ -141,7 +143,37 @@ update_postgresql_settings(){
}
}
update_rabbitmq_setting
(){
update_rabbitmq_setting
(){
${
JSON
}
-I
-e
"this.rabbitmq.url = '
${
RABBITMQ_SERVER_URL
}
'"
if
[
"
${
AMQP_SERVER_ENGINE
}
"
==
"rabbitmq"
]
;
then
${
JSON
}
-I
-e
"this.rabbitmq.url = '
${
RABBITMQ_SERVER_URL
}
'"
sed
's/\(exports\.USE_RABBIT_MQ = \).*\(;\)/'
"
\1
true
\2
"
'/'
-i
${
APP_DIR
}
/server/Common/sources/constants.js
fi
if
[
"
${
AMQP_SERVER_ENGINE
}
"
==
"activemq"
]
;
then
${
JSON
}
-I
-e
"if(this.activemq===undefined)this.activemq={};"
${
JSON
}
-I
-e
"if(this.activemq.connectOptions===undefined)this.activemq.connectOptions={};"
${
JSON
}
-I
-e
"this.activemq.connectOptions.host = '
${
AMQP_SERVER_HOST
}
'"
if
[
!
"
${
AMQP_SERVER_PORT
}
"
==
""
]
;
then
${
JSON
}
-I
-e
"this.activemq.connectOptions.port = '
${
AMQP_SERVER_PORT
}
'"
else
${
JSON
}
-I
-e
"delete this.activemq.connectOptions.port"
fi
if
[
!
"
${
AMQP_SERVER_USER
}
"
==
""
]
;
then
${
JSON
}
-I
-e
"this.activemq.connectOptions.username = '
${
AMQP_SERVER_USER
}
'"
else
${
JSON
}
-I
-e
"delete this.activemq.connectOptions.username"
fi
if
[
!
"
${
AMQP_SERVER_PASS
}
"
==
""
]
;
then
${
JSON
}
-I
-e
"this.activemq.connectOptions.password = '
${
AMQP_SERVER_PASS
}
'"
else
${
JSON
}
-I
-e
"delete this.activemq.connectOptions.password"
fi
sed
's/\(exports\.USE_RABBIT_MQ = \).*\(;\)/'
"
\1
false
\2
"
'/'
-i
${
APP_DIR
}
/server/Common/sources/constants.js
fi
}
}
update_redis_settings
(){
update_redis_settings
(){
...
@@ -302,7 +334,7 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
...
@@ -302,7 +334,7 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
LOCAL_SERVICES+
=(
"postgresql"
)
LOCAL_SERVICES+
=(
"postgresql"
)
fi
fi
if
[
${
RABBIT
MQ_SERVER_HOST
}
!=
"localhost"
]
;
then
if
[
${
A
MQ
P
_SERVER_HOST
}
!=
"localhost"
]
;
then
update_rabbitmq_setting
update_rabbitmq_setting
else
else
LOCAL_SERVICES+
=(
"rabbitmq-server"
)
LOCAL_SERVICES+
=(
"rabbitmq-server"
)
...
@@ -336,7 +368,7 @@ fi
...
@@ -336,7 +368,7 @@ fi
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
if
[
${
ONLYOFFICE_DATA_CONTAINER
}
!=
"true"
]
;
then
waiting_for_postgresql
waiting_for_postgresql
waiting_for_
rabbit
mq
waiting_for_
a
mq
p
waiting_for_redis
waiting_for_redis
update_nginx_settings
update_nginx_settings
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment