-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add support to override default_{user,pass,vhost}
and the Erlang cookie from the environment
#3299
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
michaelklishin
merged 4 commits into
master
from
add-env-vars-to-set-default-user-pass-vhost-and-erlang-cookie
Aug 11, 2021
Merged
Add support to override default_{user,pass,vhost}
and the Erlang cookie from the environment
#3299
michaelklishin
merged 4 commits into
master
from
add-env-vars-to-set-default-user-pass-vhost-and-erlang-cookie
Aug 11, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ANG_COOKIE vars Those environment variables are unset by default. The default values are set in the `rabbit` application environment and can be configured in the configuration file. However, the environment variables will take precedence over them respectively if they are set.
They are the equivalent of the `default_{user,pass,vhost}` configuration settings. Each set environment variable will take precedence over its configuration file counterpart. Fixes docker-library/rabbitmq#508.
It is the equivalent of the content of the Erlang cookie file. Note this variable IS the cookie value, NOT the path to a cookie file. If it is set, it will take precedence over the content of the Erlang cookie file. Fixes docker-library/rabbitmq#508.
5b99759
to
bd39027
Compare
deps/rabbit/apps/rabbitmq_prelaunch/src/rabbit_prelaunch_dist.erl
Outdated
Show resolved
Hide resolved
It works as expected: RABBITMQ_DEFAULT_VHOST=pr-3299-vhost RABBITMQ_DEFAULT_USER=pr-3299 RABBITMQ_DEFAULT_PASS=pr-3299 gmake run-broker rabbitmqctl list_users
# => Listing users ...
# => user tags
# => pr-3299 [administrator]
rabbitmqctl list_vhosts
# => Listing vhosts ...
# => name
# => pr-3299-vhost |
RABBITMQ_ERLANG_COOKIE=abcd gmake run-broker Makes CLI authentication fail unless |
as it can be really difficult to troubleshoot such cookie changes
@Mergifyio backport v3.9.x |
Command
|
michaelklishin
added a commit
that referenced
this pull request
Aug 11, 2021
Add support to override `default_{user,pass,vhost}` and the Erlang cookie from the environment (backport #3299)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically, the Docker image allowed the user to override the default user/password and vhost as well as the Erlang cookie from environment variables among other things. After some discussion in docker-library/rabbitmq#506 (comment), support for environment variables specific to the Docker image was removed in docker-library/rabbitmq#467.
Several users were impacted by this removal (see docker-library/rabbitmq#508). After some more discussion, it was decided to re-introduce some variables directly into RabbitMQ itself. The following variables are added by this patch:
$RABBITMQ_DEFAULT_USER
(overridesdefault_user
)$RABBITMQ_DEFAULT_PASS
(overridesdefault_pass
)$RABBITMQ_DEFAULT_VHOST
(overridesdefault_vhost
)$RABBITMQ_ERLANG_COOKIE
(overrides the Erlang cookie file content)Fixes docker-library/rabbitmq#508