简体   繁体   中英

Jupyterhub - iframe in canvas LMS

I have two different servers with one Canvas LMS installed and one JupyterHub.

I include as an external app with LTI JupyterHub in Canvas and setting the configuration:

c.JupyterHub.tornado_settings = {
'headers': {
    'Content-Security-Policy': "frame-ancestors 'self' https://xxxxxxx.yyy"
}}

he problem is that when I click on the "start my server" button (image 1), the iframe is blocked because jupyterhub does not consider it safe.

How do I set the setting "Content-Security-Policy" for the docker and for each jupyterhub user?

I read that there is a jupyter_notebook_config.py file, I tried to set it up but it doesn't seem to work...

在此处输入图像描述

SOLUTION: Add to your jupyterhub_config.py:

c.Spawner.args = ['--NotebookApp.tornado_settings={"headers":{"Content-Security-Policy": "frame-ancestors * self https://yourwebsitehere.com"}}', '--NotebookApp.disable_check_xsrf=True']

c.JupyterHub.tornado_settings = { 'headers': { 'Content-Security-Policy': "frame-ancestors * self https://yourwebsitehere.com"} }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM