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

Cannot use user's git authentication inside ddev container #87

Open
3 tasks
shaal opened this issue Apr 29, 2022 · 0 comments
Open
3 tasks

Cannot use user's git authentication inside ddev container #87

shaal opened this issue Apr 29, 2022 · 0 comments

Comments

@shaal
Copy link
Owner

shaal commented Apr 29, 2022

Describe the bug

When running git commands in Gitpod, Gitpod uses /usr/bin/gp credential-helper command to get authorization.
When running git commands inside ddev container, gp credential-helper is not available.

This issue becomes obvious when fetching github repo through composer inside ddev container (see steps to reproduce)
Or when git clone a private repo inside ddev container.

To Reproduce

  1. Open DrupalPod workspace in Gitpod
  2. Follow https://github.com/zolhorvath/cd_tools instructions:
    1. Type in terminal:
    2. composer config repositories.'zolhorvath/cd_tools' github https://github.com/zolhorvath/cd_tools.git
    3. composer require zolhorvath/cd_tools

You'll see the following error:

GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/zolhorvath/cd_tools/contents/composer.json?ref=123456789012345678901234567890. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+drupalpod-web+2022-04-29+0117 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+drupalpod-web+2022-04-29+0117
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "/home/gitpod/.composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden): 

Expected behavior

I'd like to run git commands in container with same access as I get in Gitpod.
This will also block private repos.

Screenshots

Version and configuration information (please complete the following information)

  • Issue page
  • Issue branch
  • Drupal core version
  • Project type
  • Core
  • Module
  • Theme

Additional context

~/.gitconfig includes:

[push]
        default = simple
[credential]
        helper = /usr/bin/gp credential-helper

This PR is trying to solve a similar issue - gitpod-io/gitpod#8228

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