Run real holesail in a Bare worker for Pear UI
CI / test (push) Successful in 9m59s

pear-electron cannot load bare-tcp (require.addon) in the renderer.
Use pear-run + workers/holesail-local.cjs so the actual holesail package
runs under Bare; Node still loads holesail in-process. Add connect
fallback modal with copy URL.
This commit is contained in:
2026-07-10 23:13:30 -04:00
parent 9e39c27b88
commit cc6df798e1
8 changed files with 470 additions and 22 deletions
+5 -1
View File
@@ -81,7 +81,11 @@ npx holesail 'hs://s000…'
## Implemented extensions
1. **Container UI action** — “Tunnel this port” on container details port table.
2. **Client-side HolesailClient** — Pear binds a local port and opens the browser (`client/holesailLocal.js`, Tunnels → plug icon).
2. **Client-side local proxy** — Tunnels → plug icon runs the **real `holesail` package**.
Under pear-electron the UI renderer cannot load bare-tcp (`require.addon is not a function`). Holepunchs pattern is a **Bare worker**:
- UI: `client/holesailLocal.js``pear-run('./workers/holesail-local.cjs')` over pear-pipe
- Worker (Bare): `require('holesail')` with full `require.addon`
- Node tests / non-Pear: in-process `require('holesail')` / `import('holesail')`
3. **Persist tunnel definitions**`peardock-tunnels.json` (mode 600); restored on server boot with the same `hs://` keys when possible.
## Optional later