From 47688134fc53000532bb320ba4a7355bef7cc8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sat, 14 Jul 2018 13:58:59 +0200 Subject: [PATCH 1/3] make certbot auto-agree to TOS if NONINTERACTIVE=1 env var is set --- setup/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/start.sh b/setup/start.sh index 86b34c8e..b13e80ca 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -139,7 +139,8 @@ echo "Mail-in-a-Box uses Let's Encrypt to provision free certificates" echo "to enable HTTPS connections to your box. You'll now be asked to agree" echo "to Let's Encrypt's terms of service." echo -certbot register --register-unsafely-without-email --config-dir $STORAGE_ROOT/ssl/lets_encrypt +certbot register $([ "$NONINTERACTIVE" == 1 ] && echo "--agree-tos") \ + --register-unsafely-without-email --config-dir $STORAGE_ROOT/ssl/lets_encrypt fi # Done. From fed5f80d19f63422704da73a5f2cb2dc0dc8c127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sun, 15 Jul 2018 00:17:43 +0200 Subject: [PATCH 2/3] Bugfix: Failing z-push installation. Replace git clone with wget git clone (which uses curl) underneath was failing. Curiously, the same git clone command would work on my macos host machine. VM versions: Curl, 7.35.0 OpenSSL/1.0.1f Macos versions: Curl, 7.54.0 LibreSSL/2.0.20 Tried compiling a newer version of curl from source, but I got stuck chasing missing dependencies. Did a workaround with wget download that manages to download over https. --- setup/zpush.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/zpush.sh b/setup/zpush.sh index eac3a0a0..6be18a93 100755 --- a/setup/zpush.sh +++ b/setup/zpush.sh @@ -32,8 +32,10 @@ elif [[ $VERSION != `cat /usr/local/lib/z-push/version` ]]; then fi if [ $needs_update == 1 ]; then rm -rf /usr/local/lib/z-push + rm -rf /tmp/z-push - git_clone https://stash.z-hub.io/scm/zp/z-push.git $VERSION '' /tmp/z-push + wget -nv -O /tmp/z-push.zip "https://stash.z-hub.io/rest/api/latest/projects/ZP/repos/z-push/archive?at=refs/tags/$VERSION&format=zip" + unzip -q /tmp/z-push.zip -d /tmp/z-push mkdir /usr/local/lib/z-push cp -r /tmp/z-push/src/* /usr/local/lib/z-push From bb175edeba3746ff854bc3af4956f30ad98c1d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Mon, 16 Jul 2018 16:42:19 +0200 Subject: [PATCH 3/3] use wget_verify to download z-push 2.3.9 --- setup/zpush.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/setup/zpush.sh b/setup/zpush.sh index 6be18a93..66bacbaf 100755 --- a/setup/zpush.sh +++ b/setup/zpush.sh @@ -23,6 +23,7 @@ phpenmod -v php7.0 imap # Copy Z-Push into place. VERSION=2.3.9 +TARGETHASH=60087b97e4b1c73db096e252cf893c75df556907 needs_update=0 #NODOC if [ ! -f /usr/local/lib/z-push/version ]; then needs_update=1 #NODOC @@ -31,15 +32,12 @@ elif [[ $VERSION != `cat /usr/local/lib/z-push/version` ]]; then needs_update=1 #NODOC fi if [ $needs_update == 1 ]; then + wget_verify http://download.z-push.org/final/2.3/z-push-$VERSION.tar.gz $TARGETHASH /tmp/z-push.tar.gz + rm -rf /usr/local/lib/z-push - rm -rf /tmp/z-push - - wget -nv -O /tmp/z-push.zip "https://stash.z-hub.io/rest/api/latest/projects/ZP/repos/z-push/archive?at=refs/tags/$VERSION&format=zip" - unzip -q /tmp/z-push.zip -d /tmp/z-push - - mkdir /usr/local/lib/z-push - cp -r /tmp/z-push/src/* /usr/local/lib/z-push - rm -rf /tmp/z-push + tar -xzf /tmp/z-push.tar.gz -C /usr/local/lib/ + rm /tmp/z-push.tar.gz + mv /usr/local/lib/z-push-$VERSION /usr/local/lib/z-push rm -f /usr/sbin/z-push-{admin,top} ln -s /usr/local/lib/z-push/z-push-admin.php /usr/sbin/z-push-admin