File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171
7272# WebConsole security
7373if [ -n " ${ACTIVEMQ_WEB_USER} " ]; then
74- echo " Enabling ActiveMQ WebConsole security"
75- sed -i s/admin=/${ACTIVEMQ_WEB_USER} =/g ${ACTIVEMQ_HOME} /conf/users.properties
76- if [ -n " ${ACTIVEMQ_WEB_PASSWORD} " ]; then
77- sed -i s/=admin/=${ACTIVEMQ_WEB_PASSWORD} /g ${ACTIVEMQ_HOME} /conf/users.properties
74+ if [ -f " ${ACTIVEMQ_HOME} /conf/webconsole.security.enabled" ]; then
75+ echo " ActiveMQ WebConsole Security already enabled"
76+ else
77+ echo " Enabling ActiveMQ WebConsole security"
78+ sed -i " s/admin=/${ACTIVEMQ_WEB_USER} =/g" ${ACTIVEMQ_HOME} /conf/users.properties
79+ if [ -n " ${ACTIVEMQ_WEB_PASSWORD} " ]; then
80+ sed -i " s/=admin/=${ACTIVEMQ_WEB_PASSWORD} /g" ${ACTIVEMQ_HOME} /conf/users.properties
81+ fi
82+ # Update groups.properties so the new user is a member of the admins group
83+ # (required by jetty.xml adminSecurityConstraint which expects the 'admins' role)
84+ sed -i " s/admins=admin/admins=${ACTIVEMQ_WEB_USER} /" ${ACTIVEMQ_HOME} /conf/groups.properties
85+ touch " ${ACTIVEMQ_HOME} /conf/webconsole.security.enabled"
7886 fi
7987fi
8088
You can’t perform that action at this time.
0 commit comments