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

fix(cli): git credentials forwarding on vscode with private dotfiles #1076

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ type SSHCmd struct {
AgentForwarding bool
GPGAgentForwarding bool

StartServices bool
StartServices bool
ForceGitCredentialForwarding bool

Proxy bool

Expand Down Expand Up @@ -93,6 +94,8 @@ func NewSSHCmd(flags *flags.GlobalFlags) *cobra.Command {
sshCmd.Flags().BoolVar(&cmd.GPGAgentForwarding, "gpg-agent-forwarding", false, "If true forward the local gpg-agent to the remote machine")
sshCmd.Flags().BoolVar(&cmd.Stdio, "stdio", false, "If true will tunnel connection through stdout and stdin")
sshCmd.Flags().BoolVar(&cmd.StartServices, "start-services", true, "If false will not start any port-forwarding or git / docker credentials helper")
sshCmd.Flags().BoolVar(&cmd.ForceGitCredentialForwarding, "force-git-credential-forwarding", false, "Forces git credential forwarding")
_ = sshCmd.Flags().MarkHidden("force-git-credential-forwarding")
return sshCmd
}

Expand Down Expand Up @@ -420,6 +423,9 @@ func (cmd *SSHCmd) startServices(
) {
if cmd.User != "" {
gitCredentials := ideName != string(config.IDEVSCode)
if cmd.ForceGitCredentialForwarding {
gitCredentials = true
}
err := tunnel.RunInContainer(
ctx,
devPodConfig,
Expand Down
1 change: 1 addition & 0 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ func setupDotfiles(
"ssh",
"--agent-forwarding=true",
"--start-services=true",
"--force-git-credential-forwarding",
"--user",
remoteUser,
"--context",
Expand Down
Loading