Commit 00eb9f02 authored by CAMPION Sebastien's avatar CAMPION Sebastien

fix user creation bug

parent 62f81afc
FROM jupyterhub/jupyterhub
RUN pip install jupyter==1.0.0
FROM debian:jessie
# install nodejs, utf8 locale, set CDN because default httpredir is unreliable
ENV DEBIAN_FRONTEND noninteractive
RUN REPO=http://cdn-fastly.deb.debian.org && \
echo "deb $REPO/debian jessie main\ndeb $REPO/debian-security jessie/updates main" > /etc/apt/sources.list && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install wget locales git bzip2 &&\
/usr/sbin/update-locale LANG=C.UTF-8 && \
locale-gen C.UTF-8 && \
apt-get remove -y locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LANG C.UTF-8
# install Python + NodeJS with conda
RUN wget -q https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh -O /tmp/miniconda.sh && \
echo 'd0c7c71cc5659e54ab51f2005a8d96f3 */tmp/miniconda.sh' | md5sum -c - && \
bash /tmp/miniconda.sh -f -b -p /opt/conda && \
/opt/conda/bin/conda install --yes -c conda-forge \
python=3.5 sqlalchemy tornado jinja2 traitlets requests pip pycurl \
nodejs configurable-http-proxy && \
/opt/conda/bin/pip install --upgrade pip && \
rm /tmp/miniconda.sh
ENV PATH=/opt/conda/bin:$PATH
ADD . /src/jupyterhub
WORKDIR /src/jupyterhub
RUN rm -rf $PWD ~/.cache ~/.npm
RUN conda install notebook
RUN mkdir -p /srv/jupyterhub/
WORKDIR /srv/jupyterhub/
EXPOSE 8000
#RUN apt-get update
#RUN apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
#RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
#RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
#RUN apt-get update
#RUN apt-get install -y docker-ce
#RUN pip install jupyter==1.0.0
RUN apt-get update && apt-get install -y git nano
RUN pip install https://github.com/data-8/nbgitpuller/archive/28fe9b1af2ba64b346d59bd13c99581346bf349f.zip
RUN pip install https://github.com/mogthesprog/jwtauthenticator/archive/63467a803e2e96fb17516a8c4bcf09efbe9e60f3.zip
RUN pip install https://github.com/scampion/jwtauthenticator/archive/7aefcb4d54b959bfd472ccba25fedd463e1f2ce0.zip
# https://github.com/mogthesprog/jwtauthenticator/archive/63467a803e2e96fb17516a8c4bcf09efbe9e60f3.zip
RUN jupyter serverextension enable --py nbgitpuller --sys-prefix
RUN apt-get install git
ENV PYTHONUNBUFFERED 1
CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]
\ No newline at end of file
RUN conda upgrade notebook
CMD jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
\ No newline at end of file
......@@ -76,6 +76,10 @@
# and `data` is the POST form data from the login page.
#c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'
#c.JSONWebTokenLocalAuthenticator.add_user_cmd = ['useradd', 'USERNAME', '--disabled-password']
#c.LocalAuthenticator.create_system_users = True
#c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
c.JupyterHub.authenticator_class = 'jwtauthenticator.jwtauthenticator.JSONWebTokenLocalAuthenticator'
#c.JupyterHub.authenticator_class = 'jwtauthenticator.jwtauthenticator.JSONWebTokenAuthenticator'
# # one of "secret" or "signing_certificate" must be given. If both, then "secret" will be the signing method used.
......@@ -85,9 +89,10 @@ import os
c.JSONWebTokenAuthenticator.signing_certificate = os.environ.get("JUPYTERHUB_JWT_KEY") #/foo/bar/adfs-signature.crt' # The certificate used to sign the incoming JSONWebToken, must be in PEM Format
c.JSONWebTokenAuthenticator.username_claim_field = 'upn' # The claim field contianing the username/sAMAccountNAme/userPrincipalName
c.JSONWebTokenAuthenticator.expected_audience = 'jupyter' # This config option should match the aud field of the JSONWebToken, empty string to disable the validation of this field.
#c.JSONWebLocalTokenAuthenticator.create_system_users = True # This will enable local user creation upon authentication, requires JSONWebTokenLocalAuthenticator
c.JSONWebTokenAuthenticator.param_name = 'bearer' # default value
c.JSONWebTokenLocalAuthenticator.create_system_users = True # This will enable local user creation upon authentication, requires JSONWebTokenLocalAuthenticator
c.LocalAuthenticator.create_system_users = True
c.JSONWebTokenAuthenticator.param_name = 'bearer' # default value
## The base URL of the entire application.
#
......@@ -317,7 +322,10 @@ c.JupyterHub.log_level = 'DEBUG'
## The class to use for spawning single-user servers.
#
# Should be a subclass of Spawner.
#c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
#c.JupyterHub.spawner_class = 'dockerspawner.SystemUserSpawner'
c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
#LocalProcessSpawner
## Path to SSL certificate file for the public facing interface of the proxy
#
......@@ -625,7 +633,7 @@ c.JupyterHub.log_level = 'DEBUG'
# respond. Callers of spawner.start will assume that startup has failed if it
# takes longer than this. start should return when the server process is started
# and its location is known.
#c.Spawner.start_timeout = 60
c.Spawner.start_timeout = 300
#------------------------------------------------------------------------------
# LocalProcessSpawner(Spawner) configuration
......
define(function(){
function _on_load(){
IPython.notebook.kernel.execute("URL = ' + window.location + "'")
}
return {load_ipython_extension: _on_load };
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment