From 499c2019131b7ffd0b64e9f67597ae1c10c52c7f Mon Sep 17 00:00:00 2001 From: Philip Kuryloski Date: Sat, 24 Jul 2021 01:26:10 +0200 Subject: [PATCH] Add "loopback_users" configuration snippet to the 3.9 image (#501) This allows the default user to connect from outside the running container, which has been the case for the 3.8 series, but is not currently the case with the 3.9 rc Co-authored-by: Joe Ferguson --- .gitattributes | 1 + 10-default-guest-user.conf | 8 ++++++++ 3.9-rc/alpine/10-default-guest-user.conf | 8 ++++++++ 3.9-rc/alpine/Dockerfile | 1 + 3.9-rc/ubuntu/10-default-guest-user.conf | 8 ++++++++ 3.9-rc/ubuntu/Dockerfile | 1 + Dockerfile-alpine.template | 3 +++ Dockerfile-ubuntu.template | 3 +++ apply-templates.sh | 4 ++++ 9 files changed, 37 insertions(+) create mode 100644 10-default-guest-user.conf create mode 100644 3.9-rc/alpine/10-default-guest-user.conf create mode 100644 3.9-rc/ubuntu/10-default-guest-user.conf diff --git a/.gitattributes b/.gitattributes index 14a1122..8e2ce92 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +/*/**/*.conf linguist-generated /*/**/Dockerfile linguist-generated /*/**/docker-entrypoint.sh linguist-generated /Dockerfile*.template linguist-language=Dockerfile diff --git a/10-default-guest-user.conf b/10-default-guest-user.conf new file mode 100644 index 0000000..3d90573 --- /dev/null +++ b/10-default-guest-user.conf @@ -0,0 +1,8 @@ +## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION +## see https://www.rabbitmq.com/configure.html for further information +## on configuring RabbitMQ + +## allow access to the guest user from anywhere on the network +## https://www.rabbitmq.com/access-control.html#loopback-users +## https://www.rabbitmq.com/production-checklist.html#users +loopback_users.guest = false diff --git a/3.9-rc/alpine/10-default-guest-user.conf b/3.9-rc/alpine/10-default-guest-user.conf new file mode 100644 index 0000000..3d90573 --- /dev/null +++ b/3.9-rc/alpine/10-default-guest-user.conf @@ -0,0 +1,8 @@ +## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION +## see https://www.rabbitmq.com/configure.html for further information +## on configuring RabbitMQ + +## allow access to the guest user from anywhere on the network +## https://www.rabbitmq.com/access-control.html#loopback-users +## https://www.rabbitmq.com/production-checklist.html#users +loopback_users.guest = false diff --git a/3.9-rc/alpine/Dockerfile b/3.9-rc/alpine/Dockerfile index 1c311af..a1887b9 100644 --- a/3.9-rc/alpine/Dockerfile +++ b/3.9-rc/alpine/Dockerfile @@ -254,6 +254,7 @@ VOLUME $RABBITMQ_DATA_DIR # https://docs.docker.com/samples/library/ubuntu/#locales ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 +COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/3.9-rc/ubuntu/10-default-guest-user.conf b/3.9-rc/ubuntu/10-default-guest-user.conf new file mode 100644 index 0000000..3d90573 --- /dev/null +++ b/3.9-rc/ubuntu/10-default-guest-user.conf @@ -0,0 +1,8 @@ +## DEFAULT SETTINGS ARE NOT MEANT TO BE TAKEN STRAIGHT INTO PRODUCTION +## see https://www.rabbitmq.com/configure.html for further information +## on configuring RabbitMQ + +## allow access to the guest user from anywhere on the network +## https://www.rabbitmq.com/access-control.html#loopback-users +## https://www.rabbitmq.com/production-checklist.html#users +loopback_users.guest = false diff --git a/3.9-rc/ubuntu/Dockerfile b/3.9-rc/ubuntu/Dockerfile index 2f2a02b..a38dfd0 100644 --- a/3.9-rc/ubuntu/Dockerfile +++ b/3.9-rc/ubuntu/Dockerfile @@ -272,6 +272,7 @@ VOLUME $RABBITMQ_DATA_DIR # https://docs.docker.com/samples/library/ubuntu/#locales ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 +COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/ COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index a90ca28..f90cd50 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -270,6 +270,9 @@ VOLUME $RABBITMQ_DATA_DIR # https://docs.docker.com/samples/library/ubuntu/#locales ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 +{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}} +COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/ +{{ ) end -}} COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/Dockerfile-ubuntu.template b/Dockerfile-ubuntu.template index 7ebbdf1..dcbcaa5 100644 --- a/Dockerfile-ubuntu.template +++ b/Dockerfile-ubuntu.template @@ -288,6 +288,9 @@ VOLUME $RABBITMQ_DATA_DIR # https://docs.docker.com/samples/library/ubuntu/#locales ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 +{{ if ([ "3.8", "3.8-rc" ] | index(env.version)) then "" else ( -}} +COPY --chown=rabbitmq:rabbitmq 10-default-guest-user.conf /etc/rabbitmq/conf.d/ +{{ ) end -}} COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/apply-templates.sh b/apply-templates.sh index 7b593ff..50e9fce 100755 --- a/apply-templates.sh +++ b/apply-templates.sh @@ -48,6 +48,10 @@ for version; do fi cp -a "$entrypoint" "$version/$variant/docker-entrypoint.sh" + if [ "$rcVersion" != '3.8' ]; then + cp 10-default-guest-user.conf "$version/$variant/" + fi + if [ "$variant" = 'alpine' ]; then sed -i -e 's/gosu/su-exec/g' "$version/$variant/docker-entrypoint.sh" fi