2023-07-09 07:59:41 +00:00
|
|
|
FROM debian:bookworm-slim
|
2016-10-18 20:20:59 +00:00
|
|
|
|
2020-10-14 09:49:30 +00:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
ARG VERSION
|
|
|
|
|
2024-11-19 14:41:10 +00:00
|
|
|
ARG LUAROCKS_VERSION=3.11.1
|
2025-01-05 14:22:58 +00:00
|
|
|
ARG PROSODY_VERSION=0.12.5
|
2020-10-14 09:49:30 +00:00
|
|
|
|
2024-11-19 14:41:10 +00:00
|
|
|
ARG LUAROCKS_SHA256="c3fb3d960dffb2b2fe9de7e3cb004dc4d0b34bb3d342578af84f84325c669102"
|
2025-01-05 14:22:58 +00:00
|
|
|
ARG PROSODY_DOWNLOAD_SHA256="778fb7707a0f10399595ba7ab9c66dd2a2288c0ae3a7fe4ab78f97d462bd399f"
|
2020-10-14 09:49:30 +00:00
|
|
|
|
|
|
|
LABEL luarocks.version="${LUAROCKS_VERSION}"
|
|
|
|
LABEL org.opencontainers.image.authors="Sara Smiseth"
|
|
|
|
LABEL org.opencontainers.image.created="${BUILD_DATE}"
|
|
|
|
LABEL org.opencontainers.image.description="This docker image provides you with a configured Prosody XMPP server."
|
|
|
|
LABEL org.opencontainers.image.documentation="https://github.com/SaraSmiseth/prosody/blob/dev/readme.md"
|
|
|
|
LABEL org.opencontainers.image.revision="${VCS_REF}"
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/SaraSmiseth/prosody/archive/dev.zip"
|
|
|
|
LABEL org.opencontainers.image.title="prosody"
|
|
|
|
LABEL org.opencontainers.image.url="https://github.com/SaraSmiseth/prosody"
|
|
|
|
LABEL org.opencontainers.image.vendor="Sara Smiseth"
|
|
|
|
LABEL org.opencontainers.image.version="${VERSION}"
|
|
|
|
LABEL prosody.version="${PROSODY_VERSION}"
|
|
|
|
|
2016-10-18 20:20:59 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
2018-11-27 19:33:37 +00:00
|
|
|
libevent-dev `# this is no build dependency, but needed for luaevent` \
|
2023-07-09 07:59:41 +00:00
|
|
|
libicu72 \
|
|
|
|
libidn2-0 \
|
2021-05-07 12:06:29 +00:00
|
|
|
libpq-dev \
|
|
|
|
libsqlite3-0 \
|
2018-11-27 19:33:37 +00:00
|
|
|
lua5.2 \
|
2018-01-13 23:31:10 +00:00
|
|
|
lua-bitop \
|
2021-05-07 12:06:29 +00:00
|
|
|
lua-dbi-mysql \
|
2023-07-09 07:59:41 +00:00
|
|
|
lua-dbi-postgresql \
|
2016-10-18 20:20:59 +00:00
|
|
|
lua-expat \
|
|
|
|
lua-filesystem \
|
Add LDAP authentication support to Prosody (#50)
This commit adds support for LDAP authentication.
The Dockerfile has been modified to install the required Lua modules (lua-ldap) and the prosody.cfg.lua file has been modified to add environment variables for configuring the LDAP connection. These environment variables include LDAP_BASE, LDAP_SERVER, LDAP_ROOTDN, LDAP_PASSWORD, LDAP_FILTER, LDAP_SCOPE, LDAP_TLS, LDAP_MODE, and LDAP_ADMIN_FILTER.
The authentication variable has also been updated to use the value of the AUTHENTICATION environment variable, which defaults to "internal_hashed" if not set. This allows users to configure Prosody to use LDAP for authentication instead of the default internal hashing method.
* Update test dependencies: aioxmpp, pytest-asyncio + add pytz to requirements.txt
This fixes the following error when running the tests:
E ModuleNotFoundError: No module named 'pytz'
Instead of pytz only pytz-deprecation-shim was installed.
TODO Check if "pytz" can be removed from requirements.txt later on.
2023-03-25 10:23:51 +00:00
|
|
|
lua-ldap \
|
2016-10-18 20:20:59 +00:00
|
|
|
lua-socket \
|
|
|
|
lua-sec \
|
2022-05-05 16:25:19 +00:00
|
|
|
lua-unbound \
|
2016-10-18 20:20:59 +00:00
|
|
|
wget \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2023-07-09 07:59:41 +00:00
|
|
|
RUN buildDeps='gcc git libc6-dev libidn2-dev liblua5.2-dev libsqlite3-dev libssl-dev libicu-dev make unzip' \
|
2016-10-18 20:20:59 +00:00
|
|
|
&& set -x \
|
|
|
|
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2018-11-27 19:33:37 +00:00
|
|
|
\
|
2020-10-14 09:49:30 +00:00
|
|
|
&& wget -O prosody.tar.gz "https://prosody.im/downloads/source/prosody-${PROSODY_VERSION}.tar.gz" \
|
2020-10-01 16:22:06 +00:00
|
|
|
&& echo "${PROSODY_DOWNLOAD_SHA256} *prosody.tar.gz" | sha256sum -c - \
|
2016-10-18 20:20:59 +00:00
|
|
|
&& mkdir -p /usr/src/prosody \
|
|
|
|
&& tar -xzf prosody.tar.gz -C /usr/src/prosody --strip-components=1 \
|
|
|
|
&& rm prosody.tar.gz \
|
2018-11-27 19:33:37 +00:00
|
|
|
&& cd /usr/src/prosody && ./configure \
|
2020-05-25 16:50:57 +00:00
|
|
|
&& make \
|
|
|
|
&& make install \
|
2018-11-27 19:33:37 +00:00
|
|
|
&& cd / && rm -r /usr/src/prosody \
|
|
|
|
\
|
|
|
|
&& mkdir /usr/src/luarocks \
|
|
|
|
&& cd /usr/src/luarocks \
|
2020-05-25 16:30:14 +00:00
|
|
|
&& wget https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz \
|
2020-10-01 16:22:06 +00:00
|
|
|
&& echo "${LUAROCKS_SHA256} luarocks-${LUAROCKS_VERSION}.tar.gz" | sha256sum -c - \
|
2020-05-25 16:30:14 +00:00
|
|
|
&& tar zxpf luarocks-${LUAROCKS_VERSION}.tar.gz \
|
|
|
|
&& cd luarocks-${LUAROCKS_VERSION} \
|
2018-11-27 19:33:37 +00:00
|
|
|
&& ./configure \
|
2020-06-11 10:41:42 +00:00
|
|
|
&& make bootstrap \
|
2018-11-27 19:33:37 +00:00
|
|
|
&& cd / && rm -r /usr/src/luarocks \
|
|
|
|
\
|
|
|
|
&& luarocks install luaevent \
|
|
|
|
&& luarocks install luadbi \
|
2021-05-07 12:06:29 +00:00
|
|
|
`#&& luarocks install luadbi-mysql MYSQL_INCDIR=/usr/include/mariadb/` \
|
2018-11-27 19:33:37 +00:00
|
|
|
&& luarocks install luadbi-sqlite3 \
|
2020-10-10 06:55:43 +00:00
|
|
|
&& luarocks install stringy \
|
2018-11-27 19:33:37 +00:00
|
|
|
\
|
2016-10-18 20:20:59 +00:00
|
|
|
&& apt-get purge -y --auto-remove $buildDeps
|
|
|
|
|
2020-06-01 09:10:19 +00:00
|
|
|
EXPOSE 5000 5222 5223 5269 5347 5280 5281
|
2016-10-18 20:20:59 +00:00
|
|
|
|
|
|
|
RUN groupadd -r prosody \
|
|
|
|
&& useradd -r -g prosody prosody \
|
|
|
|
&& chown prosody:prosody /usr/local/var/lib/prosody
|
|
|
|
|
2020-10-10 06:55:43 +00:00
|
|
|
RUN mkdir -p /var/run/prosody/ \
|
|
|
|
&& chown prosody:prosody /var/run/prosody/
|
|
|
|
|
2016-10-18 20:20:59 +00:00
|
|
|
# https://github.com/prosody/prosody-docker/issues/25
|
2025-01-05 14:22:58 +00:00
|
|
|
ENV __FLUSH_LOG=yes
|
2016-10-18 20:20:59 +00:00
|
|
|
|
|
|
|
VOLUME ["/usr/local/var/lib/prosody"]
|
|
|
|
|
|
|
|
COPY prosody.cfg.lua /usr/local/etc/prosody/prosody.cfg.lua
|
2021-05-07 12:06:29 +00:00
|
|
|
COPY docker-entrypoint.bash /entrypoint.bash
|
2016-10-18 20:20:59 +00:00
|
|
|
COPY conf.d/*.cfg.lua /usr/local/etc/prosody/conf.d/
|
|
|
|
|
2020-06-27 17:06:27 +00:00
|
|
|
COPY *.bash /usr/local/bin/
|
|
|
|
|
2020-06-27 17:53:23 +00:00
|
|
|
RUN download-prosody-modules.bash \
|
|
|
|
&& docker-prosody-module-install.bash \
|
2020-06-05 06:08:32 +00:00
|
|
|
cloud_notify `# XEP-0357: Push Notifications` \
|
2016-10-18 20:20:59 +00:00
|
|
|
e2e_policy `# require end-2-end encryption` \
|
|
|
|
filter_chatstates `# disable "X is typing" type messages` \
|
2020-06-27 17:47:57 +00:00
|
|
|
throttle_presence `# presence throttling in CSI` \
|
2020-06-27 17:53:23 +00:00
|
|
|
vcard_muc `# XEP-0153: vCard-Based Avatar (MUC)` \
|
|
|
|
&& rm -rf "/usr/src/prosody-modules"
|
2020-06-27 17:06:27 +00:00
|
|
|
|
2016-10-18 20:20:59 +00:00
|
|
|
USER prosody
|
|
|
|
|
2021-05-07 12:06:29 +00:00
|
|
|
ENTRYPOINT ["/entrypoint.bash"]
|
2020-05-26 15:27:48 +00:00
|
|
|
CMD ["prosody", "-F"]
|
2018-11-27 19:33:37 +00:00
|
|
|
|