forked from mtusi2026/mtusi2026lab5
level 3
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# RabbitMQ 4 no longer reads RABBITMQ_DEFAULT_*_FILE. The password is written into a
|
||||
# root-only config the server reads after it drops privileges. It is not printed.
|
||||
set -eu
|
||||
|
||||
user=$(tr -d '\r\n' < /run/secrets/rabbitmq_user)
|
||||
pass=$(tr -d '\r\n' < /run/secrets/rabbitmq_password)
|
||||
if [ -z "$user" ] || [ -z "$pass" ]; then
|
||||
echo "RabbitMQ credentials are empty" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
umask 077
|
||||
printf 'default_user = %s\ndefault_pass = %s\ndisk_free_limit.absolute = 50MB\n' \
|
||||
"$user" "$pass" > /etc/rabbitmq/conf.d/10-lab.conf
|
||||
chown rabbitmq:rabbitmq /etc/rabbitmq/conf.d/10-lab.conf
|
||||
|
||||
exec docker-entrypoint.sh rabbitmq-server
|
||||
Reference in New Issue
Block a user