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

Changeable github URL? #72

Open
deppfx opened this issue Sep 6, 2018 · 9 comments
Open

Changeable github URL? #72

deppfx opened this issue Sep 6, 2018 · 9 comments

Comments

@deppfx
Copy link

deppfx commented Sep 6, 2018

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 deppfx changed the title Jupyterhub Hosted github integration Changeable github URL? Sep 6, 2018
@dhirschfeld
Copy link
Member

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

@deppfx
Copy link
Author

deppfx commented Sep 6, 2018

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

@dhirschfeld
Copy link
Member

@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.

@fm75
Copy link

fm75 commented Apr 12, 2019

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?

@ian-r-rose
Copy link
Member

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.

@fm75
Copy link

fm75 commented Apr 15, 2019

@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?

@firasm
Copy link

firasm commented Jun 25, 2019

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..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

)

@antpingelli
Copy link

@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.

@firasm
Copy link

firasm commented Oct 15, 2020

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

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

6 participants