Files
04f026b79c integration: move curl/unbound install from runtime to image build
The startup scripts ran 'apk add curl unbound' after switching
/etc/resolv.conf to the integration DNS resolver, causing package
fetch failures. Move these dependencies into the Dockerfile via
EXTRA_PACKAGES build arg so they're installed before DNS is switched.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-19 19:51:44 +02:00

32 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -x # print commands
set -e # exit on failed command
(rm -r /tmp/mox 2>/dev/null || exit 0) # clean slate
mkdir /tmp/mox
cd /tmp/mox
mox quickstart -skipdial [email protected] "$MOX_UID" > output.txt
cp config/mox.conf config/mox.conf.orig
sed -i -e 's/letsencrypt:/pebble:/g' -e 's/: letsencrypt/: pebble/g' -e 's,DirectoryURL: https://acme-v02.api.letsencrypt.org/directory,DirectoryURL: https://acmepebble.example:14000/dir,' -e 's/Submissions:$/Submissions:\n\t\t\tEnabledOnHTTPS: true/' -e 's/IMAPS:$/IMAPS:\n\t\t\tEnabledOnHTTPS: true/' config/mox.conf
cat <<EOF >>config/mox.conf
TLS:
CA:
CertFiles:
# So certificates from moxmail2 are trusted, and pebble's certificate is trusted.
- /integration/tls/ca.pem
EOF
CURL_CA_BUNDLE=/integration/tls/ca.pem curl --retry 30 --retry-delay 1 --retry-connrefused -o /integration/tmp-pebble-ca.pem https://acmepebble.example:15000/roots/0
mox -checkconsistency serve &
while true; do
if test -e data/ctl; then
echo -n accountpass1234 | mox setaccountpassword moxtest1
break
fi
sleep 0.1
done
wait