mirror of
https://github.com/YunoHost-Apps/jupyterlab_ynh.git
synced 2024-09-03 19:26:35 +02:00
Fix permissions
This commit is contained in:
parent
358805a003
commit
23f8695b95
4 changed files with 19 additions and 18 deletions
|
@ -15,6 +15,20 @@ jupyterlab_version="3.0.14"
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
function python_setup {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_permissions {
|
||||||
|
# Set permissions to app files
|
||||||
|
chown -R root:$app "$final_path"
|
||||||
|
chown -R $app:$app "$final_path/.venv"
|
||||||
|
chmod -R g=u,g-w,o-rwx "$final_path"
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -94,11 +94,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
|
|
||||||
mkdir -p $final_path
|
mkdir -p $final_path
|
||||||
|
|
||||||
pushd $final_path
|
python_setup
|
||||||
|
|
||||||
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install jupyterlab==$jupyterlab_version jupyterhub notebook jupyterhub-ldapauthenticator pyzmq --three
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -147,8 +143,7 @@ ynh_add_config --template="../conf/jupyter_notebook_config.py" --destination="$f
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R root: $final_path/
|
set_permissions
|
||||||
chown -R $admin: $final_path/.venv/
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
|
|
@ -70,8 +70,7 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Restore permissions on app files
|
# Restore permissions on app files
|
||||||
chown -R root: $final_path/
|
set_permissions
|
||||||
chown -R $admin: $final_path/.venv/
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
|
|
@ -117,13 +117,7 @@ then
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
mkdir -p $final_path
|
mkdir -p $final_path
|
||||||
|
|
||||||
pushd $final_path
|
python_setup
|
||||||
|
|
||||||
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install jupyterlab==$jupyterlab_version jupyterhub notebook jupyterhub-ldapauthenticator pyzmq
|
|
||||||
|
|
||||||
ynh_exec_warn_less python3 -m pipenv run jupyterhub upgrade-db
|
|
||||||
|
|
||||||
popd
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -157,8 +151,7 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown -R root: $final_path/
|
set_permissions
|
||||||
chown -R $admin: $final_path/.venv/
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
|
Loading…
Add table
Reference in a new issue