Skip to content
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
16 changes: 12 additions & 4 deletions assembly/src/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,18 @@ fi

# WebConsole security
if [ -n "${ACTIVEMQ_WEB_USER}" ]; then
echo "Enabling ActiveMQ WebConsole security"
sed -i s/admin=/${ACTIVEMQ_WEB_USER}=/g ${ACTIVEMQ_HOME}/conf/users.properties
if [ -n "${ACTIVEMQ_WEB_PASSWORD}" ]; then
sed -i s/=admin/=${ACTIVEMQ_WEB_PASSWORD}/g ${ACTIVEMQ_HOME}/conf/users.properties
if [ -f "${ACTIVEMQ_HOME}/conf/webconsole.security.enabled" ]; then
echo "ActiveMQ WebConsole Security already enabled"
else
echo "Enabling ActiveMQ WebConsole security"
sed -i "s/admin=/${ACTIVEMQ_WEB_USER}=/g" ${ACTIVEMQ_HOME}/conf/users.properties
if [ -n "${ACTIVEMQ_WEB_PASSWORD}" ]; then
sed -i "s/=admin/=${ACTIVEMQ_WEB_PASSWORD}/g" ${ACTIVEMQ_HOME}/conf/users.properties
fi
# Update groups.properties so the new user is a member of the admins group
# (required by jetty.xml adminSecurityConstraint which expects the 'admins' role)
sed -i "s/admins=admin/admins=${ACTIVEMQ_WEB_USER}/" ${ACTIVEMQ_HOME}/conf/groups.properties
touch "${ACTIVEMQ_HOME}/conf/webconsole.security.enabled"
fi
fi

Expand Down
Loading