1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

Merge branch 'jammyjellyfish2204' of https://github.com/mail-in-a-box/mailinabox into jammyjellyfish2204

# Conflicts:
#	README.md
#	setup/mail-dovecot.sh
#	setup/system.sh
#	setup/webmail.sh
#	setup/zpush.sh
#	tests/test_mail.py
This commit is contained in:
downtownallday
2022-01-11 16:39:39 -05:00
31 changed files with 259 additions and 194 deletions

View File

@@ -42,4 +42,4 @@ export UPSTREAM_TAG="${UPSTREAM_TAG:-}"
# For setup scripts that install miabldap releases
export MIABLDAP_GIT="${MIABLDAP_GIT:-https://github.com/downtownallday/mailinabox-ldap.git}"
export MIABLDAP_RELEASE_TAG="${MIABLDAP_RELEASE_TAG:-v0.54}"
export MIABLDAP_RELEASE_TAG="${MIABLDAP_RELEASE_TAG:-v55}"

View File

@@ -78,16 +78,6 @@ upstream_install() {
sed -i 's|\(.*include:.*zones\.conf.*\)|cat >> /etc/nsd/nsd.conf <<EOF\n do-ip4: yes\n do-ip6: no\nremote-control:\n control-enable: no\nEOF\n\n\1|' setup/dns.sh \
|| die "Couldn't patch setup/dns.sh !!"
fi
if [ ! -z "$PHP_XSL_PACKAGE" ]; then
# For Github Actions - github's ubuntu 18 includes multiple
# PHP versions pre-installed and the php-xsl package for these
# versions is a virtual package of package php-xml. To handle
# this, change the setup scripts so that $PHP_XSL_PACKAGE
# (php-xml) is installed instead of php-xsl.
H2 "Patching upstream setup/zpush.sh to install $PHP_XSL_PACKAGE instead of php-xsl"
sed -i "s/php-xsl/$PHP_XSL_PACKAGE/g" setup/zpush.sh
fi
H2 "Run upstream setup"
if ! setup/start.sh; then

View File

@@ -48,7 +48,7 @@ def test2(tests, server, description):
for qname, rtype, expected_answer in tests:
# do the query and format the result as a string
try:
response = dns.resolver.query(qname, rtype)
response = dns.resolver.resolve(qname, rtype)
except dns.resolver.NoNameservers:
# host did not have an answer for this query
print("Could not connect to %s for DNS query." % server)

View File

@@ -101,7 +101,6 @@ This is a test message. It should be automatically deleted by the test script.""
subject=subject,
)
def imap_login(host, login, pw):
# Attempt to login with IMAP. Our setup uses email addresses
# as IMAP/SMTP usernames.

View File

@@ -3,7 +3,7 @@ load './funcs.rb'
Vagrant.configure("2") do |config|
config.vm.synced_folder "../..", "/mailinabox", id: "mailinabox", automount: false
use_preloaded_box config, "ubuntu/bionic64"
use_preloaded_box config, "ubuntu/jammy64"
# fresh install with encryption-at-rest
@@ -43,7 +43,7 @@ SH
cd /mailinabox
source tests/vagrant/globals.sh || exit 1
export PRIMARY_HOSTNAME=qa3.abc.com
export UPSTREAM_TAG=main
export UPSTREAM_TAG=jammyjellyfish2204
tests/system-setup/upgrade-from-upstream.sh basic totpuser || exit 1
tests/runner.sh upgrade-basic upgrade-totpuser default || exit 2
SH

View File

@@ -1 +1,2 @@
*.box
src/

View File

@@ -1,19 +1,43 @@
def checkout_tag_and_mount(obj, tag)
if "#{tag}" == ""
obj.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
else
_srcdir="src/maibldap-#{tag}"
if not Dir.exist?(_srcdir)
puts "Cloning tag #{tag} to #{_srcdir}"
system("git clone -b #{tag} --depth 1 #{ENV['MIABLDAP_GIT']} #{_srcdir}")
end
obj.vm.synced_folder _srcdir, "/mailinabox", id: "mailinabox", automount: false
end
end
Vagrant.configure("2") do |config|
config.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
checkout_tag_and_mount config, ENV['RELEASE_TAG']
config.vm.define "preloaded-ubuntu-bionic64" do |m1|
m1.vm.box = "ubuntu/bionic64"
m1.vm.provision :shell, :inline => <<-SH
cd /mailinabox
tests/vagrant/preloaded/prepvm.sh --no-dry-run
rc=$?
echo "$rc" > "tests/vagrant/preloaded/prepcode.txt"
echo "$rc" > "/vagrant/prepcode.txt"
[ $rc -gt 0 ] && exit 1
exit 0
SH
end
config.vm.define "preloaded-ubuntu-jammy64" do |m1|
m1.vm.box = "ubuntu/jammy64"
m1.vm.provision :shell, :inline => <<-SH
cd /mailinabox
tests/vagrant/preloaded/prepvm.sh --no-dry-run
rc=$?
echo "$rc" > "/vagrant/prepcode.txt"
[ $rc -gt 0 ] && exit 1
exit 0
SH
end
end

View File

@@ -1,5 +1,13 @@
#!/bin/bash
# load defaults for MIABLDAP_RELEASE_TAG and MIABLDAP_GIT
pushd "../../.." >/dev/null
source tests/system-setup/setup-defaults.sh || exit 1
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
rm -f prepcode.txt
@@ -12,10 +20,44 @@ done
vagrant box update
for box in "preloaded-ubuntu-bionic64"
boxes=(
"preloaded-ubuntu-bionic64"
"preloaded-ubuntu-jammy64"
)
# preload packages from source of the following git tags. empty string
# means use the current source tree
tags=(
"$UBUNTU_BIONIC64_RELEASE_TAG"
""
)
try_reboot=(
false
true
)
idx=0
for box in "${boxes[@]}"
do
if [ ! -z "$1" -a "$1" != "$box" ]; then
continue
fi
export RELEASE_TAG="${tags[$idx]}"
vagrant up $box
upcode=$?
if [ $upcode -ne 0 -a ! -e "./prepcode.txt" ] && ${try_reboot[$idx]}
then
# a reboot may be necessary if guest addtions was newly
# compiled by vagrant plugin "vagrant-vbguest"
echo ""
echo "VAGRANT UP RETURNED $upcode -- RETRYING AFTER REBOOT"
vagrant halt $box
vagrant up $box
upcode=$?
fi
let idx+=1
prepcode=$(cat "./prepcode.txt")
rm -f prepcode.txt
echo ""
@@ -49,5 +91,5 @@ do
vagrant box remove $cached_name
code=$?
fi
echo "Result: $code"
echo "Remove cache box result: $code - ignoring"
done

View File

@@ -66,6 +66,13 @@ install_packages() {
# don't install slapd - it requires user input
pkgs="$(sed 's/slapd//g' <<< "$pkgs")"
if [ $(. /etc/os-release; echo $VERSION_ID | awk -F. '{print $1}') -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
echo "install: $pkgs"

View File

@@ -4,7 +4,7 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
config.vm.network "public_network", bridge: "#$default_network_interface"
use_preloaded_box config, "ubuntu/bionic64", ".."
use_preloaded_box config, "ubuntu/jammy64", ".."
# vanilla install