Fix Holesail client connect via Bare main HTTP control
CI / test (push) Successful in 9m58s

pear-run worker RPC timed out from the Electron UI. Run real holesail
in Bare index.js (holesailBareControl) and have the UI call localhost
HTTP instead of loading bare-tcp in the renderer.
This commit is contained in:
2026-07-10 23:19:31 -04:00
parent cc6df798e1
commit 5fbece2bd9
6 changed files with 461 additions and 158 deletions
+5 -4
View File
@@ -82,10 +82,11 @@ npx holesail 'hs://s000…'
1. **Container UI action** — “Tunnel this port” on container details port table.
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')`
Under pear-electron the UI renderer cannot load bare-tcp (`require.addon is not a function`). Real holesail runs in the **Bare main process**:
- Bare entry `index.js` starts `client/holesailBareControl.cjs` (`require('holesail')`) on `http://127.0.0.1:<port>`
- Endpoint + token written to `<Pear.config.storage>/peardock-holesail-local.json`
- UI `client/holesailLocal.js` POSTs `/connect` / `/disconnect` (never loads bare-tcp)
- Node tests / non-Pear: in-process `require('holesail')`
3. **Persist tunnel definitions**`peardock-tunnels.json` (mode 600); restored on server boot with the same `hs://` keys when possible.
## Optional later