From 2fadfee61a646d1b336b758657d756de7ab26272 Mon Sep 17 00:00:00 2001 From: andryyy Date: Wed, 5 Jul 2017 10:22:43 +0200 Subject: [PATCH] [SOGo] Remove thunderbird plugin generation, will move to docs --- data/Dockerfiles/sogo/Dockerfile | 15 +-- data/Dockerfiles/sogo/reconf-domains.sh | 3 - data/Dockerfiles/sogo/syslog-ng.conf | 2 + data/web/thunderbird-plugins.php | 96 ------------------- data/web/thunderbird-plugins/.gitignore | 5 - data/web/thunderbird-plugins/build-plugins.sh | 61 ------------ docker-compose.yml | 1 - 7 files changed, 6 insertions(+), 177 deletions(-) delete mode 100644 data/web/thunderbird-plugins.php delete mode 100644 data/web/thunderbird-plugins/.gitignore delete mode 100755 data/web/thunderbird-plugins/build-plugins.sh diff --git a/data/Dockerfiles/sogo/Dockerfile b/data/Dockerfiles/sogo/Dockerfile index a3a1308d..0fc4675f 100644 --- a/data/Dockerfiles/sogo/Dockerfile +++ b/data/Dockerfiles/sogo/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:jessie-slim +FROM debian:stretch-slim LABEL maintainer "Andre Peters " ARG DEBIAN_FRONTEND=noninteractive @@ -11,30 +11,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ cron \ gnupg \ - make \ mysql-client \ supervisor \ syslog-ng \ syslog-ng-core \ syslog-ng-mod-redis \ - tar \ + dirmngr \ wget \ - zip \ && 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" \ - && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ && 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 keys.gnupg.net --recv-key 0x810273C4 \ - && echo "deb http://packages.inverse.ca/SOGo/nightly/3/debian/ jessie jessie" > /etc/apt/sources.list.d/sogo.list \ + && apt-key adv --keyserver sks.labs.nic.cz --recv-key A04BE668 \ + && echo "deb http://www.axis.cz/linux/debian stretch sogo-v3" > /etc/apt/sources.list.d/sogo.list \ && apt-get update && apt-get install -y --force-yes \ sogo \ sogo-activesync \ diff --git a/data/Dockerfiles/sogo/reconf-domains.sh b/data/Dockerfiles/sogo/reconf-domains.sh index a0a0b64d..ec0d4c93 100755 --- a/data/Dockerfiles/sogo/reconf-domains.sh +++ b/data/Dockerfiles/sogo/reconf-domains.sh @@ -93,9 +93,6 @@ echo ' chown sogo:sogo -R /var/lib/sogo/ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist -# Regenerate the SOGo Integrator plugin -/thunderbird/build-plugins.sh ${MAILCOW_HOSTNAME} < <(mysql --host mysql -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT domain FROM domain;" -B -N) - supervisorctl restart sogo sleep 99999 diff --git a/data/Dockerfiles/sogo/syslog-ng.conf b/data/Dockerfiles/sogo/syslog-ng.conf index 1e97345a..4d17d9b1 100644 --- a/data/Dockerfiles/sogo/syslog-ng.conf +++ b/data/Dockerfiles/sogo/syslog-ng.conf @@ -22,6 +22,7 @@ destination d_combined { destination d_redis_persistent_log { redis( host("redis-mailcow") + persist-name("redis1") port(6379) command("LPUSH" "SOGO_LOG" "$(format-json time=\"$S_UNIXTIME\" priority=\"$PRIORITY\" program=\"$PROGRAM\" message=\"$MESSAGE\")\n") ); @@ -29,6 +30,7 @@ destination d_redis_persistent_log { destination d_redis_f2b_channel { redis( host("redis-mailcow") + persist-name("redis2") port(6379) command("PUBLISH" "F2B_CHANNEL" "$MESSAGE") ); diff --git a/data/web/thunderbird-plugins.php b/data/web/thunderbird-plugins.php deleted file mode 100644 index 8a1a7e9b..00000000 --- a/data/web/thunderbird-plugins.php +++ /dev/null @@ -1,96 +0,0 @@ - 'thunderbird', - 'version' => $row[1], - 'filename' => str_replace('__DOMAIN__', $_GET["domain"], $row[2]), - ); - } - fclose($fh); - } -} - -$applications -= array( "thunderbird" => "{3550f703-e582-4d05-9a08-453d09bdfdc6} - 31.0 - 31.*" ); - -$pluginname = $_GET["plugin"]; -$plugin =& $plugins[$pluginname]; -$application =& $applications[$plugin["application"]]; - -if ( $plugin ) { - $platform = $_GET["platform"]; - if ( $platform - && file_exists( $platform . "/" . $plugin["filename"] ) ) { - $plugin["filename"] = $platform . "/" . $plugin["filename"]; - } - elseif ( !file_exists( $plugin["filename"] ) ) { - $plugin = false; - } -} - -if ( $plugin ) { - header("Content-type: text/xml; charset=utf-8"); - echo ('' . "\n"); -?> - - - - - -
  • - - - - - - - - - - -
  • -
    -
    -
    -
    - diff --git a/data/web/thunderbird-plugins/.gitignore b/data/web/thunderbird-plugins/.gitignore deleted file mode 100644 index 2744d736..00000000 --- a/data/web/thunderbird-plugins/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.zip -sogo-*-master -version.csv -*.xpi -*.tar.gz diff --git a/data/web/thunderbird-plugins/build-plugins.sh b/data/web/thunderbird-plugins/build-plugins.sh deleted file mode 100755 index 03986b78..00000000 --- a/data/web/thunderbird-plugins/build-plugins.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -e - -MAILHOST=$1 - -cd $(dirname $0) - -wget -O integrator.tar.gz https://github.com/inverse-inc/sogo-integrator.tb31/archive/master.tar.gz -wget -O connector.tar.gz https://github.com/inverse-inc/sogo-connector.tb31/archive/master.tar.gz - -mkdir -p integrator connector -tar --strip-components=1 -C integrator -xf integrator.tar.gz -tar --strip-components=1 -C connector -xf connector.tar.gz - -# build custom integrator -while read DOMAIN; do - echo "Building SOGo Integrator for $DOMAIN hosted on $MAILHOST" - cd integrator - echo > defaults/preferences/site.js - mkdir -p custom/${DOMAIN} - cp -r custom/sogo-demo/* custom/${DOMAIN}/ - sed -i "s/http:\/\/sogo-demo\.inverse\.ca/https:\/\/${MAILHOST}/g" custom/${DOMAIN}/chrome/content/extensions.rdf - sed -i "s/plugins\/updates\.php[?]/thunderbird-plugins.php?domain=${DOMAIN}\&/g" custom/${DOMAIN}/chrome/content/extensions.rdf - echo 'pref("sogo-integrator.autocomplete.server.urlid", "'${DOMAIN}'");' > custom/${DOMAIN}/defaults/preferences/site.js - echo 'pref("mail.collect_email_address_outgoing", false);' >> custom/${DOMAIN}/defaults/preferences/site.js - sed -i 's/<\/Seq>/
  • <\/li>
  • <\/li><\/Seq>/g' custom/${DOMAIN}/chrome/content/extensions.rdf - make build=${DOMAIN} - INTEGRATOR_VER=$(grep em:version install.rdf | awk -F '"' '{print $2}') - cp sogo-integrator-*-${DOMAIN}.xpi ../sogo-integrator-${INTEGRATOR_VER}-${DOMAIN}.xpi - cd .. -done - -# build connector -cd connector -make -CONNECTOR_VER=$(grep em:version install.rdf | awk -F '"' '{print $2}') -cp sogo-connector-*.xpi ../sogo-connector-${CONNECTOR_VER}.xpi -cd .. - -# download Sieve plugin -SIEVE_RELEASES=$(wget --header="Accept: application/vnd.github.v3+json" -qO - https://api.github.com/repos/thsmi/sieve/releases) -SIEVE_VER=$(echo "$SIEVE_RELEASES" | grep -o '"tag_name": *"[^"]*"' | head -n 1 | awk -F '"' '{print $4}') -SIEVE_URL=$(echo "$SIEVE_RELEASES" | grep -o '"browser_download_url": *"[^"]*"' | head -n 1 | awk -F '"' '{print $4}') -wget -O sieve-${SIEVE_VER}.xpi ${SIEVE_URL} -unset SIEVE_RELEASES - -# download ACL plugin -IMAP_ACL_RELEASES=$(wget -qO - 'https://addons.mozilla.org/api/v3/addons/addon/176736') -IMAP_ACL_VER=$(echo "$IMAP_ACL_RELEASES" | grep -o '"version": *"[^"]*"' | head -n 1 | awk -F '"' '{print $4}') -IMAP_ACL_URL=$(echo "$IMAP_ACL_RELEASES" | grep -o '"url": *"[^"]*\.xpi' | head -n 1 | awk -F '"' '{print $4}') -wget -O imap_acl_extension-${IMAP_ACL_VER}-tb.xpi ${IMAP_ACL_URL} -unset IMAP_ACL_RELEASES - -# update version file -echo "sogo-connector@inverse.ca;${CONNECTOR_VER};sogo-connector-${CONNECTOR_VER}.xpi" > version.csv -echo "sogo-integrator@inverse.ca;${INTEGRATOR_VER};sogo-integrator-${INTEGRATOR_VER}-__DOMAIN__.xpi" >> version.csv -echo "sieve@mozdev.org;${SIEVE_VER};sieve-${SIEVE_VER}.xpi" >> version.csv -echo "imap-acl@sirphreak.com;${IMAP_ACL_VER};imap_acl_extension-${IMAP_ACL_VER}-tb.xpi" >> version.csv - -rm -rf connector integrator *.tar.gz diff --git a/docker-compose.yml b/docker-compose.yml index c37f2a9b..f809c671 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -158,7 +158,6 @@ services: - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} volumes: - ./data/conf/sogo/:/etc/sogo/ - - ./data/web/thunderbird-plugins:/thunderbird restart: always logging: options: