Binderhub: Docs for personal BinderHub CORS setup

Created on 23 Sep 2020  路  6Comments  路  Source: jupyterhub/binderhub

Proposed change

Consolidated documentation for setting up CORS headers on personal BinderHub deployments with helm.

Alternative options

Leave the documentation as it is - and I will just be grateful for an already awesome tool!

Who would use this feature?

Anyone wishing to connect to a personal BinderHub deployment via clients that rely on CORS requests, like Juniper.

(Optional): Suggest a solution

My knowledge of CORS headers, etc. is quite limited. But as far as I have pieced together from the MyBinder deployment config/ other Github issues, the following minimal additions must be added to config.yaml:

binderhub:
  cors: &cors
    allowOrigin: "*"

  jupyterhub:
    custom:
      cors: *cors

And I remember reading a comment somewhere from @minrk that only authenticated requests are supposed to work with cors, so maybe the authentication options should also be added?

If I ever get my own cors setup to work, I would be happy to contribute this section to the documentation myself. Unfortunately, my naive attempts with the above options have failed so far. For reference, I am trying to use juniper on this page to connect to this binder. For debugging, the page console is logging connection events as experienced by juniper, which is where I'm seeing the CORS error. I'm not giving up, but maybe someone has some helpful tips in the meantime.

enhancement

All 6 comments

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:

Welcome to the Jupyter community! :tada:

Just adding my 2 cents here. I am a complete newbie to this as well but I recently added these headers to my config.yaml for a binder hosted on AWS and they worked a charm! I wrote all my steps out in a guide, here is the section with my config.yaml in case it's helpful.

(I stumbled upon the need for the CORS headings by looking at the config files of mybinder.org - so I agree that it would be helpful if it was documented somewhere)

Thanks @TomasBeuzen, that did it! I'm pretty sure I just had the yaml nesting wrong. Had I seen your config.yaml this morning it would have saved me quite a few headaches 馃槄

So my problem is solved. If you're up for it, I would recommend that you (or I if you don't want to!) make a pull request for the documentation with a small section about CORS and includes your full working config.yaml (probably under Customization, next to the https stuff?)

Glad I could help! (I also had many headaches trying to sort this out so I know what it's like!). I recently opened #1151 to add some more documentation supporting HTTPS for AWS users. This CORS stuff probably fits pretty naturally into/around that PR so I can include that too. Will link this issue once I open the PR :)

Do you want to make a separate PR for the CORS documentation? In general smaller PRs or PRs that touch only one topic are easier and faster to review than bigger ones.

Sure sounds good

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choldgraf picture choldgraf  路  7Comments

betatim picture betatim  路  3Comments

choldgraf picture choldgraf  路  3Comments

raffadrummer picture raffadrummer  路  4Comments

davidbrochart picture davidbrochart  路  6Comments