fix(ssh): honor T3CODE_HOME on the remote host - #1
Merged
Merged
Conversation
The remote launch, pairing, stop and log scripts hardcoded $HOME/.t3 for
the ssh-launch state directory and passed --base-dir "$HOME/.t3" to the
server, so a remote host with T3CODE_HOME set still got ~/.t3.
Use ${T3CODE_HOME:-$HOME/.t3} in all four scripts. The default is
unchanged for hosts without the variable.
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.
Problem
The remote launch, pairing, stop and log scripts hardcode
$HOME/.t3for thessh-launchstate directory and start the server with--base-dir "$HOME/.t3". A remote host that setsT3CODE_HOMEstill gets~/.t3, because the flag overrides the variable.Change
All four scripts use
${T3CODE_HOME:-$HOME/.t3}. Hosts without the variable see no change.Verification
vp test run packages/ssh: 48 passedvp lint packages/ssh/src/tunnel.ts: cleanUpstream
Candidate for a PR to pingdotgg/t3code as a bug fix. It does not change the default storage layout, so it is separate from the XDG discussion in pingdotgg#10810.