-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JupyterHub 4.1.0 breaks Formgrader iFrame embed #1870
Comments
Confirmed! |
workaround if you are using jupyterhub in Kubernetes:
|
You can have just |
I would like to use the workaround until the problem is fixed in nbgrader. Jupyterhub is installed directly on my server OS and I modified c.JupyterHub.ServerApp.tornado_settings = {
"headers":{"Content-Security-Policy": "frame-ancestors 'self' "} Unfortunately the workaround did not work in my case. I don't see any change in the response header of |
@goekce I think JupyterHub is still using jupyter-notebook rather than jupyter-server. Try using |
Nice idea @lahwaacz ! I tried both Jupyterhub settings and:
{
"NotebookApp": {
"tornado_settings": {
"headers": {"Content-Security-Policy": "frame-ancestors 'self' "}
}
}
} They did not help however 🙁. I see no effect of these settings in the response headers. I believe something else is overwriting these settings in my case. |
@goekce Hmm, maybe also add the same to |
Changing the following line manually seems to change the response headers: So I believe Jupyterhub is using the ServerApp. However the following lines do not have an effect: c.ServerApp.tornado_settings = {
"headers":{"Content-Security-Policy": "frame-ancestors 'self' "}
}
c.JupyterHub.ServerApp.tornado_settings = ... # same I probably should try with a clean installation. |
Hello! I have the same issue #1910 |
I did not have time since my last post dear @henry-goluss |
@henry-goluss @goekce Likewise, I've been using the /user/XXXXXX/formgrader domain to access Formgrader. I couldn't get the above working. |
We may set the
Add a method def initialize(self):
super().initialize()
self.set_header("Content-Security-Policy", "frame-ancestors 'self'") Then formgrader works as expected without lowering the hub's overall security (as far as I understand). |
Thank you for the answers but my knowledge is too poor to clearly understand what to do or try! I guess I will rollback to my old configuration. |
Yes, it's somewhat hacky. But if you want to try, here are the steps:
def initialize(self):
super().initialize()
self.set_header("Content-Security-Policy", "frame-ancestors 'self'")
|
@jeflem Can you open a pull request? |
Indeed, a PR would be good. I'll try till end of the week. |
Solved by #1915 |
Operating system
Ubuntu 22
nbgrader --version
0.9.1
jupyterhub --version
(if used with JupyterHub)4.1.0
jupyter notebook --version
7.1.2
Expected behavior
Actual behavior
Steps to reproduce the behavior
Created an instance with the The Littlest Jupyterhub that fetches JupyterHub 4.1.0 and installed NBGrader. Tried to access Formgrader and get the following error on browsers.
It is due to this update on Jupyterhub here: https://jupyterhub.readthedocs.io/en/stable/explanation/websecurity.html#mitigating-same-origin-deployments
The text was updated successfully, but these errors were encountered: