From 62412d3980b2e1ebec633c26c6b374483349daa9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 17 Jun 2021 23:35:50 +0200 Subject: [PATCH] fix --- scripts/_common.sh | 1 + scripts/backup | 2 ++ scripts/install | 2 +- scripts/restore | 6 ++++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index de1680d..c0220ac 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,6 +3,7 @@ #================================================= # COMMON VARIABLES #================================================= + # dependencies used by the app pkg_dependencies="postgresql postgresql-contrib" diff --git a/scripts/backup b/scripts/backup index 199209a..17b62df 100755 --- a/scripts/backup +++ b/scripts/backup @@ -29,6 +29,7 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) +files_path=$(ynh_app_setting_get --app=$app --key=files_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -42,6 +43,7 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= ynh_backup --src_path="$final_path" +ynh_backup --src_path="$files_path" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 416b1a9..7c24650 100755 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,7 @@ files_path=/home/yunohost.app/$app ynh_app_setting_set --app=$app --key=files_path --value=$files_path mkdir -p $files_path/files -chown -R $app:$app $files_path +chown -R $app:www-data $files_path chmod -R 755 $files_path #================================================= diff --git a/scripts/restore b/scripts/restore index fedd8b4..911fcf5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +files_path=$(ynh_app_setting_get --app=$app --key=files_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) @@ -72,6 +73,11 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +ynh_restore_file --origin_path="$files_path" + +chown -R $app:www-data $files_path +chmod -R 755 $files_path + #================================================= # SPECIFIC RESTORATION #=================================================