Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lando creates empty .ssh folder in app root #134

Open
michaellopez opened this issue Mar 8, 2022 · 4 comments · May be fixed by #135
Open

Lando creates empty .ssh folder in app root #134

michaellopez opened this issue Mar 8, 2022 · 4 comments · May be fixed by #135

Comments

@michaellopez
Copy link

michaellopez commented Mar 8, 2022

Thanks for Lando! I would like to report a simple but annoying bug.

Due to 582e22a when setting home: '' in ~/.lando/config.yml to avoid mounting the home folder as described in lando/lando#2635 (comment) Lando creates an empty folder named .ssh in the app root (next to .lando.yml)

This happens since lando.config.home is an empty string, so path.join(lando.config.home, '.ssh') evaluates to .ssh and therefore creates the folder in the working directory.

Would you like a PR or is this simple enough for you to quick fix with something like for lines 64-66:

const sshDir = lando.config.home && path.join(lando.config.home, '.ssh');
  // Ensure some dirs exist before we start
  _.forEach([caDir, sshDir], dir => dir && mkdirp.sync(dir));

Thanks for all your efforts!

@reynoldsalec
Copy link
Sponsor Member

A PR would be great @michaellopez, thanks for pointing it out!

@michaellopez michaellopez linked a pull request Mar 10, 2022 that will close this issue
@michaellopez
Copy link
Author

@reynoldsalec Here you go #135

@almunnings
Copy link
Sponsor Contributor

You can avoid creating rogue .ssh paths by using an absolute path as the value... eg

home: '/Users/al/.lando-home-jail'

then it'll go and create the .ssh dir in that root. the .ssh dir is used to load your id_rsa up... so, if you change the home dir, you should probably also copy

\cp -fR ~/.gitconfig ~/.lando-home-jail
\cp -fR ~/.ssh/id_rsa ~/.lando-home-jail/.ssh

@michaellopez
Copy link
Author

@sonuku That's pretty clever, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants