From 7eba3a9f722b2dd28c7ac26178b71ff465db5390 Mon Sep 17 00:00:00 2001 From: Jules-Bertholet Date: Sat, 29 May 2021 20:12:17 +0000 Subject: [PATCH] Give Jupyter write access to its own files --- scripts/_common.sh | 8 +++----- scripts/install | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6143535..216cc8e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -16,19 +16,17 @@ jupyterlab_version="3.0.14" #================================================= function python_setup { - sudo chown -R $app: "$final_path" + set_permissions + pushd "$final_path" sudo -u $app PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true python3 -m pipenv install jupyterlab==$jupyterlab_version jupyterhub notebook jupyterhub-ldapauthenticator pyzmq --three 2>&1 sudo -u $app python3 -m pipenv run jupyterhub upgrade-db 2>&1 popd - - set_permissions } function set_permissions { # Set permissions to app files - chown -R root:$app "$final_path" - chown -R $app:$app "$final_path/.venv" + chown -R $app:$app "$final_path" chmod -R g=u,g-w,o-rwx "$final_path" } diff --git a/scripts/install b/scripts/install index 9c706b7..a33a38e 100644 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/$app +final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path