Repository navigation
Next host connection - #108
Merged
Merged
Conversation
- Replace the nested ssh command with real ssh2 connections opened through the parent connection's forwardOut channel. Remove server.ssh, the jump-host credential copy, and the nested prompt/command helpers. - Track hosts as an ancestor record stack with per-record listeners and timers. Contain hop failures, advance past failed primaries, and finalize each visited host once. - Arm the command idle timeout when a command is written, reset it on data, and cancel it when a prompt is detected. Remove the commandStartTimeout option and details.noOutput. - Fix _sanitizeResponse for long commands whose PTY redraw places a prompt before the echoed command. - Add host traversal and fault live tests, module target selection for src/lib/baseline, and update the README and design docs.
Remove the Hubot-era aliases and internal leaks that accumulated since the CoffeeScript version.
Breaking changes:
- Rename the host message handler from msg to onMsg.
- Remove the msg: { send } object shape.
- Remove server.hashMethod (use hostHash).
- Remove sshObj.stop (use abort).
- Remove host idleTime/dataIdleTime (use idleTimeOut/dataIdleTimeOut).
Host config no longer gains library state: defaults resolve per record,
msg.send is not rewritten into the host, and applyHostDefaults stops writing
server.hashKey.
Instance cleanup: CoffeeScript prototype defaults move into the constructor,
unused binds and dead listener helpers are removed, ssh2Client becomes the
internal _ssh2Client seam, and command/_buffer are saved and restored across a
hop so the parent resumes its own command state.
Docs: README uses onMsg, drops the removed aliases, moves internal details to
one troubleshooting note, and documents host mutation and handler this. API
baseline, close semantics, error handling, and next-host-connection notes are
updated to match.
Role settings were already read through a dynamic PROVISION_<ROLE>_<KEY> lookup, but the names never appeared literally in the script, so a search could not confirm they were used. Add a complete ROLE_ENV_KEYS contract, a --print-config mode that shows the source variable for every setting, and log the resolved sources at startup. Also use the 4.0 host surface in the provisioning run: onMsg, onCommandComplete, and onError replace instance listeners; commandResponse handled keeps logs free of echo and prompt noise; captureStderr merges sshd/netplan errors into the response. Make the network prefix configurable (PROVISION_<ROLE>_PREFIX, default 24) instead of hard-coding /24 and 255.255.255.0, validate port/idle/prefix values, and prefer the login password for password authentication while keeping SUDO_PASSWORD as the key-auth fallback.
The advanced logging example and credential note still used the old host msg key. Point both at onMsg/onData/onCommandComplete. Document the new provisioning --help / --print-config modes, the configurable network prefix, and the generic PROVISION_PREFIX fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replacing old ssh connections for tunnelling and other package improvements