From 29512fa4e1b8a3dd76da236415e65a7fd16a356d Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 19 Dec 2018 09:33:59 +0100 Subject: [PATCH] [SOGo] Build stable SOGo versions [SOGo] Remove custom colors, there were various broken styles especially for indicators of freebusy states --- data/Dockerfiles/sogo/Dockerfile | 113 +++++++++++++++++++----- data/Dockerfiles/sogo/bootstrap-sogo.sh | 45 +--------- 2 files changed, 97 insertions(+), 61 deletions(-) diff --git a/data/Dockerfiles/sogo/Dockerfile b/data/Dockerfiles/sogo/Dockerfile index dad9682a..2e2ea104 100644 --- a/data/Dockerfiles/sogo/Dockerfile +++ b/data/Dockerfiles/sogo/Dockerfile @@ -4,6 +4,7 @@ LABEL maintainer "Andre Peters " ARG DEBIAN_FRONTEND=noninteractive ENV LC_ALL C ENV GOSU_VERSION 1.9 +ENV SOGO_VERSION 4.0.4 # Prerequisites RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -11,7 +12,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ cron \ gettext \ - gnupg \ mysql-client \ supervisor \ syslog-ng \ @@ -22,31 +22,106 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ psmisc \ wget \ patch \ + git \ + devscripts \ + debhelper \ + build-essential \ + gnustep-make \ + gnustep-base-runtime \ + libgnustep-base-dev \ + libgnustep-base1.24 \ + gobjc \ + libxml2-dev \ + libldap2-dev \ + libssl-dev \ + zlib1g-dev \ + libpq-dev \ + default-libmysqlclient-dev \ + liblasso3-dev \ + libmemcached-dev \ + mysql-client \ + libcurl4-openssl-dev \ && rm -rf /var/lib/apt/lists/* \ && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ && chmod +x /usr/local/bin/gosu \ - && gosu nobody true - -RUN mkdir /usr/share/doc/sogo \ - && touch /usr/share/doc/sogo/empty.sh \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-key 0x810273C4 \ - && echo "deb http://packages.inverse.ca/SOGo/nightly/4/debian/ stretch stretch" > /etc/apt/sources.list.d/sogo.list \ - && apt-get update && apt-get install -y --force-yes \ - sogo \ - sogo-activesync \ + && gosu nobody true \ + && mkdir /tmp/sogo_build \ + && cd /tmp/sogo_build \ + && git clone -b SOPE-${SOGO_VERSION} https://github.com/inverse-inc/sope.git \ + && cd sope \ + && ./configure --enable-xml --enable-mysql --enable-openldap --with-gnustep \ + && make -j4 \ + && make install \ + && cd /tmp/sogo_build \ + && git clone -b SOGo-${SOGO_VERSION} https://github.com/inverse-inc/sogo.git \ + && cd sogo \ + && ./configure --enable-saml2 \ + && make -j4 \ + && make install \ + && groupadd -g 6000 sogo \ + && useradd -g sogo -u 6000 sogo -d /var/lib/sogo \ + && mkdir -p /usr/local/share/doc/sogo \ + && touch /usr/local/share/doc/sogo/empty.sh \ && rm -rf /var/lib/apt/lists/* \ - && echo '* * * * * sogo /usr/sbin/sogo-ealarms-notify 2>/dev/null' > /etc/cron.d/sogo \ - && echo '* * * * * sogo /usr/sbin/sogo-tool expire-sessions 60' >> /etc/cron.d/sogo \ - && echo '0 0 * * * sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds' >> /etc/cron.d/sogo \ - && touch /etc/default/locale + && echo '* * * * * sogo /usr/local/sbin/sogo-ealarms-notify 2>/dev/null' > /etc/cron.d/sogo \ + && echo '* * * * * sogo /usr/local/sbin/sogo-tool expire-sessions 60' >> /etc/cron.d/sogo \ + && echo '0 0 * * * sogo /usr/local/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds' >> /etc/cron.d/sogo \ + && touch /etc/default/locale \ + && echo '/usr/local/lib/sogo' > /etc/ld.so.conf.d/sogo.conf \ + && ldconfig \ + && mkdir -p /var/run/sogo /var/spool/sogo \ + && chown sogo:sogo /var/run/sogo /var/spool/sogo \ + && rm -rf /tmp/* /var/tmp/* /usr/bin/mysql_embedded /usr/bin/mariabackup /tmp/sogo_build \ + && apt-get purge -y libxml2-dev \ + libldap2-dev \ + libssl-dev \ + zlib1g-dev \ + libpq-dev \ + default-libmysqlclient-dev \ + liblasso3-dev \ + libmemcached-dev \ + libgnustep-base-dev \ + libcurl4-openssl-dev \ + devscripts \ + debhelper \ + build-essential \ + autoconf \ + automake \ + autopoint \ + autotools-dev \ + binutils \ + cpp \ + cpp-6 \ + dh-python \ + dpkg-dev \ + g++-6 \ + gcc-6 \ + gobjc-6 \ + groff-base \ + icu-devtools \ + libc-dev-bin \ + libc6-dev \ + libgcc-6-dev \ + libgcrypt20-dev \ + libgmp-dev \ + libgpg-error-dev \ + libhashkit-dev \ + libicu-dev \ + libidn11-dev \ + libnspr4-dev \ + libnss3-dev \ + libobjc-6-dev \ + libp11-kit-dev \ + libpcre3-dev \ + libsasl2-dev \ + libtasn1-6-dev \ + linux-libc-dev \ + nettle-dev COPY ./bootstrap-sogo.sh /bootstrap-sogo.sh COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf COPY supervisord.conf /etc/supervisor/supervisord.conf -COPY theme-blue.js /usr/lib/GNUstep/SOGo/WebServerResources/js/theme-blue.js -COPY theme-blue.css /usr/lib/GNUstep/SOGo/WebServerResources/css/theme-default.css -COPY sogo-full.svg /usr/lib/GNUstep/SOGo/WebServerResources/img/sogo-full.svg COPY acl.diff /acl.diff COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh @@ -55,6 +130,4 @@ RUN chmod +x /bootstrap-sogo.sh \ CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -VOLUME /usr/lib/GNUstep/SOGo/ - -RUN rm -rf /tmp/* /var/tmp/* +VOLUME /usr/local/lib/GNUstep/SOGo/ diff --git a/data/Dockerfiles/sogo/bootstrap-sogo.sh b/data/Dockerfiles/sogo/bootstrap-sogo.sh index 7fa0668d..539314df 100755 --- a/data/Dockerfiles/sogo/bootstrap-sogo.sh +++ b/data/Dockerfiles/sogo/bootstrap-sogo.sh @@ -168,48 +168,11 @@ chown sogo:sogo -R /var/lib/sogo/ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist # Add credentials to alarms -sed -i 's/\/usr\/sbin\/sogo-ealarms-notify/\/usr\/sbin\/sogo-ealarms-notify -p \/etc\/sogo\/sieve.creds/g' /etc/cron.d/sogo - -# Prevent theme switching -sed -i \ - -e 's/eaf5e9/E3F2FD/g' \ - -e 's/cbe5c8/BBDEFB/g' \ - -e 's/aad6a5/90CAF9/g' \ - -e 's/88c781/64B5F6/g' \ - -e 's/66b86a/42A5F5/g' \ - -e 's/56b04c/2196F3/g' \ - -e 's/4da143/1E88E5/g' \ - -e 's/388e3c/1976D2/g' \ - -e 's/367d2e/1565C0/g' \ - -e 's/225e1b/0D47A1/g' \ - -e 's/fafafa/82B1FF/g' \ - -e 's/69f0ae/448AFF/g' \ - -e 's/00e676/2979ff/g' \ - -e 's/00c853/2962ff/g' \ - /usr/lib/GNUstep/SOGo/WebServerResources/js/Common/Common.app.js \ - /usr/lib/GNUstep/SOGo/WebServerResources/js/Common.js - -sed -i \ - -e 's/default: "900"/default: "700"/g' \ - -e 's/default: "500"/default: "700"/g' \ - -e 's/"hue-1": "400"/"hue-1": "500"/g' \ - -e 's/"hue-1": "A100"/"hue-1": "500"/g' \ - -e 's/"hue-2": "800"/"hue-2": "700"/g' \ - -e 's/"hue-2": "300"/"hue-2": "700"/g' \ - -e 's/"hue-3": "A700"/"hue-3": "A200"/' \ - -e 's/default:"900"/default:"700"/g' \ - -e 's/default:"500"/default:"700"/g' \ - -e 's/"hue-1":"400"/"hue-1":"500"/g' \ - -e 's/"hue-1":"A100"/"hue-1":"500"/g' \ - -e 's/"hue-2":"800"/"hue-2":"700"/g' \ - -e 's/"hue-2":"300"/"hue-2":"700"/g' \ - -e 's/"hue-3":"A700"/"hue-3":"A200"/' \ - /usr/lib/GNUstep/SOGo/WebServerResources/js/Common/Common.app.js \ - /usr/lib/GNUstep/SOGo/WebServerResources/js/Common.js +sed -i 's/\/usr\/local\/sbin\/sogo-ealarms-notify/\/usr\/local\/sbin\/sogo-ealarms-notify -p \/etc\/sogo\/sieve.creds/g' /etc/cron.d/sogo # Patch ACLs (comment this out to enable any or authenticated targets for ACL) -if patch -sfN --dry-run /usr/lib/GNUstep/SOGo/Templates/UIxAclEditor.wox < /acl.diff > /dev/null; then - patch /usr/lib/GNUstep/SOGo/Templates/UIxAclEditor.wox < /acl.diff; +if patch -sfN --dry-run /usr/local/lib/GNUstep/SOGo/Templates/UIxAclEditor.wox < /acl.diff > /dev/null; then + patch /usr/local/lib/GNUstep/SOGo/Templates/UIxAclEditor.wox < /acl.diff; fi -exec gosu sogo /usr/sbin/sogod +exec gosu sogo /usr/local/sbin/sogod