Commit Graph
100 Commits
Author SHA1 Message Date
Raven Scott 80485468f0 feat(booter): ephemeral port fallback on EADDRINUSE
Retry listen(0)/bind(0) when the preferred port is taken, gated by
BARE_OS_BIND_FALLBACK (default on; set 0/false for strict bind).

- Add lib/bare-os-bind-fallback.js and use it from bare-os-www-initd and
  bare-openssh (including privilege-path + holesail actual port).
- POSIX socket bridge in index.js: TCP listen and UDP bind fallbacks.
- bare-holesail + bare-holesail-managed: retry Holesail ready(); persist
  resolved listen port in managed state when it changes.
- Add test.bare-os-bind-fallback.js.
2026-04-23 20:39:50 -04:00
Raven Scott 7a97138fc6 bareOsRunCurlCli / wget / openssl / ssh-keygen / sshd / tar / systemctl /
holesail called run*(ctx, argv) with the boot-time closure ctx, so work
done from SSH used the REPL console while Object.assign child ctx had the
PTY stream. Add exeCtxForStockCli() (prefer this when this.vfs is set) and
delegate stock CLIs through it.
2026-04-22 22:42:42 -04:00
Raven Scott 72a5f3f2b8 fix(booter): tolerate UTF-8 BOM in /lib/bare/bare-module-lock.json 2026-04-22 22:24:23 -04:00
Raven Scott 2cd72de061 feat(booter): default initd parallelism, cmdsubst, bin cache, telemetry NDJSON 2026-04-22 22:18:18 -04:00
Raven Scott 4fa8c14079 When the host leaves these unset, the booter now sets
BARE_OS_SHELL_STREAMING=1, BARE_OS_SHELL_STREAMING_MULT=2,
BARE_OS_PIPELINE_MAX_BYTES (512 MiB), and BARE_OS_PIPELINE_MAX_LINES
(2M) so the high-throughput ~512 MiB burst profile does not require
pre-launch exports.

Align getconf Tier-1 statics with those bases; note legacy rc.profile
exports; refresh handbook, environment appendix, cookbook, and
bare-os-booter CHANGELOG.
2026-04-22 22:09:58 -04:00
Raven Scott 9487e24ef3 Update Docs 2026-04-22 21:59:13 -04:00
Raven Scott 32446dfdef feat(booter): tune 1GiB-class hosts — pipeline ceilings, IPC/MQ, rlimits
Raise simulated pipeline absolute caps (defaults 512 MiB / 2 M lines) via
BARE_OS_PIPELINE_ABS_MAX_BYTES and BARE_OS_PIPELINE_ABS_MAX_LINES so large
BARE_OS_PIPELINE_MAX_* values take effect after streaming multiplier.

Copy missing host env into the guest (BARE_OS_IPC_MAX_CHANNELS, POSIX MQ
defaults, abs caps, BARE_OS_VFS_MAX_OPEN). Add aliases:
BARE_OS_STREAMING_MULTIPLIER → BARE_OS_SHELL_STREAMING_MULT,
BARE_OS_TIMER_BUDGET_MS → BARE_OS_EXEC_LINE_BUDGET_MS,
BARE_OS_TELEMETRY_OTEL=1 → default OTL JSONL path.

Extend POSIX mq_open defaults and maxmsg ceiling; mirror BARE_OS_VFS_MAX_OPEN
to RLIMIT_NOFILE in /proc/bare_os/rlimits.json.

Document the profile in the Pear cookbook and refresh pipeline limits in the
handbook; extend runtime caps env key list.
2026-04-22 21:54:42 -04:00
Raven Scott 463e482198 Update Docs 2026-04-22 21:11:28 -04:00
Raven Scott ff9a1f8888 OpenSSH Holesail 2026-04-22 21:01:08 -04:00
Raven Scott 790c95105e Remove Log Config 2026-04-22 20:54:49 -04:00
Raven Scott 23172a2616 Stabilize Keys on login 2026-04-22 20:48:16 -04:00
Raven Scott 638b1141e4 Updates 2026-04-22 20:40:39 -04:00
Raven Scott dd1003e3ae tests 2026-04-22 20:32:40 -04:00
Raven Scott d562c78ebb updates 2026-04-22 20:26:24 -04:00
Raven Scott c1fb344784 seed 2026-04-22 20:18:19 -04:00
Raven Scott 835de02ae5 tests 2026-04-22 20:06:18 -04:00
Raven Scott 45a8a3fde6 Tests 2026-04-22 19:48:28 -04:00
Raven Scott c8e6b3b6d4 Update 2026-04-22 19:42:52 -04:00
Raven Scott 24f1067330 Tests 2026-04-22 19:39:30 -04:00
Raven Scott c5256b9a0e Fixes 2026-04-22 19:31:00 -04:00
Raven Scott 59af2a3dbf Attempt 3 2026-04-22 19:17:59 -04:00
Raven Scott 1371a15314 Attempt 2 2026-04-22 19:11:53 -04:00
Raven Scott c4e60fd83e HS Fixes 2026-04-22 18:57:40 -04:00
Raven Scott 93198d4fa6 - captureExec: stop wrapping with { … ; }; Bare shell splits ; naively, so {
became argv[0] (“unknown command: {”). Redirect only, append EXIT:N from
  BARE_OS_EXIT_STATUS after execLine.

- Streaming: normalize newlines for SSH PTY (bareOsPtyStdoutCrlf on SSH child ctx,
  bareAgentWriteOut uses ctx).
2026-04-22 17:34:02 -04:00
Raven Scott bc22a0d63e Attempts to normalized Agent output when using OpenSSH Server 2026-04-22 17:11:42 -04:00
Raven Scott 50f90320f7 Continue resolve for www server 2026-04-22 16:00:34 -04:00
Raven Scott 594c9d2279 web server service detect sub directory index.html 2026-04-22 15:54:32 -04:00
Raven Scott faba92f8b1 More Mux Fixes 2026-04-22 06:38:52 -04:00
Raven Scott e4f28533cf changes - may reverse 2026-04-22 06:25:02 -04:00
Raven Scott 5ea2f6ebdf Fix Mux Pair 2026-04-22 05:48:24 -04:00
Raven Scott 200873ab41 simplify 2026-04-22 05:40:16 -04:00
Raven Scott 33e343a127 Test 2026-04-22 05:28:46 -04:00
Raven Scott 0dd2539f66 test fix 2026-04-22 05:22:21 -04:00
Raven Scott 2f53540b1e key persist 2026-04-22 05:15:53 -04:00
Raven Scott 3ee37febc8 Fixes 2026-04-22 05:09:01 -04:00
Raven Scott 2151550f3a Updates 2026-04-22 04:58:18 -04:00
Raven Scott 19b42d647f Updates 2026-04-22 04:47:24 -04:00
Raven Scott 6b8f28bdfd Updates 2026-04-22 04:41:19 -04:00
Raven Scott eebf6a0e23 Holesail URL Persist 2026-04-22 04:21:32 -04:00
Raven Scott 1b7381c137 http server updates and docs 2026-04-22 04:12:27 -04:00
Raven Scott 4b87f2e2d8 Fixes for http 2026-04-22 03:55:14 -04:00
Raven Scott 7b8fb056c0 Attempt at HTTP Server 2026-04-22 03:44:42 -04:00
Raven Scott 9200780e21 hdms and holesail skills 2026-04-22 03:30:37 -04:00
Raven Scott 5731445ab4 Developer Skill 2026-04-22 03:15:00 -04:00
Raven Scott cb6f643273 Further updates to configure 2026-04-22 03:07:28 -04:00
Raven Scott 5eb559c554 Agent Workspace Mount After Config 2026-04-22 02:57:42 -04:00
Raven Scott 6ee7cfcb57 TUI CONFIG 2026-04-22 02:51:45 -04:00
Raven Scott bc737094ca Attempts at agent skills 2026-04-22 02:45:44 -04:00
Raven Scott 5b12254fe1 Add agent workspace 2026-04-22 02:28:25 -04:00
Raven Scott 2cfd2a8ab3 Update docs about agent and chat 2026-04-22 02:11:27 -04:00
Raven Scott 177e981221 Update System Prompt 2026-04-22 02:03:40 -04:00
Raven Scott 4fc94cebaa Further updates to web_fetch 2026-04-22 01:50:59 -04:00
Raven Scott b0165c0157 web_fetch fixes 2026-04-22 01:46:29 -04:00
Raven Scott dd24b61400 web_fetch fix 2026-04-22 01:38:49 -04:00
Raven Scott 5e457f5bea web_fetch updates 2026-04-22 01:30:47 -04:00
Raven Scott 596b7962a4 Agent white text 2026-04-22 00:14:12 -04:00
Raven Scott 64106b7ac5 agent plain text 2026-04-22 00:07:17 -04:00
Raven Scott 09433707a7 Agent Updates 2026-04-21 23:28:22 -04:00
Raven Scott 64ba795e0c Fixes for var log 2026-04-21 23:19:38 -04:00
Raven Scott 477de96c4b fix var log 2026-04-21 23:13:19 -04:00
Raven Scott d9bf332f07 Agent Fixes 2026-04-21 22:54:52 -04:00
Raven Scott 3548ae9f65 Update proc 2026-04-21 22:45:50 -04:00
Raven Scott c549569aaa Agent Updates 2026-04-21 22:33:34 -04:00
Raven Scott 932c841e06 Agent Updates 2026-04-21 22:18:41 -04:00
Raven Scott c24c518135 Resolve Agent Running Scripts 2026-04-21 22:08:22 -04:00
Raven Scott b5087a1caa Updates to Agent 2026-04-21 22:00:08 -04:00
Raven Scott 52fec92c2c Further updates to Agent 2026-04-21 21:56:24 -04:00
Raven Scott 7f6e6507e1 Attempt at beginning a ralph agent 2026-04-21 21:51:31 -04:00
Raven Scott ba53625574 Exit Y/N 2026-04-21 21:30:35 -04:00
Raven Scott ad9590aa46 Chat Fixes 2026-04-21 21:20:18 -04:00
Raven Scott df45f5cab4 Chat fixes 2026-04-21 21:02:04 -04:00
Raven Scott 01e066d7cb Chat updates 2026-04-21 20:43:06 -04:00
Raven Scott 6158ac2aa7 Chat updates 2026-04-21 20:30:28 -04:00
Raven Scott ecd01cea50 Chat TUI 2026-04-21 20:17:19 -04:00
Raven Scott 17af3ac65f chat-v1 2026-04-21 20:05:57 -04:00
Raven Scott 064c2a9338 rename cow files to bare files 2026-04-21 19:44:12 -04:00
Raven Scott cc757e44fc Fix Bear 2026-04-21 19:36:45 -04:00
Raven Scott be6ca4a40c Add cowsay-style /bin/baresay and identical /bin/say (say maps to baresay
source via build.mjs). Ship lib/baresay-engine.js for wrapping, balloons,
and cowfile parsing; default character is bear under /share/baresay/.cow.

Register commands, man pages, rebuild man/completion/posix index, sync
kernel to seeder, bump Tier-1 command count in docs to 155, and add a
test that say and baresay bundles match.
2026-04-21 19:28:55 -04:00
Raven Scott ca77803198 Replace single-line truncation with bareTopWrapLine for scalars and
bareTopFlattenLimited (multi-line, wider budget) for object/array values.
Narrow key column slightly to give more width to values; regenerate bundles.
2026-04-21 19:13:38 -04:00
Raven Scott 1d1e5c487e Replace Enter-key process detail pretty-print with flattened/summary/fd/env
views; gate legacy JSON with BARE_TOP_PROC_DETAIL_JSON.

Render nested snapshot fields via bareTopFormatNestedBrief instead of compact
JSON snippets (features, net helpers, overview).

Retitle help/initd copy and soften catalog quotas hint; document new env in
-h and F2 setup. Regenerate kernel baretop/btop bundles.

Shallow object lines format *Bytes and *Ms with existing formatters.
2026-04-21 19:01:42 -04:00
Raven Scott ef0301f435 fix(edit,nano): bracketed paste + bounded prompts so Save-as cannot flood
Enable xterm bracketed paste (?2004h/?2004l), parse ESC[200~…201~ as a single
paste event, insert paste in the buffer with one undo step, and replace
prompt input with first-line sanitized text capped by BARE_EDIT_MAX_PROMPT.
Cap typed prompt length for terminals without bracketed paste. Extend tests and
rebuild kernel /bin edit and nano bundles.
2026-04-21 18:45:55 -04:00
Raven Scott 36492de3d9 bare-ssh2 parses SFTP handles via bufferSlice/safer-buffer — handles are often
Uint8Array views that fail Buffer.isBuffer; READ/CLOSE/FSTAT/WRITE/READDIR were
rejecting every request with SSH_FX_FAILURE. Add sftpHandleId() using DataView.

OPEN: fix inner try indentation. CHANGELOG: note handle decoding + earlier SFTP
hardening (vfs normalize, enqueueSftpReply, Protocol/SFTP DATA coerce).
2026-04-21 18:22:32 -04:00
Raven Scott ac699f308e SFTP shim: coerce vfs.readFile via normalizeVfsBytesForSftp before storing
handles; use f.buf == null instead of !f.buf so empty buffers/strings do not
force SSH_FX_FAILURE on READ. READ accepts Buffer, typed views, or string after
WRITE.

Earlier in this branch: enqueueSftpReply(reqid) + FAILURE on errors; REQUEST.READ
validation in vendor bare-ssh2; coerce typed arrays to Buffer in SFTP.data and
Protocol.channelData/channelExtData. CHANGELOG notes.
2026-04-21 18:12:56 -04:00
Raven Scott baae7b3482 VFS readFile often returns Uint8Array; SFTP DATA and CHANNEL_DATA assumed
Buffer.isBuffer or treated payloads as UTF-8, corrupting packets and risking
native aborts (bad_optional_access). Normalize ArrayBuffer views in
SFTP.prototype.data and Protocol channelData/channelExtData; align READ shim.

Also includes earlier SFTP hardening: REQUEST.READ/WRITE/FSETSTAT guards,
enqueueSftpReply(reqid) + FAILURE on handler error, CHANGELOG.
2026-04-21 18:06:22 -04:00
Raven Scott 0359129a72 - SFTP.js: validate handle/offset/len on REQUEST.READ; guard WRITE/FSETSTAT
handle access like other handlers (avoid throwing before doFatalSFTPError).
- bare-openssh-sftp: enqueueSftpReply(reqid, fn) sends SSH_FX_FAILURE on
  handler throw/reject; defensive READ path (buffer/finite offsets).
- Document regression (bad_optional_access / -fno-exceptions) in comments;
  add packages/bare-os-openssh/CHANGELOG.md Unreleased entry.
2026-04-21 18:01:34 -04:00
Raven Scott 98dd91020e feat(shell): job-aware kill, disown, jobs/set flags, fallback REPL history
- Document interactive shell vs /bin/sh in bare-os-shell man, handbook §9,
  kill(1), and shell-completion guide
- Resolve kill %n and %% to synthetic PIDs via shellBackgroundJobs
- Add disown builtin; jobs -p (pgid-only) and -l (pid column); set -o/+o to
  print errexit/nounset/pipefail/noglob
- Expand completion-engine fallback flags for common utilities
- Persist lines to /.bare/repl_history_<USER> when BARE_OS_REPL_HISTORY=1
  and Fish REPL is off (repl-session + cli-readline)
- Tests: kill job specs, set -o output, jobs -p
2026-04-21 17:26:41 -04:00
Raven Scott c50bee46eb fix(openssh): serialize SFTP replies to fix FileZilla request ID mismatch
Queue all outbound SFTP responses (including READ/CLOSE) so async handlers
(REALPATH, STAT, OPENDIR, READDIR, …) cannot reorder packets vs strict clients.
Handle EXTENDED/SETSTAT/FSETSTAT via the same queue instead of bare-ssh2’s
immediate OP_UNSUPPORTED fallback.
2026-04-21 16:55:52 -04:00
Raven Scott caa60e3167 fix(openssh): widen SFTP path policy and return real dir/file metadata
Allow SFTP clients to reach the same logical paths as the shell (system
image, pseudo, home, mounts), deny mutating OPEN on typical read-only
prefixes, merge file/dir handle IDs to avoid collisions, implement FSTAT,
stat-based READDIR NAME attrs/longnames, and improve REALPATH.

Add brittle tests for path policy and wire test.bare-openssh-sftp.js into
npm test.
2026-04-21 16:44:31 -04:00
Raven Scott 643e93a1f9 Updates 2026-04-09 21:02:51 -04:00
Raven Scott 6b1555eea9 fixes 2026-04-09 20:48:03 -04:00
Raven Scott c8c877f688 Holesail Service Daemon + Bin Client 2026-04-09 20:42:54 -04:00
Raven Scott 3a69906046 fix(bare-openssh): send CR before command output on SSH PTY after line submit
Fish and bare-readline end the edited line with LF only; many SSH PTYs do not
return the cursor to column 0, so ls/man and other command output started
mid-row. Write `\r` after releasing the line editor and before execShellLine
to align output with the peer terminal.
2026-04-09 01:24:07 -04:00
Raven Scott a86432deff Prefer createFishReadLine for interactive SSH shells (history, arrows,
completion) when BARE_OS_FISH is not 0, matching the in-app terminal.

Keep bare-readline + per-command recycle only as fallback. Wire
suspendReplForSubprocess / resumeReplAfterSubprocess on the SSH child ctx to
suspendFishStdinForSubprocess / resume on the channel stream so baretop and
edit release the correct stdin.

Teardown: disableFishRawMode + releaseFishStdin when the session ends.
2026-04-09 01:16:25 -04:00
Raven Scott 01eddc84bf fix(bare-openssh): stop syncing TERM from PTY to fix SSH TUIs (baretop)
PTY env sync now only updates COLUMNS and LINES. Writing the client TERM
(e.g. xterm-256color) into the forked session env enabled baretop’s default
incremental line-diff, which mis-renders over SSH. Inherited guest TERM is
unchanged, matching in-app terminal behavior.
2026-04-09 01:03:19 -04:00
Raven Scott 2b9a10e371 Normalize embedded newlines to CRLF in SSH child ctx console log/error so
multiline output (e.g. man, bare-slice pager) matches real PTY behavior and
avoids misaligned lines vs the peer terminal.

Mirror pty-req TERM and dimensions into forked session vfs.env (COLUMNS,
LINES) when bareOsForkShellEnv is used; clear target on session end.

Add bare-openssh-pty-console helper module and brittle tests; re-export
formatter from bare-openssh for API parity.
2026-04-09 00:53:45 -04:00
Raven Scott 2f80913271 Updates to btop 2026-04-09 00:28:11 -04:00
Raven Scott b1607f78fa fix(kernel-runner): bind console to ctx.console in eval'd user scripts
AsyncFunction bodies used global console.log, so ./script.js output over SSH
went to Pear instead of the session TTY. Prepend var console = ctx.console
when ctx.console is present.
2026-04-09 00:10:51 -04:00
Raven Scott a08e1891d3 fix(bare-openssh): drop stray ">" after commands (readline PS1 on recycle)
bare-readline treats empty prompt as falsy and defaults to ">"; each SSH
readline recycle painted that before setPrompt. Pass initialPrompt from
the real PS1, defer first attach until after profile/barerc, and skip the
extra \\r\\n after recycled bare-readline.
2026-04-08 23:59:39 -04:00
Raven Scott 277300b716 fix(bare-openssh): recycle readline after TUIs (e.g. baretop) on SSH
Close bare-readline before each execShellLine and attach a new session
afterward so fullscreen apps own stdin; avoids a corrupted KeyDecoder
and a frozen prompt when baretop/edit exit.
2026-04-08 23:51:20 -04:00
Raven Scott 85bb26fb57 fix(bare-openssh): apply SSH pty size to channel stream for TUIs
Wire pty-req and window-change to set columns/rows on the session
stream so /bin/edit (nano) and similar apps use the real terminal
geometry instead of defaulting to 80x24.
2026-04-08 23:42:48 -04:00