-
Notifications
You must be signed in to change notification settings - Fork 122
Would it be possible to embed this into an iframe? #263
Comments
@daeilkim - Were you able to find a fix for the same? For individual jupyter notebook, I was able to make it work via following command: jupyter notebook --NotebookApp.tornado_settings='{"headers":{"Content-Security-Policy":"frame-ancestors self http://localhost:9000; report-uri /api/security/csp-report" }}' However, when running via tmpnp, I haven't figured out how to pass this setting. Trying following, but it doesn't seems to work: docker run -d \
--net=host \
--name=tmpnb \
-e CONFIGPROXY_AUTH_TOKEN=$TOKEN \
-v /var/run/docker.sock:/docker.sock \
jupyter/tmpnb \
python orchestrate.py \
--container-user=jovyan \
--pool-size=5 \
--cull-timeout=30 \
--cull-max=60 \
--command="jupyter notebook \
--no-browser \
--port {port} \
--ip=0.0.0.0 \
--NotebookApp.base_url=/{base_path} \
--NotebookApp.port_retries=0 \
--NotebookApp.tornado_settings='{\"headers\": {\"Content-Security-Policy\": \"frame-ancestors self http://localhost:9000; report-uri /api/security/csp-report\"}}'
--NotebookApp.token='' \
--NotebookApp.disable_check_xsrf=True" |
Update: I was able to make it work as follows: Created a c.NotebookApp.tornado_settings = {
"headers": {
"Content-Security-Policy": "frame-ancestors self http://localhost:9000; report-uri /api/security/csp-report"
}
} Then, created a FROM jupyter/tmpnb
ADD jupyter_notebook_config.py /etc/jupyter_notebook_config.py And then created a new docker image by running following command: docker build -t myjupyter:latest . Then, to spawn tmpnb notebooks using python orchestrate.py --image=myjupyter --command='jupyter notebook --no-browser --port {port} --ip=0.0.0.0 --NotebookApp.config_file=/etc/jupyter_notebook_config.py --NotebookApp.base_url=/{base_path} --NotebookApp.port_retries=0' --container-user=jovyan |
It works for me. Thanks @utsavkesharwani 👍 |
I followed the same process detailed by @utsavkesharwani, but when I ran
|
@emptycrown: Please share your Btw, you can also try posting on Jupyter's community. Even I got my answer from there. 😃 |
Thank you @utsavkesharwani. I build the image just as you did. The command I ran was the following. I git cloned the tmpnb repo into
Here is my Dockerfile:
|
I keep getting this error when trying to run this on my localhost:
Refused to display 'http://127.0.0.1:8000/user/d8svgQA0OYAD/login?next=%2Fuser%2Fd8svgQA0OYAD%2Ftree' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' http://127.0.0.1:8000/*".
I've seen other places where you can resolve something like this by modifying the configuration file within /root/.jupyter, but haven't been able to get it working on my end. Here is the [reference url] (jupyter/notebook#886)
The text was updated successfully, but these errors were encountered: