微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Jupyterhub - 画布 LMS 中的 iframe

如何解决Jupyterhub - 画布 LMS 中的 iframe

我有两台不同的服务器,安装了一台 Canvas LMS 和一台 JupyterHub。

我将 LTI JupyterHub 作为外部应用程序包含在 Canvas 中并设置配置:

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

他的问题是,当我点击“启动我的服务器”按钮(图 1)时,iframe 被阻止,因为 jupyterhub 认为它不安全。

如何为 docker 和每个 jupyterhub 用户设置“Content-Security-Policy”设置?

我读到有一个 jupyter_notebook_config.py 文件,我尝试设置它但它似乎不起作用......

enter image description here

解决方法

解决方案: 添加到您的 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"} }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。