jupyterlab / jupyterlab-git

A Git extension for JupyterLab
BSD 3-Clause "New" or "Revised" License
1.46k stars 319 forks source link

Git repos within shared folder / symbolink link not found by the extension #1231

Closed andredfb closed 1 year ago

andredfb commented 1 year ago

Description

Hey everyone, not sure if this is a misconfiguration or a bug. I have installed The Littlest JupyterHub and installed the jupyterlab-git extension as per the docs. The extension itself is working but I cannot get it to recognise repositories created inside a shared directory. My goal is to have a shared directory enabled for read/write for all users and symbolically linked in their home directory and have this shared directory as a git repo. Any tips are much appreciated!

Reproduce

  1. Install TLJH
  2. Create shared directory and give all JupyterHub users read/write access
  3. Create symbolic link inside users home directory
  4. From any user, create a git repo inside the shared folder (git init --shared=0777 or using the extension in JupyterLab) - note that in this case the repo is never visible inside JupyterLab
  5. Instead, create a folder 1 level inside the shared folder so its not the one the symbolic link is directly pointing at, in this case a git repo initialised either through the extension or command line becomes visible but only to the user who created it. All other users cannot see it and when navigated to that folder the extension keeps saying you are not currently in a git repository.

Expected behavior

I would expect that the extension can find the Git repo if the user can navigate to and read/write in the containing folder (and has the appropriate access to the .git folder).

Context

Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Web Browser Output
Without copying the full internal URL I can see a 500 internal server error with the address of the shared folder containing the .git folder when it is unable to be found by the extension.
welcome[bot] commented 1 year ago

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:

andredfb commented 1 year ago

Update: I don't think this has anything to do with the extension in the end. I think it is related to a security fix here.

Seems git is blocking access if the folder containing the .git directory does not belong to the other user attempting to use the extension. The problem can be avoided by setting the directory as a safe.directory but I will have to assess the security implications of doing this. I will close the issue but open to ideas about whether it is smart or not to use a shared directory like this with Git.