chore(lxc): make the in-repo community-scripts copies a verified mirror of upstream
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:49pushes the in-repo$CANONscripts into the test container, and thegate-lxcjob (.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.jsassertion exists anywhere inlxc-smoke-test.shore2e/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.jswrite, neither of which was ever proposed upstream; upstream carriesnginx_enable_site,create_backup/restore_backup, root service user and thecommunity-scripts/corebootstrap, none of which are reflected in-repo. - Docs assert the wrong thing.
docs/deployment/LXC-TESTING.md:68calls the in-repo scripts "the canonical install/update scripts", andstatic/config.js:2-3cross-references them as the live LXC writer. deploy/lxc/community-scripts/json/rackula.jsonis dead. ProxmoxVE has nojson/directory; app metadata now lives in PocketBase, edited via/pocketbase rackula ...bot commands. The in-repo file also still sayscount.racku.lawhere upstream metadata sayswww.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.shfetches the two upstream raw files and diffs them against the in-repo copies, with an explicit allowlist for theRACKULA_PREBUILD_TARBALLdev hook - [ ] Wired into CI and run on a schedule, failing loud on drift
- [ ]
lxc-smoke-test.shassertscurl -s http://$IP/config.jscontainsstorage: "server" - [ ] In-repo copies reconciled to upstream (root user,
curl | bashBun,nginx_enable_site,create_backup/restore_backup,corebootstrap) plus the dev hook - [ ]
docs/deployment/LXC-TESTING.mdand thestatic/config.jscross-reference describe the copy as a mirror, not the source - [ ]
deploy/lxc/community-scripts/json/rackula.jsondeleted 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.jsfix) - #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 -qform to the remaining five checks insmoke_checks()
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.
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.shfetches upstream'sinstall/rackula-install.shand thect/rackula.shupdate_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 againstmainwith upstream's current scripts, plus the existing release gate. config.jsstorage: "server"assertion: already insmoke_checks()since #3385. #2060 is fixed by shippingdeploy/lxc/config.jsin 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.mdand thestatic/config.jscross-reference now describe upstream as the source. - Delete
json/rackula.json: already gone. The PocketBase metadata flow is documented inLXC-TESTING.md. pipefailwithoutgrep -qfor the remaining checks: done,_checknow setspipefailfor 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