Skip to content

feat(edge): ThinkPad demo box host layer — one laptop is the whole kit (TRA-1381) - #795

Draft
mikestankavich wants to merge 5 commits into
mainfrom
feat/tra-1381-self-contained-thinkpad-demo-box-to-repl
Draft

mikestankavich wants to merge 5 commits into
mainfrom
feat/tra-1381-self-contained-thinkpad-demo-box-to-repl

Conversation

@mikestankavich

@mikestankavich mikestankavich commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

One ThinkPad replaces the EliteDesk + Slate + separate laptop kit, acting as server, demo LAN and screen. deploy/edge is unchanged as the stack. The new deploy/edge/laptop/ adds the host layer around it:

  • setup-host.sh: idempotent, with steps runnable by name.
    • Tailscale at boot, with Tailscale SSH off so key-based OpenSSH answers headless over the tailnet. With it on, the tailnet's check policy demands a browser per session.
    • Ranked Wi-Fi uplinks from a root-only file.
    • Demo LAN: a bridge of the USB dongle AP and the Ethernet port (CS463 via PoE switch), in NM shared mode on the Slate's subnet, SSID and PSK, so devices pointed at 192.168.8.10:1883 need no reconfiguration. The step refuses to run unless the Wi-Fi uplink already holds the default route.
    • Chrome kiosk on localhost as a no-sudo autologin user.
    • Power key = clean poweroff, lid ignored on AC, BIOS power-on-with-AC, battery held at 75–80 %.
    • An AppArmor grant for the containerized broker.
  • seed.sh creates the box's own org (identifier = hostname) with Doorway 1, the CS463 and the alarm plug on their grandfathered topics, plus one login per line of a box-only logins file, so people's addresses stay out of this repo. Passwords are generated once into a stack-user-only file, for the password manager. It's keyed on natural keys, so re-runs are no-ops.
  • Naming: the box serves app.demo-1.trakrf.id; the EliteDesk keeps app.demo.trakrf.id.
  • SETUP-CARD.md is the one page for the person running the demo.

Absorbed along the way, each in its own commit:

  • smoke-test.sh could not pass on any box. The subscriber listens only on registered topics, and the contract seed registers none. It now registers its own probe topic.
  • just lint now shellchecks the demo-box scripts.

Worth a reviewer's eye

  • Ubuntu 26.04's host AppArmor mosquitto profile attaches by path and confines the broker inside the rootless container. It's fixed through the profile's local/ include, so the quadlets are untouched.
  • The app's :8080 is localhost-only by design. The demo LAN gets MQTT, DHCP and DNS. Traefik stays masked unless a second laptop has to join.

Verified on the box (trakrf-demo-1)

  • Reboot on the bench uplink: tailnet SSH was back in about 70 s. The stack came up healthy at schema 57/57, the AP was on TrakRF, and the kiosk session ran Chrome. BIOS settings applied (pending_reboot 0), logind settings were live, and the battery read 75/80.
  • Demo LAN fully down for 45 s: the tailnet stayed online, the app answered, and the LAN restored itself.
  • Demo-LAN client (a netns on br-demo): it got a DHCP lease in .100–.199, DNS resolved app.demo-1.trakrf.id to .10, and an MQTT publish to the broker succeeded.
  • Seed: two runs gave identical rows, and all three seeded logins return 200 through /api/v1/auth/login.
  • smoke-test.sh PASS.
  • just validate passes.

Draft because

Physical checks remain:

  • boot with the dongle unplugged;
  • uplink over the phone hotspot and a USB tether;
  • power-on by plugging in AC;
  • the power key press;
  • the kiosk seen on screen and logged in;
  • the CS108 over Web Bluetooth while the built-in card is also on Wi-Fi.

Refs TRA-1381

🤖 Generated with Claude Code

Mike Stankavich and others added 5 commits November 23, 2026 14:52
Since TRA-922 the subscriber listens only on topics a scan device
registers, and the contract seed registers none, so step 3 of
smoke-test.sh failed on every box. Register a probe device on
trakrf.id/<cap> in bb-test-org (idempotent, keyed on the topic), and
restart the backend once so the bulk subscribe on connect picks it up
instead of waiting up to five minutes for the reconcile.

Refs: TRA-1381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: TRA-1381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The EliteDesk kit was a server, a Slate router and a separate laptop,
and the port-by-port wiring was where setups went wrong. One ThinkPad
now does all three, with deploy/edge as its unchanged stack.

deploy/edge/laptop/setup-host.sh (idempotent, steps by name):
- Tailscale enabled at boot, plus OpenSSH as the headless path when a
  Tailscale SSH check policy wants a browser
- ranked Wi-Fi uplinks on the built-in card from a root-only file
- demo LAN: bridge of the USB dongle AP and the Ethernet port (CS463 via
  PoE switch), NM shared mode on the Slate's subnet, SSID and PSK, so
  devices pointed at 192.168.8.10:1883 need no reconfiguration;
  refuses to run unless the Wi-Fi uplink holds the default route
- Chrome kiosk on localhost (a secure context: Web Bluetooth without TLS)
  as an autologin user with no sudo
- power key and lid-on-battery = clean poweroff, lid on AC ignored,
  BIOS power-on-with-AC, Absolute persistence disabled, battery 75-80 %
- AppArmor: Ubuntu 26.04's host mosquitto profile also confines the
  containerized broker; grant its paths through local/mosquitto
- journald capped at 500 MB

seed.sh loads the demo org copy (kept off git: it carries BLE MACs)
plus seed/20-demo-extras.sql (doorway CS463 and alarm plug on their
grandfathered topics, entitlement, kiosk login) as trakrf-migrate,
with the id-minting triggers disabled for its one transaction so
copied keys hold and re-runs stay idempotent.

The box serves app.demo-1.trakrf.id; the EliteDesk keeps
app.demo.trakrf.id. just lint now shellchecks the demo-box scripts.

Refs: TRA-1381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --ssh on, tailscaled takes port 22 on the tailnet address and the
tailnet's check policy demands a browser approval per session, which
blocked every headless login on the box (the EliteDesk hit the same
thing). Off, Tailscale is just the network and key-based OpenSSH
answers. setup-host.sh now enforces --ssh=false and enables only the
sshd unit the release ships.

Refs: TRA-1381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preview BLE org (gateways that publish to the preview broker, tags
and assets) isn't needed on this box. seed/demo-org.sql now creates the
box's own org (identifier = hostname) with Doorway 1, the CS463 and the
alarm plug, keyed on natural keys like the contract seed, so the
generate_*_id triggers mint ids as usual and the trigger toggling is
gone.

seed/login.sql runs once per line of a box-only logins file
(email|name|role|superadmin): people's addresses stay out of this
public repo. Each password is generated on first run into a stack-user-
only file for copying into the password manager; delete a line there
and re-run to reset it.

Refs: TRA-1381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant