2016-04-13 15:38:30 +00:00
|
|
|
# OAuthenticator
|
|
|
|
|
|
|
|
Example of running [JupyterHub](https://github.com/jupyter/jupyterhub)
|
|
|
|
with [GitHub OAuth](https://developer.github.com/v3/oauth/) for authentication.
|
|
|
|
|
2017-01-25 00:53:05 +00:00
|
|
|
## Variables
|
2016-04-13 15:38:30 +00:00
|
|
|
|
|
|
|
|
2017-01-25 00:53:05 +00:00
|
|
|
### General variables
|
2016-04-13 15:38:30 +00:00
|
|
|
|
|
|
|
```
|
2017-01-25 00:53:05 +00:00
|
|
|
ADMINS=balkian,oaraque
|
|
|
|
OAUTH_CALLBACK_URL=http://hub.cluster.gsi.dit.upm.es/hub/oauth_callback
|
|
|
|
HOST_HOMEDIR=/mnt/home/{username} # {username} will be replaced by the actual OAuth user
|
|
|
|
```
|
|
|
|
|
|
|
|
## Gitlab variables:
|
|
|
|
|
|
|
|
```
|
|
|
|
GITLAB_HOST=https://lab.cluster.gsi.dit.upm.es/
|
|
|
|
GITLAB_CLIENT_ID=TheMaxiID
|
|
|
|
GITLAB_CLIENT_SECRET=TheMaxiSecret
|
|
|
|
OAUTH_CLASS=oauthenticator.gitlab.GitLabOAuthenticator
|
|
|
|
DATASETS_DIR=/home/datasets # READ ONLY
|
|
|
|
COMMON_DIR=/home/common # To share files between users
|
|
|
|
```
|
|
|
|
|
|
|
|
## GitHub variables:
|
|
|
|
|
|
|
|
```
|
|
|
|
GITHUB_CLIENT_ID=GHId
|
|
|
|
GITHUB_CLIENT_SECRET=GHSecret
|
|
|
|
OAUTH_CLASS=oauthenticator.github.GitHubOAuthenticator
|
2016-04-13 15:38:30 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## build
|
|
|
|
|
|
|
|
Build the container with:
|
|
|
|
|
2017-01-25 00:53:05 +00:00
|
|
|
make build
|
|
|
|
|
|
|
|
Alternatively:
|
|
|
|
|
|
|
|
docker build -t gsiupm/jupyter-oauth:testing .
|
2016-04-13 15:38:30 +00:00
|
|
|
|
|
|
|
### ssl
|
|
|
|
|
|
|
|
To run the server on HTTPS, put your ssl key and cert in ssl/ssl.key and
|
|
|
|
ssl/ssl.cert.
|
|
|
|
|
|
|
|
## run
|
|
|
|
|
2017-01-25 00:53:05 +00:00
|
|
|
Add your oauth client id, client secret, and callback URL to your `env file` (i.e. `.env`).
|
2016-04-13 15:38:30 +00:00
|
|
|
Once you have built the container, you can run it with:
|
|
|
|
|
2017-01-25 00:53:05 +00:00
|
|
|
make run
|
|
|
|
|
|
|
|
Alternatively:
|
|
|
|
|
|
|
|
docker run -it -p 8000:8000 --env-file=env gsiupm/jupyter-oauth:testing
|
2016-04-13 15:38:30 +00:00
|
|
|
|
|
|
|
Which will run the Jupyter server.
|