feat: support a public browser demo of the kiosk #88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/web-demo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Groundwork for respawning the ATM demo (previously
atm.aiolabs.dev, killed with the lamassu-next Docker stack) as a static SPA atatm.demo.aiolabs.dev, backed by the LNbits already running on aio-demo.The browser path is already first-class — with no
electronAPI,App.vuepicksinitializeWithLightning(), which resolves an ephemeral LocalSigner, allows mock fallback and leavesdebugModeon so the bill simulator stands in for the validator. Three changes make it hostable.1.
build:webtargetapps/machine'sbuildruns vue-tsc + Vite + two electrontscpasses + an esbuild bundle. A web build needs only the Vite one.build:webisvite build, with a turbo task that still builds workspace deps viadependsOn: ["^build"], sopnpm build:webat the repo root yieldsapps/machine/dist.env: ["VITE_*"]is declared on the task — the Vite vars are baked in at build time, and without it turbo would serve a cached build produced under different env.2.
create_walletRPC wrapperThe transport has always exposed
create_wallet(AUTH_ACCOUNT);LnbitsClientjust never wrapped it. Account-scoped, so the envelope deliberately carries nowallet_id— that absence is what makes the server resolve auth to the Account rather than a Wallet.3.
VITE_DEMO_TAGCursor.
cursor: nonewas global for the touchscreen, which reads as a broken page in a browser. Now scoped to.kiosk, set on<html>unlessVITE_DEMO_TAGis present.Cleanup. An ephemeral identity per page load is the right call: it isolates concurrent visitors, and each fresh account gets its own auto-credit under
LNBITS_DEMO_MODE— whereas a single baked-in key would be credited exactly once and then drain. The cost is a throwaway LNbits account per visit, and nothing in an auto-created row distinguishes one (pubkeyset /prvkeyNULL equally describes a real ATM).A nostr pubkey can't carry a marker (grinding a vanity prefix is far too slow to do on page load), and the account/wallet the server auto-creates isn't nameable by the client. So when the tag is set the ATM mints one extra, never-used wallet named with the tag — sweeping becomes an exact string match rather than a heuristic about what looks disposable.
Both behaviors are inert on a real machine (var unset). The marker call is fire-and-forget: losing it degrades cleanup, not the demo.
Verification
pnpm build:web✅ (~600 KB, 3.5 s)pnpm typecheck✅ 12/12pnpm test— all suites pass;@bitSpire/halfails only because it has no test files (pre-existing ondev, unrelated)VITE_DEMO_TAGset the tag +create_walletare present; without it thekioskclass is applied and the tag string is absentFollow-up lives in
aiolabs/server-deploy: abitspireflake input plus oneservices.static-sitesentry onhosts/demo. Wildcard DNS already coversatm.demo.aiolabs.dev, so no DNS work.🤖 Generated with Claude Code
https://claude.ai/code/session_013A6683cCHnQxFUosx1krY4