jupyterlab-github icon indicating copy to clipboard operation
jupyterlab-github copied to clipboard

Changeable github URL?

Open deppfx opened this issue 7 years ago • 9 comments

Can this integration be used with a private github URL instead of the actual github.com? In other words, can the URL be configurable (leaving the default to github.com)?

deppfx avatar Sep 06 '18 08:09 deppfx

This extension currently does work fine with GitHub Enterprise and work is ongoing to make that integration more seamless.

dhirschfeld avatar Sep 06 '18 09:09 dhirschfeld

@dhirschfeld Sorry, I don't follow. How can I point the extension to git.myserver.com instead of github.com?

deppfx avatar Sep 06 '18 19:09 deppfx

@deppfx - currently, if you install the server (python) extension you can configure the api_url in the notebook configuration file: https://github.com/jupyterlab/jupyterlab-github#3-installing-the-serverextension

c.GitHubConfig.api_url = 'https://git.myserver.com/api/v3'

To get the Open in GitHub button to correctly point to your GitHub Enterprise instance you also have to set the baseUrl configuration in the JupyterLab settings to point to your GitHub Enterprise instance:

"baseUrl": "https://git.myserver.com"

Note: I'm currently exploring ways to more seamlessly support GitHub Enterprise deployments so it's possible this interface may change.

dhirschfeld avatar Sep 13 '18 22:09 dhirschfeld

If you decide to go with the access token approach, add the following to the notebook configuration file:

c.GitHubConfig.api_url = 'https://<your_ghe_domain>/api/v3/'
c.GitHubConfig.allow_client_side_access_token = True

Without the second line, the server will only try github.com

This was pretty confusing, especially after we noticed the the octocat icon to the right of the user or org takes you to your local ghe in a new browser tab (at least in Chrome).

I would recommend adding instructions about this to README.md. Perhaps that would be sufficient to close the issue?

fm75 avatar Apr 12 '19 15:04 fm75

Thanks @fm75, I would welcome PRs to make this less confusing! Note that I am not using GHE, so my ability to test on such setups is pretty limited.

ian-r-rose avatar Apr 12 '19 15:04 ian-r-rose

@ian-r-rose - I have been looking a little deeper at this. I could easily make a documentation only PR, but I have questions about the existing structure and behavior.

It is not clear to me why there is a server extension

It seems like if all the pieces were put into the front-end, in particular the ability to set the api url, the server piece does not seem to add any value. Perhaps there is some history that I am missing here.

Going to github is fine for a default

Going to github when trying to modify the extension to use a GHE server seems like a bad idea, but it either does that or returns 403 or 404 depending on what is wrong.

There seems to be a preference for driving from configuration file

Why should we prefer to alter the jupyter_notebook_config.py file before starting our server rather than letting the user configure access in the front end?

fm75 avatar Apr 15 '19 17:04 fm75

Just trying to get this work with my GitHub enterprise account.

I have done the following:

  • added these four lines to my jupyter_notebook_config.py
c.GitHubConfig.client_id = 'jupyterlab-github'
c.GitHubConfig.client_secret = 'MY_API_TOKEN'
c.GitHubConfig.api_url = 'https://github.<ORG>.ca/api/v3/'
c.GitHubConfig.allow_client_side_access_token = True
  • In jupyterlab settings, changed Github extension setting to:

"baseUrl": "https://github.<ORG>.ca"

Unfortunately, my username is still 'not found' (it was created within GHE. Clicking on the GitHub icon within the extension does take me to the correct GHE page...

Any other steps I'm missing?

notfound )

firasm avatar Jun 25 '19 18:06 firasm

@firasm i know it has been a while but any update? I am trying exactly what you have above and it is not working for me either.

antpingelli avatar Oct 15 '20 13:10 antpingelli

Nope, wasn't able to get it to work unfortunately!

firasm avatar Oct 15 '20 14:10 firasm