bootstrap: embed status-nav.js with the viewer pages (#1235)
The shared masthead+nav builder every status page mounts wasn't in statusPagesFS's explicit embed list, so bootstrap --collectors-only staged a page family that rendered navless (caught on the 27289566 rollout — bridged by hand-scp'ing it into /opt/lchat/status-pages until this ships). The embed test now pins it, plus music.html.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2 files changed,
+7
−3
bootstrap.go+5 −2bootstrap_test.go+2 −1
diff --git a/bootstrap.go b/bootstrap.go| index a24ef71..4615e69 100644 |
| --- a/bootstrap.go |
| +++ b/bootstrap.go |
| @@ -125,13 +125,16 @@ var unitHardening string |
| var unitHardeningTimer string |
| // statusPagesFS carries the static status viewer pages the collectors upload — |
| -// the .html, the shared status.css, and the static page scripts (waterfall.js). |
| +// the .html, the shared status.css, and the static page scripts: the shared |
| +// masthead+nav builder (status-nav.js — every page mounts it; forgetting it |
| +// here renders the whole family navless, hence the embed test) and the |
| +// funding page's normative waterfall.js. |
| // The JSON those pages fetch (fleet, carbon, ssh, hardening, contributors, …) |
| // is collector- and operator-generated and lives mutably on the box, so it is |
| // deliberately NOT embedded: baking it in would clobber live data with a stale |
| // snapshot on every deploy. |
| // |
| -//go:embed web/status/*.html web/status/status.css web/status/waterfall.js |
| +//go:embed web/status/*.html web/status/status.css web/status/status-nav.js web/status/waterfall.js |
| var statusPagesFS embed.FS |
| // serviceUser is the unprivileged account every unit runs as (see the hardened |
diff --git a/bootstrap_test.go b/bootstrap_test.go| index 36a96b4..a31dac9 100644 |
| --- a/bootstrap_test.go |
| +++ b/bootstrap_test.go |
| @@ -119,7 +119,8 @@ func TestWriteCollectorFiles(t *testing.T) { |
| // nothing else (no ssh/ dir, no JSON). |
| pagesDir := filepath.Join(appDir, "status-pages") |
| for _, page := range []string{ |
| - "index.html", "hardening.html", "ssh.html", "status.css", |
| + "index.html", "hardening.html", "ssh.html", "music.html", |
| + "status.css", "status-nav.js", |
| } { |
| assertFileMode(t, filepath.Join(pagesDir, page), 0o644) |
| } |