hub: delete the host-install version label (R-94) + invert hostinstall gate 1
The Setup tab said 'host-install 1.19.0' while the served script was 1.22.0, and had been wrong since 2026-07-14. Deriving the number honestly is not possible: the Option-1 command downloads felhom-host-install.sh from the website at RUN TIME and the website git-syncs main every 30s (R-110), so no build-time value in the hub can be true. R-94(a) offered derive-or-delete; deleted, which removes the drift class instead of automating it. - configs.go: hostInstallVersion const, pageData.ScriptVersion field and its assignment all removed; a NOTE in their place records why there is no constant here. - customer_unified.html: the sentence now says the command always fetches the current installer, and renders no version. - hostinstall_gates.py gate 1: the third assertion INVERTS — it used to require the hub const to equal SCRIPT_VERSION, it now asserts the hub carries no host-install version literal at all, matched in six code shapes across every .go/.html under hub/ (comments are deliberately not stripped: a // inside a URL literal would blind the scan). - render_test.go: the assertion 'html contains hostInstallVersion' compared the constant to itself and passed at ANY value — demonstrated green with the const at 9.9.9 while the script was 1.22.0. Deleted, not replaced: there is no longer a version to assert. - felhom-host-install.sh: COMMENT ONLY (SCRIPT_VERSION untouched) — it claimed the gate keeps the hub copy equal, an invariant that no longer exists. Red-proofs: restoring the const fails the rewritten gate 1 (3 shapes hit); the old render_test assertion passes at 9.9.9.
This commit is contained in:
@@ -20,12 +20,14 @@ import (
|
||||
|
||||
var validCustomerID = regexp.MustCompile(`^[a-zA-Z0-9.\-]+$`)
|
||||
|
||||
// hostInstallVersion is the felhom-host-install.sh version the customer page's install-command
|
||||
// generator targets. Kept in sync with scripts/felhom-host-install.sh SCRIPT_VERSION — the generator
|
||||
// only ever emits flags this version parses. Display-only (the Option-1 command downloads the served
|
||||
// script, which is always current); bump when the generator's flag surface follows a new script.
|
||||
// Drift is now gated: scripts/hostinstall_gates.py asserts this const == SCRIPT_VERSION (drill F-1).
|
||||
const hostInstallVersion = "1.19.0"
|
||||
// NOTE (R-94, 2026-08-02): there is deliberately NO host-install version constant here, and the
|
||||
// Setup tab renders no version number. The hub cannot know which version a box will run: the
|
||||
// Option-1 command downloads felhom-host-install.sh from the website at run time, and the website
|
||||
// git-syncs `main` every 30s (R-110). Any build-time literal here is a guess wearing a version
|
||||
// number's authority — the previous const said 1.19.0 while the served script was 1.22.0, and had
|
||||
// been wrong since 2026-07-14. The single version source is scripts/felhom-host-install.sh's
|
||||
// SCRIPT_VERSION; scripts/hostinstall_gates.py gate 1 now asserts this file's ABSENCE of any
|
||||
// host-install version literal.
|
||||
|
||||
// validSemver matches a bare X.Y.Z controller version (the floor format). Empty is also accepted by
|
||||
// the floor handlers (clears the override).
|
||||
@@ -331,9 +333,6 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
CSRFField template.HTML
|
||||
CSRFToken string
|
||||
|
||||
// ScriptVersion drives the install-command generator's header (GL-7). Display-only.
|
||||
ScriptVersion string
|
||||
|
||||
// Hosts (v0.47.0): the customer's enrolled hosts for the Host tab — a LIST by design
|
||||
// (1 today, N for a later HA cluster). Each entry is the hostDetailData view-model map
|
||||
// the shared host_detail_body sub-template renders.
|
||||
@@ -484,8 +483,6 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
CSRFField: s.csrfField(r),
|
||||
CSRFToken: s.csrfToken(r),
|
||||
|
||||
ScriptVersion: hostInstallVersion,
|
||||
|
||||
Hosts: hostViews,
|
||||
}
|
||||
|
||||
|
||||
@@ -215,10 +215,11 @@ func TestTemplates_InstallGenerator(t *testing.T) {
|
||||
t.Errorf("generator control missing: %s", id)
|
||||
}
|
||||
}
|
||||
// targets the right script version + carries the client-side customer id
|
||||
if !strings.Contains(html, hostInstallVersion) {
|
||||
t.Errorf("ScriptVersion %s not rendered", hostInstallVersion)
|
||||
}
|
||||
// carries the client-side customer id. There is deliberately NO version assertion here: R-94
|
||||
// deleted the rendered host-install version, because the hub cannot know which version a box
|
||||
// will run (the script is fetched at run time). The assertion that used to sit here compared
|
||||
// hostInstallVersion to itself and passed at any value — it was demonstrated green with the
|
||||
// const set to "9.9.9" while the served script was 1.22.0.
|
||||
if !strings.Contains(html, `data-customer-id="peti-felhom"`) {
|
||||
t.Errorf("generator missing data-customer-id")
|
||||
}
|
||||
|
||||
@@ -491,9 +491,10 @@
|
||||
<section class="card">
|
||||
<h2>Setup Command</h2>
|
||||
<p class="text-muted" style="margin-bottom: 1rem; font-size: 0.85rem;">
|
||||
Day-0 host bootstrap for host-install <strong>{{.ScriptVersion}}</strong>. Run on a
|
||||
freshly-PVE-installed Proxmox <strong>host</strong> as root (create the customer in the
|
||||
hub first). It enrolls the host, installs + verifies the agent, and provisions the guest;
|
||||
Day-0 host bootstrap. The command always fetches the <strong>current</strong>
|
||||
felhom-host-install.sh from felhom.eu — there is no version to pick here. Run it
|
||||
on a freshly-PVE-installed Proxmox <strong>host</strong> as root (create the customer in
|
||||
the hub first). It enrolls the host, installs + verifies the agent, and provisions the guest;
|
||||
the in-guest controller then pulls its own <code>controller.yaml</code>. The retrieval
|
||||
passphrase is entered at the no-echo prompt — never on the command line.
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user