Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Testing remote proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
rcthomas committed Nov 11, 2019
1 parent 8e3df34 commit dcaf08d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
26 changes: 17 additions & 9 deletions jupyter-compose/app-notebooks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,29 @@ RUN \
RUN \
jupyter labextension install @jupyterlab/hub-extension

# Jupyter server proxy; install but don't enable
# Jupyter server proxy

RUN \
pip install --no-cache-dir \
jupyter-server-proxy

ADD jupyter-server-mapper /tmp/jupyter-server-mapper
RUN \
cd /tmp/jupyter-server-mapper && \
python setup.py install && \
cd - && \
jupyter serverextension enable --py jupyter_server_mapper --sys-prefix
git+https://github.com/rcthomas/jupyter-server-proxy.git@allow-remote-proxy

ADD jupyter_notebook_config.py /opt/anaconda3/etc/jupyter/.

#### # Jupyter server proxy; install but don't enable
####
#### RUN \
#### pip install --no-cache-dir \
#### jupyter-server-proxy
####
#### ADD jupyter-server-mapper /tmp/jupyter-server-mapper
#### RUN \
#### cd /tmp/jupyter-server-mapper && \
#### python setup.py install && \
#### cd - && \
#### jupyter serverextension enable --py jupyter_server_mapper --sys-prefix
####
#### ADD jupyter_notebook_config.py /opt/anaconda3/etc/jupyter/.

# Some dummy users

RUN \
Expand Down
12 changes: 9 additions & 3 deletions jupyter-compose/app-notebooks/jupyter_notebook_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

def mapper(key):
return "service" + key
### def mapper(key):
### return "service" + key
###
### c.ServerMapper.mapper = mapper

c.ServerMapper.mapper = mapper
def hook(handler, host):
handler.log.info("request to proxy to host " + host)
return host == "service1"

c.ServerProxy.host_whitelist_hook = hook

0 comments on commit dcaf08d

Please sign in to comment.