Rackula icon indicating copy to clipboard operation
Rackula copied to clipboard

chore(lxc): make the in-repo community-scripts copies a verified mirror of upstream

Open ggfevans opened this issue 2 months ago • 2 comments

Summary

The in-repo copies under deploy/lxc/community-scripts/ are treated as canonical, but they stopped being what users run on 2026-06-12. Nothing detects the drift, and the release gate tests the wrong copy.

Motivation

The #2060 defect survived three releases undetected because of this. Specifics, verified 2026-09-19:

  • The release gate tests a copy nobody runs. scripts/lxc-smoke-test.sh:49 pushes the in-repo $CANON scripts into the test container, and the gate-lxc job (.github/workflows/release.yml:304-321) has been green through v26.7.0, v26.8.0 and v26.9.0 while every upstream install ran in browser mode.
  • No config.js assertion exists anywhere in lxc-smoke-test.sh or e2e/deploy-smoke.spec.ts, so the storage mode is never checked at all.
  • The in-repo copy has diverged in both directions. It carries the SHASUMS256 verification and the config.js write, neither of which was ever proposed upstream; upstream carries nginx_enable_site, create_backup/restore_backup, root service user and the community-scripts/core bootstrap, none of which are reflected in-repo.
  • Docs assert the wrong thing. docs/deployment/LXC-TESTING.md:68 calls the in-repo scripts "the canonical install/update scripts", and static/config.js:2-3 cross-references them as the live LXC writer.
  • deploy/lxc/community-scripts/json/rackula.json is dead. ProxmoxVE has no json/ directory; app metadata now lives in PocketBase, edited via /pocketbase rackula ... bot commands. The in-repo file also still says count.racku.la where upstream metadata says www.racku.la.

The repo already has this pattern working elsewhere: scripts/check-header-parity.sh and scripts/check-compose-persist-parity.sh, both wired into .github/workflows/test.yml:152-156.

Acceptance Criteria

  • [ ] scripts/check-lxc-upstream-parity.sh fetches the two upstream raw files and diffs them against the in-repo copies, with an explicit allowlist for the RACKULA_PREBUILD_TARBALL dev hook
  • [ ] Wired into CI and run on a schedule, failing loud on drift
  • [ ] lxc-smoke-test.sh asserts curl -s http://$IP/config.js contains storage: "server"
  • [ ] In-repo copies reconciled to upstream (root user, curl | bash Bun, nginx_enable_site, create_backup/restore_backup, core bootstrap) plus the dev hook
  • [ ] docs/deployment/LXC-TESTING.md and the static/config.js cross-reference describe the copy as a mirror, not the source
  • [ ] deploy/lxc/community-scripts/json/rackula.json deleted and the PocketBase metadata flow documented

Notes

Reconciling in-repo to upstream means deliberately dropping our pinned and checksummed Bun install and our rackula service user in that copy. That is the point: the copy should reflect what users actually run. See #3380 for why those are not winnable upstream.

Sequence after #2060, so the parity check is not immediately red on the known config.js delta.

Related

  • #2060 (upstream config.js fix)
  • #3380 (closed won't-fix: why in-repo hardening is not upstream)

Added during Phase 1b (PR #3385)

The five pre-existing checks in smoke_checks() carry the same defect CodeRabbit flagged on the two new ones: they run inside a remote bash -c, so the smoke script's own pipefail never reaches them, and a matching grep returns 0 even when the curl before it failed.

The live risk is the pair of version.json checks (curl ... | grep -qE ...): a transfer that emits matching bytes and then fails currently reports a pass. This was reproduced directly against the pre-fix form of the new checks, so it is a demonstrated failure mode, not a theoretical one.

The two new config.js checks were fixed in PR #3385 (c35ddd01). Sweeping the remaining five was deliberately left out of that PR to keep its scope contained.

Note the coupling before changing them: adding set -o pipefail while keeping grep -q makes things worse, because -q exits on first match, curl then dies on SIGPIPE, and the pipeline reports 141 on a check whose content actually matched. Verified: pipefail plus -q on a matching stream exits 141. pipefail and dropping -q have to land together. _check already discards output, so dropping -q costs nothing.

  • [ ] Apply the pipefail + no-grep -q form to the remaining five checks in smoke_checks()

ggfevans avatar Sep 20 '26 03:09 ggfevans

Adding a finding from the #3478 investigation: scripts/lxc-smoke-test.sh (around lines 45 and 403-408) sources the legacy ProxmoxVE/main/misc/install.func and runs the in-repo deploy/lxc/community-scripts/install/rackula-install.sh. That copy has drifted from upstream (it creates a rackula user, verifies Bun's checksum and writes config.js; upstream does none of these), and ct/rackula.sh now boots from community-scripts/core, not misc/install.func.

So the LXC gate passes on a path users don't run. When this mirror is made verified, the smoke test should run the upstream installer through the core engine.

ggfevans avatar Oct 03 '26 01:10 ggfevans

Scope change, decided 2026-11-08 and implemented in #3635: instead of reconciling the in-repo copy and adding a parity check, the copy is deleted and the smoke test runs upstream's live scripts.

How each acceptance criterion maps:

  • Parity check (check-lxc-upstream-parity.sh): replaced. With no in-repo copy there is nothing to drift. scripts/lxc-smoke-test.sh fetches upstream's install/rackula-install.sh and the ct/rackula.sh update_script, and swaps only the release download for the local tarball.
  • Wired into CI on a schedule: covered by the new lxc-nightly.yml, which runs that smoke test daily against main with upstream's current scripts, plus the existing release gate.
  • config.js storage: "server" assertion: already in smoke_checks() since #3385. #2060 is fixed by shipping deploy/lxc/config.js in the tarball.
  • Reconcile the in-repo copies to upstream: moot, the copies are deleted.
  • Docs describe the copy as a mirror: LXC-TESTING.md, RELEASE-PIPELINE.md, SELF-HOSTING.md and the static/config.js cross-reference now describe upstream as the source.
  • Delete json/rackula.json: already gone. The PocketBase metadata flow is documented in LXC-TESTING.md.
  • pipefail without grep -q for the remaining checks: done, _check now sets pipefail for every check.

End-to-end evidence comes from the first LXC Nightly Smoke run after merge (install path) and from the next release's gate. Upgrade-mode evidence follows once a release with the server-mode tarball ships.


Generated by Claude Code

ggfevans avatar Nov 08 '26 06:11 ggfevans