mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-10 01:17:19 +00:00
Include postfix, dovecot, opendkim in preloaded vm
This commit is contained in:
parent
f05fa8ba01
commit
6255ecb2f3
@ -51,10 +51,13 @@ export NC_ADMIN_PASSWORD="${NC_ADMIN_PASSWORD:-Test_1234}"
|
|||||||
export MIAB_UPSTREAM_GIT="${MIAB_UPSTREAM_GIT:-https://github.com/mail-in-a-box/mailinabox.git}"
|
export MIAB_UPSTREAM_GIT="${MIAB_UPSTREAM_GIT:-https://github.com/mail-in-a-box/mailinabox.git}"
|
||||||
export UPSTREAM_TAG="${UPSTREAM_TAG:-}"
|
export UPSTREAM_TAG="${UPSTREAM_TAG:-}"
|
||||||
|
|
||||||
# For setup scripts that install miabldap releases
|
# For setup scripts that install miabldap releases (eg. upgrade tests)
|
||||||
export MIABLDAP_GIT="${MIABLDAP_GIT:-https://github.com/downtownallday/mailinabox-ldap.git}"
|
export MIABLDAP_GIT="${MIABLDAP_GIT:-https://github.com/downtownallday/mailinabox-ldap.git}"
|
||||||
export MIABLDAP_RELEASE_TAG="${MIABLDAP_RELEASE_TAG:-v55}"
|
export MIABLDAP_RELEASE_TAG="${MIABLDAP_RELEASE_TAG:-v60}"
|
||||||
|
|
||||||
# When running tests that require php, use this version of php. This
|
# When running tests that require php, use this version of php. This
|
||||||
# should be the same as what's in setup/functions.sh.
|
# should be the same as what's in setup/functions.sh.
|
||||||
export PHP_VER=8.0
|
export PHP_VER=8.0
|
||||||
|
|
||||||
|
# Tag of last version supported on Ubuntu Bionic 18.04
|
||||||
|
FINAL_RELEASE_TAG_BIONIC64=master #v57a
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# load defaults for MIABLDAP_RELEASE_TAG and MIABLDAP_GIT
|
# load defaults for MIABLDAP_GIT and FINAL_RELEASE_TAG_BIONIC64 (make available to Vagrantfile)
|
||||||
pushd "../../.." >/dev/null
|
pushd "../../.." >/dev/null
|
||||||
source tests/system-setup/setup-defaults.sh || exit 1
|
source tests/system-setup/setup-defaults.sh || exit 1
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
# TODO: replace MIABLDAP_RELEASE_TAG with the actual tag for the last supported version of miabldap for bionic64
|
|
||||||
UBUNTU_BIONIC64_RELEASE_TAG=$MIABLDAP_RELEASE_TAG
|
|
||||||
|
|
||||||
vagrant destroy -f
|
vagrant destroy -f
|
||||||
rm -f prepcode.txt
|
rm -f prepcode.txt
|
||||||
|
|
||||||
@ -28,7 +25,7 @@ boxes=(
|
|||||||
# preload packages from source of the following git tags. empty string
|
# preload packages from source of the following git tags. empty string
|
||||||
# means use the current source tree
|
# means use the current source tree
|
||||||
tags=(
|
tags=(
|
||||||
"$UBUNTU_BIONIC64_RELEASE_TAG"
|
"$FINAL_RELEASE_TAG_BIONIC64"
|
||||||
""
|
""
|
||||||
)
|
)
|
||||||
try_reboot=(
|
try_reboot=(
|
||||||
|
@ -10,10 +10,9 @@
|
|||||||
# Nextcloud and Roundcube are downloaded with wget by the setup
|
# Nextcloud and Roundcube are downloaded with wget by the setup
|
||||||
# scripts, so they are not included
|
# scripts, so they are not included
|
||||||
#
|
#
|
||||||
# postfix, postgrey and slapd because they require terminal input
|
# slapd - we want to test installation with setup/ldap.sh
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d "setup" ]; then
|
if [ ! -d "setup" ]; then
|
||||||
echo "Run from the miab root directory"
|
echo "Run from the miab root directory"
|
||||||
exit 1
|
exit 1
|
||||||
@ -36,6 +35,9 @@ fi
|
|||||||
# prevent apt from running needrestart(1)
|
# prevent apt from running needrestart(1)
|
||||||
export NEEDRESTART_SUSPEND=true
|
export NEEDRESTART_SUSPEND=true
|
||||||
|
|
||||||
|
# prevent interaction during package install
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# what major version of ubuntu are we installing on?
|
# what major version of ubuntu are we installing on?
|
||||||
OS_MAJOR=$(. /etc/os-release; echo $VERSION_ID | awk -F. '{print $1}')
|
OS_MAJOR=$(. /etc/os-release; echo $VERSION_ID | awk -F. '{print $1}')
|
||||||
|
|
||||||
@ -66,31 +68,17 @@ install_packages() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# don't install postfix - causes problems with setup scripts
|
# don't install slapd
|
||||||
# and requires user input. exclude postgrey because it will
|
|
||||||
# install postfix as a dependency
|
|
||||||
pkgs="$(sed 's/postgrey//g' <<< "$pkgs")"
|
|
||||||
pkgs="$(sed 's/postfix-[^ $]*//g' <<<"$pkgs")"
|
|
||||||
pkgs="$(sed 's/postfix//g' <<<"$pkgs")"
|
|
||||||
|
|
||||||
# don't install slapd - it requires user input
|
|
||||||
pkgs="$(sed 's/slapd//g' <<< "$pkgs")"
|
pkgs="$(sed 's/slapd//g' <<< "$pkgs")"
|
||||||
|
|
||||||
# manually set PHP_VER if necessary
|
# manually set PHP_VER if necessary
|
||||||
if grep "PHP_VER" <<<"$pkgs" >/dev/null; then
|
if grep "PHP_VER" <<<"$pkgs" >/dev/null; then
|
||||||
pkgs="$(sed "s/\${*PHP_VER}*/$PHP_VER/g" <<< "$pkgs")"
|
pkgs="$(sed "s/\${*PHP_VER}*/$PHP_VER/g" <<< "$pkgs")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $OS_MAJOR -ge 22 ]; then
|
|
||||||
# don't install opendmarc on ubuntu 22 and higher - it requires
|
|
||||||
# interactive user input
|
|
||||||
pkgs="$(sed 's/opendmarc//g' <<< "$pkgs")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "$pkgs" ]; then
|
if [ ! -z "$pkgs" ]; then
|
||||||
H2 "install: $pkgs"
|
H2 "install: $pkgs"
|
||||||
if ! $dry_run; then
|
if ! $dry_run; then
|
||||||
#apt-get install -y -qq $pkgs
|
|
||||||
exec_no_output apt-get install -y $pkgs
|
exec_no_output apt-get install -y $pkgs
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -109,12 +97,26 @@ install_ppas() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_swap() {
|
||||||
|
H1 "Add a swap file to the system"
|
||||||
|
if ! $dry_run; then
|
||||||
|
dd if=/dev/zero of=/swapfile bs=1024 count=$[1024*1024] status=none
|
||||||
|
chmod 600 /swapfile
|
||||||
|
mkswap /swapfile
|
||||||
|
swapon /swapfile
|
||||||
|
echo "/swapfile none swap sw 0 0" >> /etc/fstab
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# install PPAs from sources
|
# install PPAs from sources
|
||||||
install_ppas
|
install_ppas
|
||||||
|
|
||||||
|
# add swap file
|
||||||
|
add_swap
|
||||||
|
|
||||||
# obtain PHP_VER variable from sources
|
# obtain PHP_VER variable from sources
|
||||||
PHP_VER=$(grep "^PHP_VER=" setup/functions.sh | awk -F= '{ print $2 }')
|
PHP_VER=$(source setup/functions.sh; echo $PHP_VER)
|
||||||
|
|
||||||
|
|
||||||
if ! $dry_run; then
|
if ! $dry_run; then
|
||||||
@ -138,11 +140,13 @@ if ! $dry_run; then
|
|||||||
H2 "openssh-server"
|
H2 "openssh-server"
|
||||||
exec_no_output apt-get install -y openssh-server
|
exec_no_output apt-get install -y openssh-server
|
||||||
# ssh-rsa no longer a default algorithm, but still used by vagrant
|
# ssh-rsa no longer a default algorithm, but still used by vagrant
|
||||||
echo "PubkeyAcceptedAlgorithms +ssh-rsa" > /etc/ssh/sshd_config.d/miabldap.conf
|
# echo "PubkeyAcceptedAlgorithms +ssh-rsa" > /etc/ssh/sshd_config.d/miabldap.conf
|
||||||
H2 "emacs"
|
H2 "emacs"
|
||||||
exec_no_output apt-get install -y emacs-nox
|
exec_no_output apt-get install -y emacs-nox
|
||||||
H2 "nptdate"
|
H2 "nptdate"
|
||||||
exec_no_output apt-get install -y ntpdate
|
exec_no_output apt-get install -y ntpdate
|
||||||
|
H2 "net-tools"
|
||||||
|
exec_no_output apt-get install -y net-tools
|
||||||
|
|
||||||
# these are added by system-setup scripts and needed for test runner
|
# these are added by system-setup scripts and needed for test runner
|
||||||
H2 "python3-dnspython jq"
|
H2 "python3-dnspython jq"
|
||||||
|
Loading…
Reference in New Issue
Block a user