yuvipanda / jupyter-desktop-server

Run a Linux Desktop on a JupyterHub
BSD 3-Clause "New" or "Revised" License
46 stars 36 forks source link

Fix permissions on ~/.cache #22

Closed manics closed 3 years ago

manics commented 4 years ago

apt-get install xorg somehow results in a /home/jovyan/.cache directory being created and owned by root, maybe because HOME is set to /home/jovyan? This prevents the jovyan user running other programs such as Firefox:

$ podman build -t jupyter-desktop-server .
...

$ podman run --rm jupyter-desktop-server ls -la
total 40
drwxrwxr-x. 7 jovyan users 4096 Aug 16 17:04 .
drwxr-xr-x. 3 root   root  4096 Aug 16 17:04 ..
-rw-rw-r--. 1 jovyan users  220 Feb 25 12:03 .bash_logout
-rw-rw-r--. 1 jovyan users 3770 Jun 18 03:05 .bashrc
drwx------. 2 root   root  4096 Aug 16 17:02 .cache
drwxrwxr-x. 2 jovyan users 4096 Aug 16 17:04 .conda
drwsrws---. 3 jovyan users 4096 Jun 18 03:10 .config
drwsrws---. 2 jovyan users 4096 Jun 18 03:10 .jupyter
-rw-rw-r--. 1 jovyan users  807 Feb 25 12:03 .profile
drwsrwsr-x. 2 jovyan users 4096 Jun 18 03:05 work

Note fix-permissions $HOME only makes it group writeable, it doesn't fix the owner which is why I'm using chown instead.

drwxrwxr-x. 7 jovyan users 4096 Aug 16 17:08 .
drwxr-xr-x. 3 root   root  4096 Aug 16 17:08 ..
-rw-rw-r--. 1 jovyan users  220 Feb 25 12:03 .bash_logout
-rw-rw-r--. 1 jovyan users 3770 Jun 18 03:05 .bashrc
drwxrwx---. 3 root   users 4096 Aug 16 17:08 .cache
drwxrwxr-x. 2 jovyan users 4096 Aug 16 17:08 .conda
drwsrws---. 3 jovyan users 4096 Jun 18 03:10 .config
drwsrws---. 2 jovyan users 4096 Jun 18 03:10 .jupyter
-rw-rw-r--. 1 jovyan users  807 Feb 25 12:03 .profile
drwsrwsr-x. 2 jovyan users 4096 Jun 18 03:05 work
manics commented 4 years ago

I found another permissions problem on mybinder with /opt/install. I can't reproduce it with podman so maybe it's specific to Docker? The second commit should fix it.

Test here: https://mybinder.org/v2/gh/manics/jupyter-omeroanalysis-desktop/fix-perms?urlpath=desktop

nthiery commented 3 years ago

I confirm that the jupyter-omeroanalysis-desktop binder link still works. Which was helpful for me for testing purposes while I am trying to install jupyter-desktop-server on our local hub (as an aside: if this installation works, it will be a lifesaver next week for our remote teaching!)

Could this PR be merged / resolved?

yuvipanda commented 3 years ago

Thanks for the PR, @manics. And thanks for the nudge, @nthiery!

I've now added @manics to this repository as well, since this is really a generalization of his work :)