From 645e89073086fb07b91624c9b37452e2470a5688 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 14 May 2024 20:47:21 -0600 Subject: [PATCH] Use sudo, add luarocks, and remove deprecated config --- Dockerfile | 7 +++++-- entrypoint.sh | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c73ecb4..cc55d2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,13 +37,16 @@ RUN apt-get update \ lua5.2 \ lua5.3 \ lua5.4 \ + luarocks \ openssl \ prosody \ + sudo \ && rm -rf /var/lib/apt/lists/* +RUN update-alternatives --set lua-interpreter /usr/bin/lua5.4 + # Configure prosody -RUN sed -i '1s/^/daemonize = false;\n/' /etc/prosody/prosody.cfg.lua \ - && perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua +RUN perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua RUN mkdir -p /var/run/prosody && chown prosody:prosody /var/run/prosody diff --git a/entrypoint.sh b/entrypoint.sh index 81b16c5..011647d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,4 +18,5 @@ if [[ "$LOCAL" && "$PASSWORD" && "$DOMAIN" ]]; then prosodyctl register "$LOCAL" "$DOMAIN" "$PASSWORD" fi -exec setpriv --reuid=prosody --regid=prosody --init-groups "$@" +pushd /var/run/prosody +exec sudo -Eu prosody -- "$@"