From c95f59b6ff25c2f4b948773bcf5c24fa8605b72e Mon Sep 17 00:00:00 2001 From: John Coffey Date: Wed, 14 Oct 2026 11:39:11 -0700 Subject: [PATCH] survey: describe the Node a host webmail runs on, not the system's The node line still judged a system Node against the old minimum of 22, so a machine with Node 22 read "too old for a host install of the webmail" two lines above the shapes section offering one with --install-deps. A host webmail runs on inbuxa's own Node 26 in /opt/inbuxa, so that's the one the line now describes: there, there in the wrong version, or not there yet with the same --install-deps offer. A system Node is reported as not used. --- internal/plan/plan_test.go | 7 +++++++ internal/plan/survey.go | 14 ++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/internal/plan/plan_test.go b/internal/plan/plan_test.go index d6666b1..3ebcc84 100644 --- a/internal/plan/plan_test.go +++ b/internal/plan/plan_test.go @@ -73,6 +73,13 @@ func TestTheSurveyOffersWhatTheInstallerCanAdd(t *testing.T) { if !strings.Contains(text, "host (with --install-deps: the webmail runs on the installer's own Node") { t.Errorf("a webmail on the host is refused rather than offered:\n%s", text) } + if !strings.Contains(text, "node not installed (a host webmail runs on inbuxa's own Node 26; --install-deps adds it)") { + t.Errorf("the node line doesn't make the same offer:\n%s", text) + } + f.Node = host.Node{Present: true, Version: "22.14.0", Major: 22, Path: "/usr/bin/node"} + if text := SurveyText(f); !strings.Contains(text, "22.14.0 at /usr/bin/node (not used:") || strings.Contains(text, "too old") { + t.Errorf("a system Node is judged rather than reported:\n%s", text) + } f.Systemd = false // and this, nothing installs if text := SurveyText(f); !strings.Contains(text, "host (no: a host install needs systemd") { t.Errorf("a machine without systemd is offered a host webmail:\n%s", text) diff --git a/internal/plan/survey.go b/internal/plan/survey.go index 58cd8ae..66b55fb 100644 --- a/internal/plan/survey.go +++ b/internal/plan/survey.go @@ -7,6 +7,7 @@ import ( "fmt" "strings" + "git.coffeylabs.org/inbuxa/inbuxa-installer/internal/deps" "git.coffeylabs.org/inbuxa/inbuxa-installer/internal/host" ) @@ -50,12 +51,17 @@ func SurveyText(f host.Facts) string { } fmt.Fprintf(&b, " %-22s %s\n", "glibc", glibc) - node := "not installed" + // The Node that matters is the installer's own, the one a host webmail + // runs on. A system Node is reported, but never judged: it isn't used, + // and calling it too old read as a refusal two lines above the offer. + node := fmt.Sprintf("not installed (a host webmail runs on inbuxa's own Node %d; --install-deps adds it)", deps.NodeMajor) switch { - case f.Node.Present && f.Node.Major >= 22: - node = f.Node.Version + " at " + f.Node.Path + case f.Node.Present && f.Node.Path == host.OwnPath && f.Node.Major == deps.NodeMajor: + node = "inbuxa's own Node " + f.Node.Version + " at " + f.Node.Path + case f.Node.Present && f.Node.Path == host.OwnPath: + node = fmt.Sprintf("inbuxa's own Node %s at %s (a host webmail needs Node %d)", f.Node.Version, f.Node.Path, deps.NodeMajor) case f.Node.Present: - node = f.Node.Version + " (too old for a host install of the webmail)" + node = fmt.Sprintf("%s at %s (not used: a host webmail runs on inbuxa's own Node %d; --install-deps adds it)", f.Node.Version, f.Node.Path, deps.NodeMajor) } fmt.Fprintf(&b, " %-22s %s\n", "node", node) if f.Existing != "" { -- 2.54.0