2016-01-12 13:08:43 +01:00
|
|
|
#!/usr/bin/env bash
|
2013-01-11 21:16:42 +01:00
|
|
|
#
|
2013-08-06 21:32:15 +02:00
|
|
|
# Delete the "guest" default user and replace it with a Zulip user
|
2013-01-11 21:16:42 +01:00
|
|
|
# with a real password
|
2016-01-12 13:08:43 +01:00
|
|
|
set -e
|
|
|
|
set -x
|
2013-01-11 21:16:42 +01:00
|
|
|
|
2016-05-08 04:02:32 +02:00
|
|
|
RABBITMQ_USERNAME=$("$(dirname "$0")/../get-django-setting" RABBITMQ_USERNAME)
|
|
|
|
RABBITMQ_PASSWORD=$("$(dirname "$0")/../get-django-setting" RABBITMQ_PASSWORD)
|
2016-01-21 12:52:24 +01:00
|
|
|
sudo rabbitmqctl delete_user "$RABBITMQ_USERNAME" || true
|
2015-06-10 20:27:16 +02:00
|
|
|
sudo rabbitmqctl delete_user zulip || true
|
2015-08-28 18:37:58 +02:00
|
|
|
sudo rabbitmqctl delete_user guest || true
|
2016-01-21 12:52:24 +01:00
|
|
|
sudo rabbitmqctl add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD"
|
|
|
|
sudo rabbitmqctl set_user_tags "$RABBITMQ_USERNAME" administrator
|
|
|
|
sudo rabbitmqctl set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*'
|