1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

Pre-upgrade script for chown + fixes

This commit is contained in:
Florent 2021-12-30 20:14:13 +01:00 committed by Florent F
parent 441755d9fb
commit 8366a5fa24
3 changed files with 14 additions and 8 deletions

View file

@ -1,4 +1,8 @@
; Test complet ; Test complet
; pre-upgrade
if [ "$FROM_COMMIT" == "04e1730ff642a2e48dfb533b2136fe90f9eaf133" ]; then
chmod -R o-rwx /var/www/garradin
fi
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/path" path="/path"
@ -12,8 +16,7 @@
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 upgrade=1 from_commit=7205455e0a806a49c48c6d2f005d80d1b74a3355
upgrade=1 from_commit=fc55308f7521310d5c339139339896bb59bd73cd upgrade=1 from_commit=04e1730ff642a2e48dfb533b2136fe90f9eaf133
upgrade=1 from_commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
change_url=1 change_url=1
@ -24,9 +27,6 @@ Notification=none
; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 ; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355
name=Previous version name=Previous version
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
; commit=fc55308f7521310d5c339139339896bb59bd73cd ; commit=04e1730ff642a2e48dfb533b2136fe90f9eaf133
name=Version 0.9.5 name=Version 1.0.6~ynh1
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
; commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56
name=Version 1.0.3~ynh2
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

View file

@ -71,7 +71,9 @@ find "$final_path" -type d -exec chmod 550 {} +
find "$final_path" -type f -exec chmod 440 {} + find "$final_path" -type f -exec chmod 440 {} +
find "$final_path/data" -type d -exec chmod 770 {} + find "$final_path/data" -type d -exec chmod 770 {} +
find "$final_path/data" -type f -exec chmod 660 {} + find "$final_path/data" -type f -exec chmod 660 {} +
chmod 660 "$final_path/config.local.php" chmod 440 "$final_path/config.local.php"
chmod 440 "$final_path/config.local.yunohost.php"
chmod 660 "$final_path/config.local.user.php"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION

View file

@ -259,6 +259,10 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=5 ynh_script_progression --message="Adding a configuration file..." --weight=5
if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; then
ynh_add_config --template="config.local.user.php" --destination="$final_path/config.local.user.php"
fi
ynh_add_config --template="config.local.php" --destination="$final_path/config.local.php" ynh_add_config --template="config.local.php" --destination="$final_path/config.local.php"
ynh_add_config --template="config.local.yunohost.php" --destination="$final_path/config.local.yunohost.php" ynh_add_config --template="config.local.yunohost.php" --destination="$final_path/config.local.yunohost.php"
# NOTE: Don't overwrite config.local.user.php # NOTE: Don't overwrite config.local.user.php