From b6bc12665111a392a479f71f817b9641c3f8a065 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 24 Sep 2026 08:11:46 -0700 Subject: [PATCH] Prove the distributions, and ask the runtime question at the right time install-local now passes on Debian 13, Ubuntu 24.04, Fedora 43, Rocky 9 and Arch: twenty checks each, ending with a sign-in to the webmail the installer put there. Two of those five have no docker at all and went through podman, with the same compose file and the same plugin. The case had a bug the first four runs could not show. It chose between docker and podman once, at the top of the script -- on a machine that starts with neither and installs one halfway through. Debian passed because that run predates the helper; Fedora and Rocky passed because podman was the right answer anyway; Ubuntu was the first machine where the answer changed underneath it, and it drove compose at a podman socket that was never going to exist. The question is asked at each call now. Worth keeping in mind for the installer proper, which had the same shape of bug a day earlier: anything learned before dependencies are installed is learned too early. --- e2e/cases/install-local.sh | 21 ++++++++++++--------- e2e/cases/install-public.sh | 21 ++++++++++++--------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/e2e/cases/install-local.sh b/e2e/cases/install-local.sh index c7b9b86..4d40e10 100644 --- a/e2e/cases/install-local.sh +++ b/e2e/cases/install-local.sh @@ -24,16 +24,19 @@ DIR=/var/lib/inbuxa # Whichever runtime this machine has. The installer picks docker where there # is one and podman on the Red Hat family; a case that says "docker" only # tests half the distributions it is run on. -if command -v docker >/dev/null 2>&1; then - RT=docker - compose() { docker compose -f "$DIR/compose.yaml" "$@"; } -else - RT=podman - compose() { +# +# Asked at each call, not once at the top: these cases start on a machine +# with no runtime at all and install one along the way, so anything decided +# up here is decided before the answer exists. +rt() { command -v docker >/dev/null 2>&1 && echo docker || echo podman; } +compose() { + if [ "$(rt)" = docker ]; then + docker compose -f "$DIR/compose.yaml" "$@" + else DOCKER_HOST=unix:///run/podman/podman.sock \ /usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@" - } -fi + fi +} echo "==> installing" OUT="$(/tmp/inbuxa install --local --domain example.test --install-deps --yes 2>&1)"; rc=$? @@ -66,7 +69,7 @@ curl -fsS http://127.0.0.1:8080/api/health 2>/dev/null | grep -q '"ok":true' && echo echo "==> the bootstrap credential did not outlive the setup" -ENVOUT="$($RT inspect --format '{{range .Config.Env}}{{println .}}{{end}}' "$(compose ps -q server)")" +ENVOUT="$("$(rt)" inspect --format '{{range .Config.Env}}{{println .}}{{end}}' "$(compose ps -q server)")" grep -q "RECOVERY_ADMIN" <<<"$ENVOUT" && { bad "the server still carries a recovery admin"; echo "$ENVOUT" | grep RECOVERY | sed 's/^/ /'; } || ok "no recovery admin in the running server" grep -q "INBUXA_WEBMAIL_CLIENT_SECRET" <<<"$ENVOUT" && ok "the webmail's client secret is where it belongs" || bad "the server has no webmail client secret" diff --git a/e2e/cases/install-public.sh b/e2e/cases/install-public.sh index e4f270b..5c0c237 100644 --- a/e2e/cases/install-public.sh +++ b/e2e/cases/install-public.sh @@ -30,16 +30,19 @@ DIR=/var/lib/inbuxa # Whichever runtime this machine has. The installer picks docker where there # is one and podman on the Red Hat family; a case that says "docker" only # tests half the distributions it is run on. -if command -v docker >/dev/null 2>&1; then - RT=docker - compose() { docker compose -f "$DIR/compose.yaml" "$@"; } -else - RT=podman - compose() { +# +# Asked at each call, not once at the top: these cases start on a machine +# with no runtime at all and install one along the way, so anything decided +# up here is decided before the answer exists. +rt() { command -v docker >/dev/null 2>&1 && echo docker || echo podman; } +compose() { + if [ "$(rt)" = docker ]; then + docker compose -f "$DIR/compose.yaml" "$@" + else DOCKER_HOST=unix:///run/podman/podman.sock \ /usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@" - } -fi + fi +} WORK=/tmp/lab LABNET=inbuxa-e2e LABSUBNET=172.31.254.0/24 @@ -159,7 +162,7 @@ CODE=$(curl -s -o /dev/null -w '%{http_code}' --cacert "$WORK/chain.pem" --resol echo echo "==> and nothing was left behind that should not be" -ENVOUT="$($RT inspect --format '{{range .Config.Env}}{{println .}}{{end}}' "$(compose ps -q server)")" +ENVOUT="$("$(rt)" inspect --format '{{range .Config.Env}}{{println .}}{{end}}' "$(compose ps -q server)")" grep -q "RECOVERY_ADMIN" <<<"$ENVOUT" && bad "the server still carries a recovery admin" || ok "no recovery admin on the server" echo