From 9fad372003232b568ec0903eb57aedc2fb6bcbe0 Mon Sep 17 00:00:00 2001 From: Jules-Bertholet Date: Sat, 29 May 2021 19:44:04 +0000 Subject: [PATCH] Change permissions temporarily during python setup step --- scripts/_common.sh | 5 ++++- scripts/upgrade | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5066720..6143535 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -16,10 +16,13 @@ jupyterlab_version="3.0.14" #================================================= function python_setup { + sudo chown -R $app: "$final_path" 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 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 { diff --git a/scripts/upgrade b/scripts/upgrade index 90dc9e8..085b035 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,7 +38,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." # If final_path doesn't exist, create it if [ -z "$final_path" ]; then - final_path=/opt/$app + final_path=/opt/yunohost/$app mkdir -p $final_path