From fc6d25f4b4942e2a08e95b5cbf4389644e5691a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 7 May 2019 21:52:43 +0200 Subject: [PATCH] Install moviepy in user mode --- scripts/_common.sh | 6 +++++- scripts/install | 8 ++++---- scripts/restore | 8 ++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index fb8074f..3a686ad 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -60,7 +60,11 @@ install_source() { install_dependance() { ynh_install_app_dependencies python2.7 python-pip libpython2.7 python-setuptools python-ldap python-urllib3 python-simplejson python-imaging python-mysqldb python-flup expect python-requests python-dev ffmpeg python-memcache \ libjpeg62-turbo-dev zlib1g-dev # For building pillow - pip install --upgrade Pillow 'moviepy<1.0' + if [[ "$seafile_user" == seafile ]] && [[ "$final_path" == "/opt/yunohost/$app" ]] ; then + sudo -u $seafile_user pip install --user --upgrade Pillow 'moviepy<1.0' + else + pip install --upgrade Pillow 'moviepy<1.0' + fi } ynh_clean_setup () { diff --git a/scripts/install b/scripts/install index 4e3a970..0a01a4e 100644 --- a/scripts/install +++ b/scripts/install @@ -63,6 +63,9 @@ admin_email=$(yunohost user info $admin | grep mail: | sed "s/mail: //g") # STANDARD MODIFICATIONS #================================================= +# Create User +ynh_system_user_create $seafile_user $final_path + # Check dependencies install_dependance @@ -84,9 +87,6 @@ ynh_mysql_create_db ccnetdb "$dbuser" "$db_pwd" ynh_mysql_create_db seafiledb "$dbuser" "$db_pwd" ynh_mysql_create_db seahubdb "$dbuser" "$db_pwd" -# Create User -ynh_system_user_create $seafile_user $final_path - # Run install script chmod +x expect_scripts/install.exp chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh @@ -194,4 +194,4 @@ sleep 2 pkill -f seafile-controller || true pkill -f seaf-server || true -system_reload seafile-server start \ No newline at end of file +system_reload seafile-server start diff --git a/scripts/restore b/scripts/restore index de8c7c9..deda404 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,9 +27,6 @@ ynh_webpath_available $domain $path_url || ynh_die "$domain/$path_url is not ava # STANDARD RESTORATION STEPS #================================================= -# Restore dependencies -install_dependance - # Restore all config and data ynh_restore @@ -39,6 +36,9 @@ get_configuration # Create user if it need [[ $seafile_user = "seafile" ]] && ynh_system_user_create $seafile_user $final_path +# Restore dependencies +install_dependance + # Restore mysql dump dbuser=seafile ynh_mysql_create_db ccnetdb "$dbuser" "$db_pwd" @@ -77,4 +77,4 @@ update-rc.d seafile-server defaults sleep 5 # Restart service -system_reload seafile-server start \ No newline at end of file +system_reload seafile-server start