diff --git a/scripts/backup b/scripts/backup index fbcba0e..636048c 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) +final_path_www=$(ynh_app_setting_get --app=$app --key=final_path_www) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -43,6 +44,8 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" +ynh_backup --src_path="$final_path_www" + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/remove b/scripts/remove index 6e108f3..1949f99 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,6 +22,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) secure_port=$(ynh_app_setting_get --app=$app --key=secure_port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +final_path_www=$(ynh_app_setting_get --app=$app --key=final_path_www) #================================================= # STANDARD REMOVE @@ -60,6 +61,8 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" +ynh_secure_remove --file="$final_path_www" + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 19cc22f..7e55b43 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) +final_path_www=$(ynh_app_setting_get --app=$app --key=final_path_www) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -40,6 +41,9 @@ ynh_script_progression --message="Validating restoration parameters..." --weight test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path_www \ + || ynh_die --message="There is already a directory: $final_path_www " + #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -63,11 +67,16 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$final_path_www" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +chmod 750 "$final_path_www" +chmod -R o-rwx "$final_path_www" +chown -R $app:www-data "$final_path_www" + #================================================= # SPECIFIC RESTORATION #=================================================