Skip to content
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

Add --whole-filesystem command line flag #4294

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

takluyver
Copy link
Member

For security, we don't currently serve files above the notebook directory, normally the working directory where you launch the server. Someone who gets full access can still access the full filesystem by starting a kernel or a terminal, but it limits the possible damage if the attacker can only make plain HTTP requests.

However, this restriction is often frustrating, and people would like to be able to navigate up from the start point, trusting other layers of security. This can be achieved with the correct configuration, but it's not very convenient.

This PR adds a --whole-filesystem command line flag which uses the filesystem root / as the notebook directory, but opens the browser to the CWD where you launched the notebook. It's meant as a proposal for discussion, not a finished work.

I haven't thought yet about what this does on Windows, or with custom contents managers which don't use a filesystem.

@takluyver
Copy link
Member Author

Ping @minrk @Carreau for possible interest in this

@Carreau
Copy link
Member

Carreau commented Jan 30, 2019

Sounds reasonable to me. And I'm happy to have it as a linux only, at least as a start.
That might confuse the lab extension, that start to set the starting url to /lab though.
Maybe wee want a "default location" (equivalent of $HOME) which would be sent to the UI.

@dhirschfeld
Copy link
Contributor

I set the notebook_dir to the root of the filesystem but direct the default_url to users' home directory. I do this because I want my users to have access to the source files in site-packages for debugging purposes.

c.DockerSpawner.notebook_dir = 'C:/'
c.DockerSpawner.default_url = '/user/{username}/lab/tree/jupyter'
c.DockerSpawner.volumes = {'J:/{username}': 'C:/jupyter'}

I guess the --whole-filesystem flag would just be a convenience for the above configuration?

@minrk
Copy link
Member

minrk commented Jan 31, 2019

@dhirschfeld that's right. This adds a flag that is shorthand for setting two other already existing options in a common configuration. It's not new functionality, just new convenience.

Doing it exactly like this could have some slightly tricky interactions, e.g. with base_url, but it seems a sensible option to me.

@takluyver
Copy link
Member Author

Yup, it's convenience, plus a signal that this is a reasonable thing to do.

People seem to be happy with the idea, so I'll try to work out how best to implement it.

@blink1073 blink1073 marked this pull request as draft June 7, 2020 11:41
@blink1073
Copy link
Member

@takluyver, should we close this one or open an issue on jupyter_server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants