changes to default config.

This commit is contained in:
mathematicalmichael 2019-02-15 10:04:06 -07:00
parent 5e48f8e431
commit 3c78070359
4 changed files with 11 additions and 1 deletions

1
.env
View File

@ -41,3 +41,4 @@ DOCKER_SPAWN_CMD=start-singleuser.sh
# you can print the password for this hub-admin user with 'bash show_login.sh'
USERNAME=hub-admin
PASSWORD_LENGTH=6
HUB_LOC=/home/pilosovm/hub

View File

@ -8,6 +8,12 @@ RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
/opt/conda/bin/conda clean -tipsy && \
/opt/conda/bin/pip install --no-cache-dir \
oauthenticator==0.8.*
RUN apt-get update && \
apt-get install -y --no-install-recommends \
vim
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install jupyterhub-hashauthenticator git+https://github.com/jupyterhub/dockerspawner.git@master

View File

@ -44,7 +44,9 @@ class MyDockerSpawner(DockerSpawner):
'mode': 'rw', # or ro for read-only
}
if self.user.name == 'hub-admin': # if admin, allow userlist access
self.volumes[os.path.join(pwd,'userlist')] = { 'bind': '/home/jovyan/userlist',
self.volumes['%s/userlist'%(os.environ['HUB_LOC'])] = { 'bind': '/home/jovyan/userlist',
'mode': 'rw' }
self.volumes['%s/jupyterhub_config.py'%(os.environ['HUB_LOC'])] = { 'bind': '/home/jovyan/jupyterhub_config.py',
'mode': 'rw' }
return super().start()

View File

@ -7,6 +7,7 @@ echo "hub-admin admin shared" > userlist
mkdir secrets
make secrets/oauth.env
make secrets/postgres.env
echo "HUB_LOC=$(pwd)" >> .env
source .env
# show what is needed to be added to /etc/nginx/sites-enabled/hub.conf