From 3c7807035991687d3df9dc471f39702222045fd2 Mon Sep 17 00:00:00 2001 From: mathematicalmichael Date: Fri, 15 Feb 2019 10:04:06 -0700 Subject: [PATCH] changes to default config. --- .env | 1 + Dockerfile.jupyterhub | 6 ++++++ jupyterhub_config.py | 4 +++- setup.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 58784ec..d974f28 100755 --- a/.env +++ b/.env @@ -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 diff --git a/Dockerfile.jupyterhub b/Dockerfile.jupyterhub index d88b9cd..672ab9e 100755 --- a/Dockerfile.jupyterhub +++ b/Dockerfile.jupyterhub @@ -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 diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 8244e5c..8f4ee9e 100755 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -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() diff --git a/setup.sh b/setup.sh index 892b3a4..88efffb 100755 --- a/setup.sh +++ b/setup.sh @@ -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