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

Override the ssh-askpass.sh script from the git extension to respect the workspace ssh key #400

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Aug 14, 2024

What does this PR do?

Override the ssh-askpass.sh script from the git extension to read the passphrase mounted to workspace by the ssh secret.

What issues does this PR fix?

devfile/devworkspace-operator#1295

How to test this PR?

  1. Add an ssh key secret
  2. Start a workspace from the sample repository. The repository contains a devfile with a project source of the ssh url and DISPLAY environment variable. The env variable is needed to invoke the ssh askpass script flow. This variable will be added as permanent in the upcoming DWO pull request.
  3. Try any git operation with remote using the git extension, e.g. Git: Pull

See: the command executes without asking the ssh passphrase.

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Copy link

github-actions bot commented Aug 14, 2024

Click here to review and test in web IDE: Contribute

Copy link

Copy link
Contributor

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested:

  • git clone using ssh, like [email protected]:RomanNikitenko/web-nodejs-sample.git
  • git pull

With PR changes I was able to do git operations using ssh without errors and VS Code didn't ask me passphrase

@ibuziuk
Copy link
Contributor

ibuziuk commented Aug 19, 2024

@musienko-maxim @SkorikSergey could you please review?

@vinokurig
Copy link
Contributor Author

vinokurig commented Sep 17, 2024

I would like to postpone this PR because it is not actual with the current DWO. However I would like to keep the PR in case we switch the DWO logic to /etc/profile.d instead of bashrc, see devfile/devworkspace-operator#1307 (comment)

@vinokurig vinokurig merged commit 029a3d9 into main Nov 7, 2024
7 checks passed
@vinokurig vinokurig deleted the dwo-1295 branch November 7, 2024 07:29
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 this pull request may close these issues.

6 participants