project-satisfy / satisfy

Satis composer repository manager with a Web UI

Home Page:http://ludofleury.github.io/satisfy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloning private repos from GitHub gives error

robrecord opened this issue · comments

In my satis repository I have one package linked to private repository on GitHub.

When I run build from the administration web form, I get the following output:

'/Users/my-user/Sites/satisfy/bin/satis' 'build' '/Users/my-user/Sites/satisfy/satis.json' 'public' '--skip-errors' '--no-ansi' '--verbose'
Scanning packages
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+My+Computer+2020-06-30+0917
Token (hidden):
stty: stdin isn't a terminal
stty: stdin isn't a terminal
No token given, aborting.
You can also add it manually later by using "composer config --global --auth github-oauth.github.com "
Skipping Exception 'Failed to execute git clone --mirror 'https://github.com/my-org/my-package.git' '/Users/robrecord/Sites/satisfy/var/composer/cache/vcs/https---github.com-my-org-my-package.git/'
Writing packages.json
Pruning include directories
Writing web view
OK

I copied the URL given in line 4 of the output and generated a token.

I copied that token into my parameters.yml file next to github.secret
This didn't change anything.

When I run ./bin/satis build it asks me for my github username and password, which seems odd.

Can you help me understand if I'm doing everything right or if I've missed something?

Also it would be good to get some of this in the documentation. Thanks!

Solution

  1. Create token on GitHub with full private repo access (all within "repo" scope).
  2. Copy token
  3. On server, do:
composer config --global --auth github-oauth.github.com <my-token>

Source:
composer/composer#3542 (comment)

It would be great to get this in the documentation.

Satisfy is a wrapper for composer/satis. The latter must have access, otherwise satisfy will fail.
I would love to review PR with documentation improvements.