diff --git a/bin/update-git-refs.sh b/bin/update-git-refs.sh index 4666decd..9fd16489 100755 --- a/bin/update-git-refs.sh +++ b/bin/update-git-refs.sh @@ -1,31 +1,33 @@ #!/bin/bash updateVar() { NAME=$1 #TODO pin option that translates to a commit hash via # git ls-remote --exit-code -h "https://git.kolab.org/source/kolab" refs/heads/master REF=$2 if ! grep -q "$NAME=" src/.env; then echo "$1=$REF" >> src/.env else echo "s/$NAME=.*/$NAME=$REF/" sed -i "s|$NAME=.*|$NAME=$REF|" src/.env fi } updateVar KOLAB_GIT_REF "${KOLAB_GIT_REF:-master}" updateVar KOLAB_GIT_REMOTE "${KOLAB_GIT_REMOTE:-https://git.kolab.org/source/kolab}" updateVar GIT_REF_ROUNDCUBEMAIL "${GIT_REF_ROUNDCUBEMAIL:-dev/kolab-1.5}" updateVar GIT_REMOTE_ROUNDCUBEMAIL "${GIT_REMOTE_ROUNDCUBEMAIL:-https://git.kolab.org/source/roundcubemail.git}" updateVar GIT_REF_ROUNDCUBEMAIL_PLUGINS "${GIT_REF_ROUNDCUBEMAIL_PLUGINS:-master}" updateVar GIT_REMOTE_ROUNDCUBEMAIL_PLUGINS "${GIT_REMOTE_ROUNDCUBEMAIL_PLUGINS:-https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git}" updateVar GIT_REF_CHWALA "${GIT_REF_CHWALA:-master}" updateVar GIT_REMOTE_CHWALA "${GIT_REMOTE_CHWALA:-https://git.kolab.org/diffusion/C/chwala.git}" updateVar GIT_REF_SYNCROTON "${GIT_REF_SYNCROTON:-master}" updateVar GIT_REMOTE_SYNCROTON "${GIT_REMOTE_SYNCROTON:-https://git.kolab.org/diffusion/S/syncroton.git}" updateVar GIT_REF_AUTOCONF "${GIT_REF_SYNCROTON:-master}" updateVar GIT_REMOTE_AUTOCONF "${GIT_REMOTE_AUTOCONF:-https://git.kolab.org/diffusion/AC/autoconf.git}" updateVar GIT_REF_IRONY "${GIT_REF_IRONY:-master}" updateVar GIT_REMOTE_IRONY "${GIT_REMOTE_IRONY:-https://git.kolab.org/source/iRony.git}" updateVar GIT_REF_FREEBUSY "${GIT_REF_FREEBUSY:-master}" updateVar GIT_REMOTE_FREEBUSY "${GIT_REMOTE_FREEBUSY:-https://git.kolab.org/diffusion/F/freebusy.git}" +updateVar IMAP_GIT_REF "${IMAP_GIT_REF:-dev/mollekopf}" +updateVar IMAP_GIT_REMOTE "${IMAP_GIT_REMOTE:-https://git.kolab.org/source/cyrus-imapd}" diff --git a/docker/imap/Dockerfile b/docker/imap/Dockerfile index a511bec1..d6e204ba 100644 --- a/docker/imap/Dockerfile +++ b/docker/imap/Dockerfile @@ -1,47 +1,44 @@ FROM apheleia/almalinux8 WORKDIR /root/ RUN dnf -y group install "Development Tools" && \ dnf -y install git autoconf automake bison cyrus-sasl-devel flex gcc gperf jansson-devel libbsd-devel libtool libicu-devel libuuid-devel openssl-devel pkgconfig sqlite-devel brotli-devel libical-devel libxml2-devel libnghttp2-devel shapelib zlib-devel pcre-devel perl-devel cyrus-imapd cyrus-sasl cyrus-sasl-plain && \ dnf clean all -RUN git clone --branch dev/mollekopf https://git.kolab.org/source/cyrus-imapd && \ - cd cyrus-imapd && \ - autoreconf -i && \ - ./configure CFLAGS="-W -Wno-unused-parameter -g -O0 -Wall -Wextra -Werror -fPIC" --enable-murder --enable-http --enable-calalarmd --enable-autocreate --enable-idled --with-openssl=yes --enable-replication --prefix=/usr && \ - make -j6 && \ - make install && \ - cd .. && \ - rm -rf cyrus-imapd +ARG GIT_REF=dev/mollekopf +ARG GIT_REMOTE=https://git.kolab.org/source/cyrus-imapd + +ADD build.sh /build.sh +RUN /build.sh COPY cyrus.conf /etc/cyrus.conf COPY imapd.conf /etc/imapd.conf COPY imapd.annotations.conf /etc/imapd.annotations.conf COPY saslauthd.conf /etc/saslauthd.conf ADD init.sh /init.sh VOLUME [ "/var/spool/imap" ] VOLUME [ "/var/lib/imap" ] RUN id default || (groupadd -g 1001 default && useradd -u 1001 -g 1001 default) RUN PATHS=(/run /run/saslauthd /var/run /var/lib/imap /var/spool/imap /etc/pki/cyrus-imapd) && \ mkdir -p ${PATHS[@]} && \ chmod 777 ${PATHS[@]} && \ chown -R 1001:0 ${PATHS[@]} && \ chmod -R g=u ${PATHS[@]} RUN PATHS=(/etc /etc/passwd /etc/saslauthd.conf /etc/cyrus.conf /etc/imapd.conf) && \ chown 1001:0 ${PATHS[@]} && \ chmod g=u ${PATHS[@]} USER 1001 ENV SERVICES_PORT=8000 # ENV APP_SERVICES_DOMAIN CMD ["/init.sh"] EXPOSE 11143/tcp 11993/tcp 11080/tcp 11443/tcp 11024/tcp 4190/tcp diff --git a/docker/imap/build.sh b/docker/imap/build.sh new file mode 100755 index 00000000..008ee057 --- /dev/null +++ b/docker/imap/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +function checkout() { + if [ ! -d "$1" ]; then + git clone "$2" "$1" + pushd "$1" + git checkout "$3" + popd + fi +} + +checkout cyrus-imapd $GIT_REMOTE $GIT_REF +pushd cyrus-imapd +autoreconf -i +./configure CFLAGS="-W -Wno-unused-parameter -g -O0 -Wall -Wextra -Werror -fPIC" --enable-murder --enable-http --enable-calalarmd --enable-autocreate --enable-idled --with-openssl=yes --enable-replication --prefix=/usr +make -j6 +make install +popd +rm -rf cyrus-imapd +