plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker
BSD 3-Clause "New" or "Revised" License
60 stars 15 forks source link

Add support for GIT_CREDENTIAL_ENV to build private repos #42

Closed jtpio closed 3 years ago

jtpio commented 3 years ago

Fixes #27

This makes it possible to pass a username and password from the UI:

https://user-images.githubusercontent.com/591645/107351297-bbb3e880-6aca-11eb-9a78-8e4e843260d4.mp4

Using repo2docker support for GIT_CREDENTIAL_ENV (some info in https://github.com/jupyterhub/repo2docker/commit/504aeb7300dce5ee3bd6aaf9a836f96855b435b6)

For example with GitHub, a user can generate a new access token with the read scope:

image

And use this token as the password.

Similar with GitLab:

image

jtpio commented 3 years ago

Hiding the credential inputs in a <section> tag:

https://user-images.githubusercontent.com/591645/107352301-f4a08d00-6acb-11eb-8a54-545b887d9fd7.mp4

jtpio commented 3 years ago

cc @adriendelsalle this makes it possible to provide credentials to be able to clone private repositories.

It looks like providing a username and password might be a better option than using basic auth in the repo URL and then stripping it. This also leverages the GIT_CREDENTIAL_ENV env var from repo2docker, which is also used in Binder (via the git_credentials trait)

srggrs commented 3 years ago

when this is going to be merged?

jtpio commented 3 years ago

@srggrs probably soon.

If you would like to test, you can install the plugin from this branch with the following passed to the TLJH installer:

--plugin git+https://github.com/jtpio/tljh-repo2docker@private-repos
jtpio commented 3 years ago

cc @pierrepo in case you have some inputs w.r.t the UI, since it adds two new fields to the dialog (collapsed by default)

pierrepo commented 3 years ago

Hey @jtpio sorry for the delay. This looks very nice to me. This is a very useful functionality.

jtpio commented 3 years ago

Thanks for checking it out :+1: