FleetDeck is a single-container web app that manages a diskless Windows gaming fleet booting over iSCSI from TrueNAS SCALE. It replaces the manual workflow of hand-editing per-client iPXE scripts and clicking through the TrueNAS UI to clone, snapshot, and retire zvols. One dashboard drives the whole fleet: create a client, reset it to golden, rebase it onto a new golden version, retire it, or promote a new golden image — each as a single action, with every TrueNAS mutation recorded in an events log.
What's new in v2: FleetDeck now absorbs the entire bring-up — it serves the boot chain itself (TFTP + HTTP, retiring the separate ipxeboot container), has a first-run Setup Wizard for the TrueNAS side, a guided Golden Build workflow with a generated WinPE deploy script, guest/kiosk features, fleet-ops tooling (tags, webhooks,
/metrics, backup/restore, multi-admin), and reliability/observability additions. See CHANGELOG.md for the full list and the deploy runbook for setup.
- Dashboard — live view of every client, its zvol clone, iSCSI target, and last boot; updates are pushed over a WebSocket (
/ws, same session auth) with automatic fallback to polling. Sortable/searchable client table with pagination, bulk actions (reset/retire/rebase/nightly), a per-client detail drawer with audit history and snapshot lineage, and a Cmd/Ctrl+K command palette. - One-click client lifecycle — create, reset, rebase, retire, and promote-golden, each a single action against TrueNAS.
- Bulk reset + nightly cron — reset the whole fleet at once, or on a schedule (
node-cron) for a clean image every morning. - iPXE script serving — serves per-client boot scripts at
/boot/<mac-hexhyp>.ipxe, with an unknown-MAC discovery/adopt flow so new machines show up in the dashboard ready to be provisioned. - Golden Build Mode — arm a machine to boot directly into the live golden image (
sanhook, not a clone) to service it in place, replacing hand-editing override files on theipxebootcontainer. Deliberately distinct from Adopt: one session at a time, time-limited with auto-expiry, refuses if TrueNAS already has a session on the golden target, audited throughout. Sessions have two phases —install(WinPE imaging) andboot_installed(sanboot the installed OS) — with a guided, persisted checklist and a generateddeploy.cmdthat automates the whole WinPE marathon: confirmed diskpart, split-WIM-awaredismapply,bcdboot, the offline-registryINACCESSIBLE_BOOT_DEVICEfixes, and safety-script install. See docs/DEPLOY.md. - Integrated boot-chain serving — FleetDeck serves everything the boot chain needs itself: TFTP for
snponly.efi(in-process, read-only), HTTP with Range support forwimboot/WinPE media at/boot/files/*, and a generatedwinpe.ipxethat always references the real on-disk media filenames (case included). The separate nginx+dnsmasq container is retired. - First-run Setup Wizard — the Setup tab checks and (idempotently, with per-step confirmation and full DRY_RUN payload preview) creates the whole TrueNAS side: datasets, the golden zvol (sparse, 64K blocks), iSCSI service, portal, allow-all initiator group, and the golden target/extent/LUN-0 mapping with real portal groups. Manual steps (DHCP network boot, compiling
snponly.efi) render as honest checklists with exact values, a generated build command, and a live "first boot request seen" detector. A re-runnable Diagnostics panel self-tests the whole chain, including a real TFTP read and a ranged HTTP self-fetch. - DRY_RUN safety — introspect TrueNAS read-only before letting FleetDeck mutate anything.
- Auto safety-snapshot — every reset/rebase/retire quarantine-clones the client's pre-wipe zvol before touching it, giving a brief undo window (purged automatically after a retention period).
- Wake-on-LAN — optionally sends a magic packet after a successful reset/rebase, so a nightly wipe leaves the machine booted and ready by morning (opt-in; requires WoL enabled on each client's NIC/firmware).
- Pool capacity alerting — polls the TrueNAS pool's used/available space and logs a warning once usage crosses a configurable threshold.
- Reconciliation — scan for TrueNAS iSCSI targets FleetDeck doesn't know about (import them as clients) and FleetDeck clients whose TrueNAS target has vanished (remove the stale row).
- Bulk CSV import — onboard many machines at once instead of one at a time.
- On-demand connection test — check TrueNAS connectivity from Settings without restarting the app.
SQLite (better-sqlite3), five tables:
| Table | Holds |
|---|---|
clients |
Provisioned machines: MAC, hostname, clone zvol, iSCSI target, golden version, state. |
settings |
Key/value app config (e.g. current golden version, cron schedule). |
events |
Append-only audit log of every action and TrueNAS mutation. |
discovered |
Unknown MACs seen at /boot/*, awaiting adopt. |
safety_snapshots |
Quarantine clones made before destructive ops, purged after a retention window. |
cp .env.example .env # fill in secrets and TrueNAS details
docker compose up --buildThen open http://<host>:8080.
npm install
cp .env.example .env # keep DRY_RUN=1 for safe, read-only introspection
npm startWith DRY_RUN=1, FleetDeck talks to TrueNAS read-only and logs — but never executes — mutations. Ideal for developing against a real box without touching it.
Set as env vars in the TrueNAS Custom App, or via .env for local/compose. See .env.example for the authoritative list.
| Variable | Purpose | Default / Example |
|---|---|---|
TRUENAS_URL |
TrueNAS websocket JSON-RPC endpoint (port varies by build). | wss://192.168.1.36:8444/websocket |
TRUENAS_API_KEY |
TrueNAS API key (Settings > API Keys). Secret. | REPLACE_ME |
ADMIN_PASSWORD |
FleetDeck admin UI password (single admin account). Secret. | REPLACE_ME |
COOKIE_SECRET |
Secret used to sign session cookies. Secret. | REPLACE_ME |
HTTP_PORT |
Port the HTTP server (UI + API + /boot/*) listens on. |
8080 |
HTTP_BIND |
Bind address. Keep on the LAN — /boot/* is unauthenticated. |
0.0.0.0 |
DRY_RUN |
1 = log TrueNAS mutations without executing them. |
1 |
DB_PATH |
Path to the SQLite state file (mount a volume over its dir). | /data/fleetdeck.sqlite3 |
IQN_PREFIX |
Base IQN for iSCSI targets. | iqn.2005-10.org.freenas.ctl |
GOLDEN_ZVOL |
Zvol path for the golden (sysprepped) image; snapshots @gold-vN. |
Main_pool/iscsi/win-golden |
CLIENT_ZVOL_ROOT |
Root dataset path where per-client clone zvols live. | Main_pool/iscsi |
POOL_NAME |
Pool name for capacity alerting. Defaults to CLIENT_ZVOL_ROOT's first path segment. |
Main_pool |
BOOTFILES_DIR |
Where the served boot chain (wimboot, WinPE media, snponly.efi) lives. |
<dir of DB_PATH>/bootfiles |
TFTP_ENABLED |
1 = serve TFTP for snponly.efi in-process (needs host networking). 0 keeps an external TFTP server. |
1 |
TFTP_PORT |
TFTP UDP port. 69 needs host networking + root. |
69 |
GIT_COMMIT / BUILD_DATE |
Optional Docker build args, baked to env and shown in Settings. | (unset) |
Many runtime tunables live in the in-app Settings panel rather than as env vars, so they take effect without a restart: WoL (wol_enabled, wol_broadcast), alerting (pool_alert_threshold_pct), retention (safety_snapshot_retention_days), schedules (nightly_reset_cron), Golden Build (winpe_chain_url, golden_build_default_minutes, nic_boot_services, golden_image_index), SMB staging (bootfiles_host_path, bootfiles_smb_share_name), guest fleet (guest_idle_timeout_minutes, guest_motd), webhooks (webhook_url, webhook_events), auth (session_timeout_minutes), and API-key hygiene (api_key_created_at, api_key_max_age_days). See docs/DEPLOY.md for what each does.
WoL magic packets are UDP broadcasts, and the container's network mode decides whether they can reach the LAN at all. With the default bridge networking (docker-compose and the TrueNAS Custom App both use it), a limited broadcast to 255.255.255.255 never leaves the bridge — WoL silently does nothing. Two options:
- Host networking on the container — the limited broadcast goes straight out the host's NIC. This is the reliable option.
- Bridge networking +
wol_broadcast— set thewol_broadcastsetting (Settings tab) to your LAN's directed broadcast address, e.g.192.168.1.255, which the bridge can route out. Note that some routers/switches drop directed broadcasts; if WoL still doesn't wake machines, use host networking instead.
New clients copy their iSCSI portal/initiator group configuration from an existing, working target — preferably the target for the golden zvol (e.g. win-golden), else any target that has portal groups. Those groups are what publish a target on a portal; without them a target is invisible to initiators, and the correct portal/initiator ids are site-specific, so FleetDeck refuses to guess. Before creating your first client, create at least one working target (the golden target) in the TrueNAS UI with the portal group your fleet boots from. If none exists, client creation fails with a descriptive error before anything is created.
The auto safety-snapshot feature clones each pre-wipe zvol into <CLIENT_ZVOL_ROOT>/_safety/... before destroying it. ZFS clone does not create intermediate datasets, so the _safety dataset must exist under your client zvol root before the first reset/rebase/retire, e.g.:
zfs create Main_pool/iscsi/_safety
If it's missing, quarantining silently fails closed (logged as client.safety_snapshot.failed in the audit log) and the wipe proceeds with no undo window — not blocked, just unprotected. Create it once during initial setup.
DRY_RUN=1 is the seatbelt for first bring-up. FleetDeck still reads TrueNAS — you'll see your real golden snapshots and existing targets in the dashboard — but any action that would clone, snapshot, delete, or reconfigure a zvol/target is written to the events log and skipped. Confirm introspection looks right, then set DRY_RUN=0 to arm mutations.
- No TFTP server (TFTP stays where it is today).
- No WinPE / wimboot hosting.
- No DHCP.
- No multi-server support (single TrueNAS box).
- No user roles (single admin account).
See docs/DEPLOY.md for the TrueNAS SCALE Custom App setup and the one-time iPXE snponly.efi migration that points the boot chain at FleetDeck.