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 lagoon integration .gitconfig & known_hosts missing #40

Open
almunnings opened this issue Sep 15, 2021 · 0 comments
Open

Lando lagoon integration .gitconfig & known_hosts missing #40

almunnings opened this issue Sep 15, 2021 · 0 comments

Comments

@almunnings
Copy link
Sponsor Contributor

almunnings commented Sep 15, 2021

When using lando ssh into the cli container, the user's $HOME is set to /home

This doesnt play ball with the symlinking that occurs in

if [ -f "/user/.gitconfig" ]; then
rm -f /var/www/.gitconfig
ln -sf /user/.gitconfig /var/www/.gitconfig
lando_info "Symlinked users .gitconfig."
fi
# Symlink the known_hosts
if [ -f "/user/.ssh/known_hosts" ]; then
rm -f /var/www/.ssh/known_hosts
ln -sf /user/.ssh/known_hosts /var/www/.ssh/known_hosts
lando_info "Symlinked users known_hosts"
fi

Net result is: git config --global --list

fatal: unable to read config file '/home/.gitconfig': No such file or directory

Its a nice subtle detail to have the users .gitconfig available in the cli :)

I've locally got around this by putting the following into /scripts for my lagoon builds (non-clobbering):

#!/bin/sh
set -e

if [ ! -f $HOME/.gitconfig ] && [ -f /user/.gitconfig ]; then
  ln -sf /user/.gitconfig $HOME/.gitconfig
fi

if [ ! -f $HOME/.ssh/known_hosts ] && [ -f /user/.ssh/known_hosts ]; then
  ln -sf /user/.ssh/known_hosts $HOME/.ssh/known_hosts
fi

But maybe theres a better place to integrate this?

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

No branches or pull requests

1 participant