The golden's startup task fetches the server's script at every start; for the VM of a running Add hardware job the server answers with broom-onboard.ps1 and the job's token. The script gets the job and the library's drivers over HTTP and posts its result; the VM's disk is an NBD export. Nothing is written into the golden's disk by the server: no iscsiadm, no ntfs-3g. The Update script feature is removed. The VM features now need QEMU and OVMF only.
Diskless goldens over iSCSI, Add hardware, maintenance VM in the browser, machine power / display / hardware list, roles with permissions and HTTPS for the web admin. Includes the security fixes from the review on #2.
Co-authored-by: Mojo-LB <35627917+Mojo-LB@users.noreply.github.com>
BIOS PXE ROMs (DHCP arch 0) got no boot file; Broom was UEFI-only.
- DHCP/TFTP: serve undionly.kpxe (iPXE + embedded bios.ipxe:
chains autoexec.ipxe, so router-DHCP mode does not loop)
- iPXE patch 0003: menu rules as CP437 0xc4 on the BIOS text
console, which does not decode UTF-8 (screen was garbled)
- SSD on BIOS machines: MBR (Windows boots BIOS only from MBR),
disk id "BROM" ("BROL" Linux-only), partition role from its
place. Relaid only when the table is surely of the other kind
- Windows stage: no BootNext under BIOS. Writes the boot
partition + MBR code from bios.tar.gz, then POST
/api/boot/local; next /boot.ipxe sanboots that drive once
(300 s, only from the IP of the machine's menu choice). Drive
from EDD MBR ids in /sys/kernel/boot_params, no edd module
- prep-win: build broom\bios (fixed MBR VHD, bcdboot /f BIOS);
any failure there leaves a UEFI-only golden, never stops prep.
Publish packs it as bios.tar.gz when present
- strict reset on BIOS: bootorder task deletes \bootmgr and drops
BROOMWIN/BROOMEFI drive letters
- shim line skipped on pcbios; deploy warns on firmware mismatch
- docs: legacy BIOS, tested on Windows 11 Pro and Enterprise
Windows goldens prepped before this boot UEFI clients only: run the
prep command again, upload, Publish. Stage bundle needs a rebuild.
BIOS PXE ROMs (DHCP arch 0) got no boot file; Broom was UEFI-only.
- DHCP/TFTP: serve undionly.kpxe (iPXE with bios.ipxe embedded:
chains autoexec.ipxe, so router-DHCP mode does not loop)
- SSD on BIOS machines: MBR (Windows boots BIOS only from MBR),
marked by disk id "BROM" ("BROL" Linux-only); partition role
from its place. GPT<->MBR layout redone on firmware mode switch
- Windows stage: no BootNext under BIOS. Writes the boot
partition + MBR code from bios.tar.gz, then POST /api/boot/local;
the next /boot.ipxe sanboots that drive once (120 s, only from
the IP of the machine's menu choice). Drive found via EDD MBR ids
in /sys/kernel/boot_params, no edd module
- prep-win: build broom\bios (fixed MBR VHD, bcdboot /f BIOS);
publish packs it as bios.tar.gz when present
- strict reset on BIOS: bootorder task deletes \bootmgr and drops
BROOMWIN/BROOMEFI drive letters
- shim line skipped on pcbios; deploy warns on UEFI image to BIOS PC
Windows goldens prepped before this boot UEFI clients only: run the
prep command again, upload, Publish. Stage bundle needs a rebuild.
The web admin and Capture ran over plain HTTP and sent the owner
password in the clear on a LAN that may not be isolated.
- auth: 4-message handshake (hello → salt + nonce → proof → server
proof). PBKDF2-SHA256 runs on the client; the server keeps a
verifier only, so a copied DB logs nobody in and a sniffed sign-in
yields no password or replayable proof.
- new passwords (setup, change, owner reset) travel as verifiers
sealed with the handshake's session key, or the setup token for
the first owner; neither the token nor the password is sent
- web: SHA-256/HMAC/PBKDF2 in plain JS (crypto.js), since WebCrypto
is off on http:// to an IP; values pinned against the Rust side
- capture: same handshake, checks the server's proof
- deps: argon2 out (no server-side KDF left), pbkdf2 in; random
bytes from getrandom(2)
- ci: SLSA build provenance (attest-build-provenance) on every
release file
- docs: quick start checks SHA256SUMS and explains
`gh attestation verify`; read-before-run variant of the prep
scripts
- prep-linux.sh: body in main() so a cut-off `curl | bash` runs
nothing
- comments: drop stale "one-time token" wording for the prep
scripts
BREAKING CHANGE: accounts store a verifier instead of an argon2
hash and sessions gain a key column; an existing bootrom.db no
longer works, so start with a new one. /api/auth/login takes
{hs, proof} after /api/auth/hello; /api/password and /api/users
take a sealed `cred` instead of a plain password.
No server runs an older version; every deploy starts fresh, so the
code that migrated old installs goes.
- remove LIO/zram-kernel cleanup, dnsmasq/tftpd takeover, old
directory layout move, admin_pw → owner account conversion
- remove DB migrations: schema comes from SCHEMA only, unique
indexes live there; leases lose the always-"full" source column
- rename config keys ltsp_user/ltsp_password → guest_user/
guest_password
- golden: no ServeFile fallback for a golden.vhdx file (404 →
publish again), drop tower dependency
- versions: drop 4 MB chunk versions, a version is its file only
- iscsid: peers is a plain list, no "old daemon" branch
- publish refuses a golden prepped without the script stubs
(was a warning: its scripts never updated)
- stage/linux-cache: stop cleaning delta-update leftovers
- tests: reuse disk.rs readers in vhdx tests
- docs: README rewritten shorter (618 → 259 lines), Pages updated,
imaging (capture/deploy) added to the comparisons
BREAKING CHANGE: an existing bootrom.db is not migrated: start with
a new one. Goldens prepped before 2026-10-09 must be prepped again
in the VM before upload.
- Removed the `base_mode` field from the `Image` struct and related database schema.
- Introduced `base_image` field in the `Machine` struct to track the Windows image that boots its base.
- Updated database schema to reflect changes, including migration for existing databases.
- Modified relevant database methods to support new base mode functionality.
- Updated API routes and handlers to manage base mode settings for machines.
- Adjusted frontend code to include base mode selection and display.
- Removed obsolete references to the old base mode logic in tests and other modules.
- Add `move_backup_gpt` function to relocate the GPT backup header and entries to the end of a larger disk.
- Modify the export module to include `full_disk` function for handling Windows images with preserved boot partitions.
- Introduce new API endpoints `/api/images/deploy-map` and `/api/images/deploy-chunk` for retrieving image deployment information and chunks.
- Update image routing to include the new deployment endpoints.
- Enhance end-to-end tests for capturing and deploying images, ensuring proper functionality of the new features.
- Add unit tests for the `move_backup_gpt` function to verify correct behavior and partition integrity after relocation.
- Implemented disk size retrieval in `disk.rs` to handle empty files.
- Introduced a new module `capture` in `main.rs` for handling disk capture requests.
- Added a new endpoint `/broom-capture` to serve the binary for capture operations.
- Enhanced NTFS reading capabilities with methods to retrieve file head and used ranges.
- Updated SSD settings to include a configurable pagefile size, with appropriate validation.
- Modified frontend to support new SSD settings, including pagefile input.
- Added tests for capture functionality and NTFS bitmap handling.
- Updated CSS to hide owner-specific actions for staff accounts.
- Modified JavaScript to load user roles and manage permissions based on user type.
- Enhanced HTML structure to reflect user roles and permissions in navigation and forms.
- Updated login functionality to support user accounts instead of a single admin password.
- Added tests for session tokens and user permissions to ensure proper access control.
- Implemented checks for games update permissions based on IP and MAC address.
- Added functionality to display and manage local disks in the server and games pages.
- Implemented disk visibility options for machines, allowing users to hide non-Broom disks from guests.
- Introduced server disk selection for images and games, enabling users to choose where to store new disks.
- Updated various HTML pages to reflect new disk management features, including server disk selection in images and games sections.
- Added unit tests for disk parsing and volume management to ensure robustness.
- Improved user experience with clearer messaging and options related to disk management.
- Updated documentation for guest user settings in Broom's web admin.
- Improved VNC agent script with enhanced logging and privilege management.
- Modified PowerShell script to compile VNC agent using .NET Framework's csc.
- Added new HTML pages for server and games management, including relevant functionality.
- Updated existing pages to reflect new structure and improved user experience.
- Removed obsolete SSD settings from system page and consolidated them into the Windows page.
- Enhanced server monitoring features and adjusted alert settings for better resource management.
- Introduced a new `metrics.rs` module to handle per-machine hardware health metrics (CPU %, RAM %, temperatures, disks).
- Updated the `broom-watch.ps1` script to reference System.Management for improved functionality.
- Modified `AppState` to store and retrieve metrics for each machine.
- Enhanced the `MachineStatus` struct to include metrics data.
- Implemented disk health checks using SMART data for NVMe and SATA disks in `sysmon.rs`.
- Updated the VNC agent to push hardware health metrics over WebSocket connections.
- Enhanced the frontend to display hardware health metrics in the UI, including disk status and temperatures.
- Added unit tests for metrics parsing and disk health attribute extraction.
- Implemented a remote agent (broom-vnc.exe) that allows viewing and controlling Windows machines via a WebSocket connection.
- Updated broom-watch.ps1 to start the VNC agent and ensure it runs in the console session.
- Added new API endpoints for VNC agent management and viewing.
- Created a new remote page in the web interface for connecting to and controlling Windows machines.
- Enhanced asset management to include VNC-related scripts and binaries.
- Updated the frontend to support remote control features, including mouse and keyboard events.
- Added tests for VNC agent and viewer functionality.
- Introduced a configuration option to serve games.img from a RAM copy, improving read performance.
- Implemented background loading of the RAM copy and handling of stale copies during merges.
- Updated the state structure to track RAM loading status and merge counts.
- Enhanced the API to toggle RAM serving and retrieve relevant information.
- Added frontend support for managing the RAM serving option in the UI.
- Updated tests to cover new RAM functionality and ensure proper behavior with incompressible blocks.
- Enhanced `serve` function in `goldenram.rs` to read and send data in 1 MB chunks concurrently, improving throughput.
- Updated `hash.rs` to implement a more efficient `sha256_with` function that reads data in parallel while hashing, reducing overall processing time.
- Modified `write_chunk` in `images.rs` to skip writing zeroed MBs, optimizing disk usage.
- Improved `command` function in `conn.rs` to streamline read operations.
- Optimized `read_at` method in `overlay.rs` to read neighboring blocks in a single call, reducing disk access overhead.
- Adjusted `main.rs` to increase the buffer chunk size for TFTP service, enhancing data transfer efficiency.
- Refined `status` function in `monitor.rs` to limit concurrent pings, improving responsiveness and resource management.
- Changed default `boot_timeout` in `settings.rs` from 10 to 3 seconds for quicker boot processes.
- Updated `autoexec` function in `tftp.rs` to utilize existing IP addresses, reducing DHCP wait times.
- Enhanced `sha256` function in `vhdx.rs` to leverage the new `sha256_with` for better performance.
- Added tests for sparse file writing and hash caching behavior in `hash.rs` and `golden.rs` to ensure correctness and performance.
- Implemented a new benchmark module to track server disk performance, including sequential and random read speeds.
- Added database support for storing benchmark results with a new BenchRow struct and associated methods in the Db trait.
- Enhanced the SQLite database schema to include a new table for benchmark results.
- Created a new benchmark page in the web interface, allowing users to view current and historical benchmark data.
- Integrated iSCSI read statistics into the benchmark page, displaying real-time data on client read performance.
- Updated the main application routing to include the new benchmark page and its associated API endpoints.
- Added JavaScript functionality to dynamically load benchmark data and handle user interactions for initiating benchmarks.
- Introduced a new "Groups" page for managing machine groups, including creating, editing, and deleting groups.
- Updated the navigation to include a link to the new "Groups" page.
- Enhanced the "Images" page to display associated groups for each image.
- Added functionality for managing games disks, allowing users to create, update, and delete games disks for Windows machines.
- Implemented SSD room management settings for Windows machines, including options for keeping free space, warning thresholds, and restart conditions.
- Updated JavaScript to handle new API calls and UI interactions for groups and games disks.
- Added relevant hints and descriptions to guide users on the new features.
- Updated the VHDX module to create a virtual dynamic VHDX that reads directly from the raw disk without writing to a file, improving efficiency and reducing storage needs.
- Enhanced the `publish` function in the winstage module to manage golden VHDX files more effectively, ensuring that the golden file is only rebuilt when necessary and maintaining its identity through a unique stamp.
- Adjusted the logic for checking if the golden file is fresh, now returning both the ID and hash for better tracking.
- Improved error handling and file management during the publish process, ensuring that outdated files are removed and the latest versions are served.
- Updated the frontend JavaScript to provide clearer messaging during version loading and comparison with the current golden.
- Enhanced snapshot_at function to write new chunks as temporary files, ensuring data integrity during writes and reducing the risk of data loss.
- Introduced sync_fs function to flush filesystem changes efficiently, minimizing the number of fsync calls.
- Updated tests to verify the new chunk handling logic and ensure proper garbage collection.
- Simplified the find_windows function to directly read NTFS partitions without mounting, improving reliability.
- Removed deprecated functions related to OOBE handling and streamlined the boot storage logic.
- Updated frontend to reflect changes in cache mode terminology from 'zram' to 'RAM' for clarity.
- Improved user interface messages and hints regarding RAM cache usage and limitations.
- stage: GNU wget defaults to a 30 s read timeout and 3 tries (was 15 min x 20)
so a stalled server can't hang the stage.
- linux cache: waits up to a minute for the network before fetching the
cache list (on a cache HIT the initramfs never brought it up).
- linux hook: the broomcache label is read from the ext4 superblock — with a
busybox blkid the kept cache was formatted on every boot.
- publish: the Secure Boot shim is copied to a temp file and renamed in.
- startup clean-up also removes driver upload/extract dirs, the stage build's
initramfs config, driver archive temps and upload/unzip.
- web: an expired session on a page load goes to /login instead of caching
the "login required" text as the page.
- broom-done: the BASE MODE message warns that a hard power-off loses the
setup.
- removed: GET /api/machines, /api/machines/group, /api/dhcp/apply, the
tftp::serve wrapper and dhcp::handle's unused parameters.
Scripts changed -> the next publish rebuilds the golden/stage once.
- boot: boot scripts use ${broom-srv}, set by /boot/start from the current
Server IP — changing it needs no republish (once more after this upgrade).
- images: the SSD switch asks for a republish when the boot script predates
it; an upload to a disk-cache Linux image with clients is refused before
the convert; cache mode goes back when its publish fails.
- linuxfs/vmdk: LVM metadata nesting capped (a crafted one overflowed the
stack and aborted the server), kernel/initrd read capped at 512 MiB, VMDK
grain directory capped at 16 MiB (sparse uploads).
- settings/dhcp: the interface must exist to be saved; at start a failed :67
bind still leaves TFTP serving; each DHCP packet's DB work runs on a
blocking thread.
- limits: pxe_seen holds at most 4096 MACs; the remembered IP is the
connection's, not the claimed ?ip=; /api/status pings at most 32 at once.
- license: an ARP entry matching the machine's MAC is required; /api/status
no longer carries full keys (machine detail still does).
- stage: step 0 keeps >= 20 GB / 10 % free on BROOMWIN by evicting the oldest
parked images; files.sha256 names its golden and a client on another
golden never applies it.
- linux cache: a golden larger than the cache partition evicts nothing.
- devices: bulk Register takes the PXE-seen IP when there is no lease.
- main: one instance per data directory (flock on bootrom.lock).
- db: deleting the default moves it only to a published image of the same OS.
- versions: delete reports success even if the following gc fails; snapshot
checks free space. golden: converted image fsynced before the rename.
Scripts changed -> publish every image again (boot scripts gain ${broom-srv}).
- linux hook: never lays out a Broom SSD that holds Windows' partitions
(small disks / disks laid out before any Linux image): Linux runs from RAM
(zram + iSCSI) there instead of wiping the Windows goldens and bases — and
Windows wiping it back on its next boot.
- publish (Linux): the new iSCSI generation is recorded only when the publish
succeeded; a failure removes that generation's target/zram device and puts
the old kernel/initrd back, so the 60 s gc never drops the target the saved
boot script points at. A stale zram device of a reused generation is freed.
restore_targets claims the job slot per image.
- rollback: version (manifest + every chunk) and free space checked first,
rebuilt into image.img.new, targets dropped and the file swapped only then —
a bad version, full disk or crash leaves the image and its target as they
were. New versions::check.
- stage: the ESP gets a fresh filesystem every boot; strict reset keeps every
entry on this SSD (its PARTUUID) but Broom Windows out of BootOrder; a
parked image's golden is re-hashed against the server's hash when it comes
back to the top.
Scripts changed -> the next publish rebuilds the stage once.
- devices: giving a machine another image no longer re-arms its key — it may
already keep a base of that image on its SSD, leaving the key armed with
nothing to fetch it. A new image's base activates through Windows' digital
license (or the admin re-arms). Renaming still re-arms (base rebuilt).
- boot: the Linux writeback size lives only in WB_GB (boot.rs); /boot/start
sets broom-wbgb and both boot scripts pass broom.wbgb to the Windows stage
and the Linux hook (30 when an older boot script has none).
Scripts changed -> publish every image again (boot scripts gain broom.wbgb).
- boot: menu labels by position (img1, img2...): "win-11" and "win_11" no
longer collide; image/package names capped at 64 (what /boot/start keeps).
- tftp: at most 64 transfers at once (an RRQ flood can't use up the fds).
- wol: magic packet to the boot LAN's broadcast (server IP | !netmask), so it
leaves through that NIC, not the default route's.
- dhcp: listeners swapped in one step — two Applies at once never leave an
extra listener with an old config.
- versions: chunks/manifests flushed before rename; a stored chunk is reused
only with the right length (a power-cut one is written again); gc skips
non-.json files.
- images: cache mode is changed inside its publish job (409 with a job
running, DB untouched); the first upload is saved as v1 even when its
publish fails.
- export: built in <dir>.new and renamed when complete (no half-written
vmdk download).
- startup: leftovers of interrupted jobs removed (image.img.new,
golden.vhdx.tmp, <name>.new/.old, stage temp dirs/downloads, export .new).
- space: converting a vmdk and building golden.vhdx check free space first
(one shared need_space helper, also used by export).
- network: setup detects the netmask (prefix of the connected route); Netmask
field on the Network page.
- machines: with the DHCP server off, machines seen PXE-booting show up on
the Machines page with their IP.
- web: Log out button; dead /api/machines/assign (and Db::assign_image)
removed.
- broom-done: a failed rename or boot-order task is logged (done.log) instead
of swallowed.
broom-done changed -> the next publish rebuilds the golden once.
Shared SSD layout: p1 BROOMEFI 512M | p2 BROOMWIN | p3 broomwb 30G | p4
broomcache, found by GPT partition name (sysfs) by both the Windows stage
and the Linux initrd hook. Whichever OS boots first lays it out and formats
only its own partitions — switching images no longer wipes the disk.
Every image a machine boots keeps its copy: Windows sets parked in
broom\img.<image>\ (the booting one at the top, so the BCD and broom-done
are unchanged; a rename, VHDX parent links are relative), Linux goldens as
<image>.img in broomcache. On every boot the machine fetches
/api/cache-list ("name hash" of images it may keep: published and using the
SSD) and removes the others; no answer -> nothing removed; the running copy
is never touched. Out of space -> the copy unused the longest goes.
SSD on/off per Linux image (Images page, POST /api/images/ssd): off = the
SSD is never touched, golden over iSCSI, writes in RAM. Windows always uses
the SSD. Read per boot (broom.ssd); the Linux share of a new layout is
30 GB + the total of the Linux goldens using the SSD + 5 GB (broom.lxgb).
Also:
- vmdk/linuxfs: crafted headers refused (no giant buffer / panic).
- stage: one disk on a registered machine is looked at again after 5 s
before it is wiped (a late Broom SSD / second disk).
- iscsi: idle superseded generations (and their zram) dropped every 60 s.
- winstage: single-partition GPT written before the holes are punched.
Upgrade: publish every image again (boot scripts gain broom.lxgb, broom.ssd,
broom.srv). Scripts changed -> golden/stage rebuilt once.
Golden download (Windows stage + Linux SSD cache): always one whole file, no
4 MB chunk delta. The old copy goes first, the new one is written in one
sequential stream (less fragmentation, nothing to compare) and hashed on the
way; it is accepted only when the hash AND the size (new golden.size from the
server) match, so a disk-full or cut download is never taken. The stage checks
free space first and resumes a cut download with wget -c. Removed: delta(),
/api/golden-chunk, the compressed chunk cache, the zstd crate, broom.srv on
the Linux cmdline. chunks.rs -> hash.rs (file_hash only).
Windows publish: the stage bundle and server IP are checked before anything
is written; golden.sha256/size/key are removed only right before the new
golden replaces the old one and golden.sha256 is written last; the .tmp file
is removed on error.
- drivers: a client can no longer re-arm its own license key. Re-arming on a
driver-set change is decided on the server (driver upload/delete/targets,
machine group change) from the stored hardware IDs.
- devices: renaming a machine or giving it another image re-arms its key.
- stage: first.pending next to an existing base is ignored (a guest could make
the reset child the base -> base pointing at itself, machine never boots).
- stage: driver archives are kept; every base build extracts them again after
a sha256 check, so a folder the guest edited on BROOMWIN never reaches base.
- stage: `cp base-template.vhdx child.vhdx` checked.
- images: delete refuses while a Linux client uses the image, removes files
before the DB row, and claims the job slot under the lock. The DB unlinks
machines from the deleted id (SQLite reuses it) and moves the default.
- iscsi: per-target session check from LIO's dynamic_sessions replaces the
portal-wide `ss` check (publish, rollback, gc of superseded generations).
- publish (Linux): every refusal before anything is written; kernel/initrd
are built in <name>.new and swapped in right before the new boot script is
saved. Rollback of a disk-cache image drops its targets before rewriting.
- Network page: Apply works with the DHCP server off (range fields may be
blank; checked only in full mode: start <= end, inside the subnet).
dhcp_mode 'proxy' migrated to 'off'. Lease accepts s/m/h/d like the parser;
gateway is a single IP; server IP must be one of this host's.
- auth: Host check accepts any IP literal, localhost and the machine's
hostname (DNS rebinding always carries a domain name).
- web: the Images "Boot" button works again.
- publish: bundled shim path restored (broom-stage/shimx64.efi).
Residual: a guest can still fetch an *armed* key through /boot/start +
/api/license (a local admin can fake the pre-boot side).
Upgrade: publish each Windows image once (writes golden.size; the scripts
changed, so the golden/stage are rebuilt anyway). Each Windows machine then
downloads the golden whole and rebuilds its base once.
DHCP (Network page, only shown when broom is the DHCP server):
- iPXE: don't wait for ProxyDHCP (option 175.176), default on
- Authoritative NAK for machines asking for an IP that isn't theirs, default on
- Send hostname (option 12), default on
- Rapid Commit (RFC 4039, option 80): ACK straight after DISCOVER when the
client asks for it, default off
- DNS: one input per server ("+ DNS"), up to 8; the server validates them,
drops duplicates and keeps the order
Comments across src, scripts, web, build.sh, CI and README brought in line
with the current code (module split, stage bundle from CI, no distro
packages, TFTP always on).
Note: the comment edits change the embedded scripts, so the next publish
rebuilds the golden image and the stage once, and each Windows machine
downloads the delta and rebuilds its base once.