Skip to content

Allow for custom definitions file #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,11 @@ if [ "$1" = 'rabbitmq-server' ] && [ "$haveConfig" ]; then

fullConfig+=( "{ rabbit, $(rabbit_array "${rabbitConfig[@]}") }" )

# If management plugin is installed, then generate config consider this
# if management plugin is installed, generate config for it
# https://www.rabbitmq.com/management.html#configuration
if [ "$(rabbitmq-plugins list -m -e rabbitmq_management)" ]; then
rabbitManagementConfig=()

if [ "$haveManagementSslConfig" ]; then
IFS=$'\n'
rabbitManagementSslOptions=( $(rabbit_env_config 'management_ssl' "${sslConfigKeys[@]}") )
Expand All @@ -253,9 +256,22 @@ if [ "$1" = 'rabbitmq-server' ] && [ "$haveConfig" ]; then
'{ ssl, false }'
)
fi
rabbitManagementConfig+=(
"{ listener, $(rabbit_array "${rabbitManagementListenerConfig[@]}") }"
)

# if definitions file exists, then load it
# https://www.rabbitmq.com/management.html#load-definitions
managementDefinitionsFile='/etc/rabbitmq/definitions.json'
if [ -f "${managementDefinitionsFile}" ]; then
# see also https://github.com/docker-library/rabbitmq/pull/112#issuecomment-271485550
rabbitManagementConfig+=(
"{ load_definitions, \"$managementDefinitionsFile\" }"
)
fi

fullConfig+=(
"{ rabbitmq_management, $(rabbit_array "{ listener, $(rabbit_array "${rabbitManagementListenerConfig[@]}") }") }"
"{ rabbitmq_management, $(rabbit_array "${rabbitManagementConfig[@]}") }"
)
fi

Expand Down