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

Ensure the user subdirectory has proper rights #207

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tljh-plasma/tljh_plasma/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import grp
import os
import pwd
import shutil

from dockerspawner import SystemUserSpawner
from jupyterhub.auth import PAMAuthenticator
Expand Down Expand Up @@ -59,6 +60,7 @@ async def start(self, *args, **kwargs):
# create the user directory on the host if it does not exist
volume_path = os.path.join(user_home, display_name)
os.makedirs(volume_path, exist_ok=True)
shutil.chown(volume_path, username, username)

# the escaped environment name is used to create a new folder in the user home directory
home = os.path.abspath(os.path.join(user_home, os.path.pardir))
Expand Down