5.6 KiB
name, version, description, tags, requires
| name | version | description | tags | requires | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bare-os-holesail | 1.0.0 | Holesail P2P tunnels in Bare OS — managed state (seed/key), initd bare-holesail, stock bare-www-* and bare-ssh-* rows, env toggles, ctx.bare.holesail for /bin scripts. |
|
|
bare-os-holesail Skill
When to use
Use when the user asks about Holesail in this repo: exposing TCP/UDP through Holepunch-style tunnels, /bin/holesail CLI, bare-holesail initd, BARE_OS_HOLESAIL_* environment variables, ctx.bare.holesail from drive bundles, ~/.holesail/state.json persistence (seed / key), or licensing (upstream holesail is AGPL-3.0).
Mental model
- Integration lives in
packages/bare-os-booter/lib/bare-holesail.js(initd + optional early “kernel-path” instance),bare-holesail-managed.js(state.jsonrows,ensure,SyncPersistedServerKey),holesail-cli.js(ctx.bareOsRunHolesailClifor/bin/holesail),bare-os-www-holesail.js,bare-os-ssh-holesail.js. - Resolution order under
pear run: the booter prefersctx.bare.holesail(/lib/bare/bundles/holesail.jsafter drive merge), else hostimport.meta.resolve('holesail'), else eval of the drive IIFE bundle viactx.vfs—/binand/boot/init.jsare not Node modules, so scripts must notrequire('holesail'). - Stock default: initd unit
bare-holesailis on whenBARE_OS_HOLESAIL_INITDandBARE_OS_HOLESAIL_MANAGEDare left at defaults (1in stockshellEnvunless the host clears them). Disable withBARE_OS_HOLESAIL_INITD=0orsystemctl disable bare-holesail(**~/.config/bare-os/initd/disabled.txt**). - Stock auto-rows —
bare-www-<port>afterbare-os-wwwlistens (BARE_OS_WWW_HOLESAIL=0disables merge).bare-ssh-<port>afterbare-opensshlistens (BARE_OS_SSH_HOLESAIL=0disables).bare-user-session-stackre-ensures SSH tunnel afterbare-holesailstarts if sshd was already listening.
Managed state (state.json)
- Default path —
BARE_OS_HOLESAIL_STATEunset →**~/.holesail/state.json**(logical, under**$HOME**). Override env for a different logical path. - Legacy merge — If the primary file is empty/missing:
/.bare/holesail/state.json,/.bare/holesail/guest/state.json,/home/guest/.holesail/state.jsonare merged once. seed— Stable ctor secret: 64-char hex, or valid z32 suffix (migrated from legacyhs://…-only rows). Never replaceseedwith only the URL suffix written as ctor input.key— Full shareablehs://…URL; written/updated afterready()(bareHolesailManagedSyncPersistedServerKey).holesail listshows live URL when tunnel runs.- Daemon — First
startManagedConnectionsFromDiskpass starts all rows; yield one tick; second pass usesonlyNewsobare-os-www/bare-opensshcan append rows without tearing down tunnels already started.
Managed vs single-tunnel mode
- Managed (default) —
BARE_OS_HOLESAIL_MANAGED=1. Operator CLI:holesail list,add,remove,start,stop,restart,enable,disable,path,help. - Single tunnel —
BARE_OS_HOLESAIL_MANAGED=0, then exactly one ofBARE_OS_HOLESAIL_SERVER=1orBARE_OS_HOLESAIL_CLIENT=1, and in client modeBARE_OS_HOLESAIL_KEY=…. Optional:BARE_OS_HOLESAIL_SECURE,PORT,HOST,UDP,LOG.
Early booter (“kernel-path”) instance
Separate from initd: enable with BARE_OS_HOLESAIL_KERNEL=1 and the BARE_OS_HOLESAIL_KERNEL_* mirror env vars. Starts after the repl boot phase and before startBareInitd; teardown uses registerKernelShutdownHook. **hs.pause() / hs.resume()** tie into mobile suspend/resume.
Operator CLI quick reference
From holesail-cli.js help text:
holesail add ID --server|--clientwith optional--key, barehs://…token (no--keyprefix),--port,--host,--udp,**--secure/--no-secure**,--log.holesail remove ID,**start|stop|restart ID**,**enable|disable ID**.
Managed bare-holesail starts after kernel-logger and bare-os-www by default. Logs: /var/log/bare-os/holesail.log. Example unit drop-in: /etc/bare-os/units/bare-holesail.unit.example.
Debugging and safety
BARE_OS_HOLESAIL_DEBUG=1— extra console lines (URLs only; keys are not logged in full).- Do not paste full connection secrets into chat or commit logs; redact
hs://payloads when summarizing. read_man_page holesail(after a coreutils/man build);handbook/04-the-booter-runtime.md§ bare-holesail, § bare-os-www, § bare-openssh — prose source of truth.
Execution steps (for the agent)
- Confirm whether the question is operator tunnels (CLI + state file + initd) vs guest scripting (
ctx.bare.holesail). - If live behavior matters, prefer
read_proc_file/ initd journal paths the user can access over guessing from docs. - Mention AGPL when the user plans to redistribute or ship a product that bundles
holesail.
Constraints
- Read-only unless the user explicitly authorizes changing env, initd disables, or
holesail addstate. - Do not assume
holesailisimport()-able frompear:withoutctx.bareor the drive bundle.