jupyter/docker-demo-images

Make it possible to redirect to a notebook directly in a tmpnb link

jvns opened this issue · 2 comments

jvns commented

I'd love to be able to to go to http://tmpnb.org?redirect=/tree/featured/pandas-cookbook/cookbook/Chapter%207%20-%20Cleaning%20up%20messy%20data.ipynb

or possibly http://tmpnb.org/tree/featured/pandas-cookbook/cookbook/Chapter%207%20-%20Cleaning%20up%20messy%20data.ipynb

so that I can give people direct links to notebooks to try out. I don't know if this is even in the right repo, but three questions:

a) does this seem like a reasonable thing to do?
b) which URL format do you like better?
c) where in the code should I start looking if I wanted to add this?

That's reasonable. I'd prefer the first of the two URL schemes. You're right in wondering where this should go, since tmpnb and the underlying docker container running in tmpnb are two separate entities. Redirection strikes me as something optional, as that's a possible path for XSS issues.

Within jupyter/tmpnb, I'd check out where the redirect_uri gets picked up from the settings. Note that it's part of the /spawn handler, so your actual URL handler is going to look more like /spawn/?redirect=/tree/featured/pandas-cookbook/cookbook/....

jvns commented

Thanks, that's really helpful! I'll close this for now since it doesn't belong in this repo :)