Skip to content

Feature/test controls - #57

Merged
LeoLTM merged 19 commits into
mainfrom
feature/test-controls
Oct 28, 2026
Merged

LeoLTM merged 19 commits into
mainfrom
feature/test-controls

Conversation

@LeoLTM

@LeoLTM LeoLTM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

No description provided.

Both desktop apps were superseded by headless-rust and are no longer
built in CI. They remain available in the git history.
- diagnostics/ was written for the August Wi-Fi freeze investigation.
  Its fixes now live in setup-network.sh, and `diag:fix` wrote a second,
  conflicting sysctl file.
- The updater slice, the window/updater RPC stubs and `setup:esptool`
  (an amd64 binary nothing used) came from the Electrobun app.
- arduino/old/old.cpp is the 2023 prototype.
Cargo.toml becomes the single version source. It said 0.1.0 while
package.json said 0.5.0 and rpc.rs hard-coded "0.5.0-rust", so there was
no way to tell what a Pi was running. /api/health, getLocalVersion and
the startup banner now report the version plus the commit passed in
SPEEDCAMERA_GIT_SHA (set by package builds; local builds show "dev").
Both callers kept their own list of relative and /home/pi/... guesses.
Look in /usr/lib/speedcamera, where the package installs the script,
and fall back to the checkout copy for `cargo run`.
The packaged daemon runs as a system user without a password. Checking
a typed password first would make shutdown fail whenever one was entered.
The fixed -L /usr/lib/aarch64-linux-gnu made the linker pick arm64
libraries whenever they are installed next to another architecture, as
in the cross-compilation image. pkg-config already supplies the paths,
and the fallback relies on the linker's defaults.
packaging/build-deb.sh cross-compiles in a Debian Bookworm container
(podman or docker), so the Pi no longer needs Rust, Bun or internet to
update. Building on Bookworm keeps the binary compatible with Trixie.

The package runs the daemon as a dedicated `speedcamera` user, keeps
data in /var/lib/speedcamera and ships a sudoers rule limited to the
commands the daemon runs. Installed over a git-checkout setup, preinst
and postinst stop the old unit and move ~/.speedcamera over; an aborted
install restores the old service.
`scripts/pi.sh deploy|status|logs|uninstall` installs a locally built,
released or given .deb over SSH. It also works over the offline hotspot,
because the Pi only needs internet once, for the first install's
dependencies. packaging/install.sh installs a release directly on a Pi.

Removes the six old scripts and two unit files, which kept three
diverging copies of the systemd unit and required building on the Pi.
The two spawn-and-check scripts duplicated their boilerplate and wrote
test violations into the developer's real ~/.speedcamera; verify-ws.ts
wasn't wired to anything. tests/server.test.ts covers the same HTTP, RPC
and live-event checks against a throwaway data dir.
- The build job produces the arm64 package (uploaded as an artifact on
  every run) instead of an x86 binary nobody used.
- Releases attach speedcamera_arm64.deb and SHA256SUMS next to the
  firmware, and a tag must match the Cargo.toml version.
- The test job runs the integration suite, and the Rust cache now
  covers headless-rust/target (rust-cache was looking at ./target).
CI runs the build container as the runner's uid, which has no passwd
entry in the image, and visudo refuses to run for such users. Validate
the sudoers file in a separate root container (it only reads the file)
and keep the build itself running as the calling user.
Deploy headless-rust as a prebuilt .deb; remove legacy apps and scripts
@LeoLTM LeoLTM self-assigned this Oct 28, 2026
@LeoLTM
LeoLTM merged commit e69c84e into main Oct 28, 2026
4 checks passed
@LeoLTM
LeoLTM deleted the feature/test-controls branch October 28, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant