diff --git a/scripts/_common.sh b/scripts/_common.sh index 8db757b..94a4ed2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -59,7 +59,7 @@ install_dependance() { } set_permission() { - chown -R $YNH_APP_ID:$YNH_APP_ID $install_dir + chown -R $app:$app $install_dir chmod -R u+rwX,g-wx,o= $install_dir setfacl -m user:www-data:rX $install_dir setfacl -m user:www-data:rX $install_dir/seafile-server-$seafile_version @@ -69,9 +69,9 @@ set_permission() { test -e $install_dir/seahub-data && setfacl -R -m user:www-data:rX $install_dir/seahub-data find $data_dir \( \! -perm -o= \ - -o \! -user $YNH_APP_ID \ - -o \! -group $YNH_APP_ID \) \ - -exec chown $YNH_APP_ID:$YNH_APP_ID {} \; \ + -o \! -user $app \ + -o \! -group $app \) \ + -exec chown $app:$app {} \; \ -exec chmod o= {} \; } diff --git a/scripts/install b/scripts/install index e4f59c9..11cee59 100644 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ set_permission ynh_replace_special_string --match_string 'seafile_config.seafile_dir = seafile_config.validate_seafile_dir(seafile_dir)' \ --replace_string 'seafile_config.seafile_dir = seafile_dir' \ --target_file $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.py -sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh auto \ +sudo -u $app bash $install_dir/seafile-server-$seafile_version/setup-seafile-mysql.sh auto \ --server-name "$server_name" \ --server-ip $domain \ --fileserver-port $port_fileserver \ diff --git a/scripts/upgrade b/scripts/upgrade index 082aa56..d8cac23 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,12 +109,12 @@ case $installed_version in "7.0"* ) # Fix file comment pushd $install_dir/seafile-server-$seafile_version - sudo -u $YNH_APP_ID $install_dir/seafile-server-$seafile_version/seahub.sh python-env python3 seahub/manage.py migrate_file_comment + sudo -u $app $install_dir/seafile-server-$seafile_version/seahub.sh python-env python3 seahub/manage.py migrate_file_comment popd # Update seafile by script ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.0_7.1.sh # Fix seafile data link. Look like that the upgrade script of seafile don't always work correctly if [ -e $install_dir/seafile-data ]; then @@ -125,16 +125,16 @@ case $installed_version in ;& "7.1."* ) ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_8.0_9.0.sh ;& "8.0."* ) ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh - sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh + sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/upgrade_7.1_8.0.sh ;& esac ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file=$install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh -sudo -u $YNH_APP_ID bash $install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh +sudo -u $app bash $install_dir/seafile-server-$seafile_version/upgrade/minor-upgrade.sh # Clean url in config in DB clean_url_in_db_config