Use $app instead of $YNH_APP_ID

This commit is contained in:
Josué Tille 2023-12-18 14:34:09 +01:00
parent fa4be60b7d
commit 5bc7abe779
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
3 changed files with 10 additions and 10 deletions

View file

@ -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= {} \;
}

View file

@ -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 \

View file

@ -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