Skip to content

Commit fb17530

Browse files
author
Thomas Lutz
committed
Fix authentication, bump to 5.18.4
1 parent 7838043 commit fb17530

5 files changed

Lines changed: 18 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.idea
1+
.idea
2+
.DS_Store

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM bellsoft/liberica-openjdk-alpine:17
22

33
LABEL maintainer="Thomas Lutz <lutz@symptoma.com>"
44

5-
ENV ACTIVEMQ_VERSION 5.18.3
5+
ENV ACTIVEMQ_VERSION 5.18.4
66
ENV ACTIVEMQ apache-activemq-$ACTIVEMQ_VERSION
77
ENV ACTIVEMQ_HOME /opt/activemq
88

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Symptoma
3+
Copyright (c) 2024 Symptoma
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ symptoma/activemq:latest
2525

2626
## ActiveMQ version
2727

28-
Current version of ActiveMQ is **5.18.3**: https://archive.apache.org/dist/activemq/5.18.3/
28+
Current version of ActiveMQ is **5.18.4**: https://archive.apache.org/dist/activemq/5.18.4/
2929

3030
Note: Since ActiveMQ 5.16.0 the Web Console is not reachable by default, as it only listens to 127.0.0.1 inside the container. See [AMQ-8018](https://issues.apache.org/jira/browse/AMQ-8018) for more details.
3131

entrypoint.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ if [ -n "$ACTIVEMQ_API_CONTEXTPATH" ]; then
2222
sed -iv "s#<property name=\"contextPath\" value=\"/api\" />#<property name=\"contextPath\" value=\"${ACTIVEMQ_API_CONTEXTPATH}\" />#" conf/jetty.xml
2323
fi
2424

25-
if [ -n "$ACTIVEMQ_USERNAME" ]; then
26-
echo "Setting activemq username to $ACTIVEMQ_USERNAME"
27-
sed -i "s#activemq.username=system#activemq.username=$ACTIVEMQ_USERNAME#" conf/credentials.properties
28-
fi
29-
30-
if [ -n "$ACTIVEMQ_PASSWORD" ]; then
31-
echo "Setting activemq password"
32-
sed -i "s#activemq.password=manager#activemq.password=$ACTIVEMQ_PASSWORD#" conf/credentials.properties
25+
# Enable security by adding simpleAuthenticationPlugin
26+
if [ -n "$ACTIVEMQ_USERNAME" ] && [ -n "$ACTIVEMQ_PASSWORD" ]; then
27+
echo "Enabling security by adding simpleAuthenticationPlugin to activemq.xml"
28+
if ! grep -q "<simpleAuthenticationPlugin>" conf/activemq.xml; then
29+
sed -i '/<\/broker>/i \
30+
<plugins>\
31+
<simpleAuthenticationPlugin>\
32+
<users>\
33+
<authenticationUser username="'"$ACTIVEMQ_USERNAME"'" password="'"$ACTIVEMQ_PASSWORD"'" groups="users,admins"/>\
34+
</users>\
35+
</simpleAuthenticationPlugin>\
36+
</plugins>' conf/activemq.xml
37+
fi
3338
fi
3439

3540
if [ -n "$ACTIVEMQ_WEBADMIN_USERNAME" ]; then

0 commit comments

Comments
 (0)