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.
This commit is contained in:
2026-09-24 08:11:57 -07:00
parent c78847440d
commit b6bc126651
2 changed files with 24 additions and 18 deletions
+10 -7
View File
@@ -24,16 +24,19 @@ DIR=/var/lib/inbuxa
# Whichever runtime this machine has. The installer picks docker where there # 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 # is one and podman on the Red Hat family; a case that says "docker" only
# tests half the distributions it is run on. # tests half the distributions it is run on.
if command -v docker >/dev/null 2>&1; then #
RT=docker # Asked at each call, not once at the top: these cases start on a machine
compose() { docker compose -f "$DIR/compose.yaml" "$@"; } # with no runtime at all and install one along the way, so anything decided
else # up here is decided before the answer exists.
RT=podman rt() { command -v docker >/dev/null 2>&1 && echo docker || echo podman; }
compose() { compose() {
if [ "$(rt)" = docker ]; then
docker compose -f "$DIR/compose.yaml" "$@"
else
DOCKER_HOST=unix:///run/podman/podman.sock \ DOCKER_HOST=unix:///run/podman/podman.sock \
/usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@" /usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@"
}
fi fi
}
echo "==> installing" echo "==> installing"
OUT="$(/tmp/inbuxa install --local --domain example.test --install-deps --yes 2>&1)"; rc=$? 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
echo "==> the bootstrap credential did not outlive the setup" 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 "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" 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"
+10 -7
View File
@@ -30,16 +30,19 @@ DIR=/var/lib/inbuxa
# Whichever runtime this machine has. The installer picks docker where there # 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 # is one and podman on the Red Hat family; a case that says "docker" only
# tests half the distributions it is run on. # tests half the distributions it is run on.
if command -v docker >/dev/null 2>&1; then #
RT=docker # Asked at each call, not once at the top: these cases start on a machine
compose() { docker compose -f "$DIR/compose.yaml" "$@"; } # with no runtime at all and install one along the way, so anything decided
else # up here is decided before the answer exists.
RT=podman rt() { command -v docker >/dev/null 2>&1 && echo docker || echo podman; }
compose() { compose() {
if [ "$(rt)" = docker ]; then
docker compose -f "$DIR/compose.yaml" "$@"
else
DOCKER_HOST=unix:///run/podman/podman.sock \ DOCKER_HOST=unix:///run/podman/podman.sock \
/usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@" /usr/local/lib/docker/cli-plugins/docker-compose -f "$DIR/compose.yaml" "$@"
}
fi fi
}
WORK=/tmp/lab WORK=/tmp/lab
LABNET=inbuxa-e2e LABNET=inbuxa-e2e
LABSUBNET=172.31.254.0/24 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
echo "==> and nothing was left behind that should not be" 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" grep -q "RECOVERY_ADMIN" <<<"$ENVOUT" && bad "the server still carries a recovery admin" || ok "no recovery admin on the server"
echo echo