diff --git a/README.md b/README.md index c5828c2..193b7e9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Online storage, file sharing platform and various other applications -**Shipped version:** 22.2.2~ynh1 +**Shipped version:** 22.2.3~ynh1 **Demo:** https://demo.nextcloud.com/ diff --git a/README_fr.md b/README_fr.md index d384a90..d4fa816 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Stockage en ligne, plateforme de partage de fichiers et diverses autres applications -**Version incluse :** 22.2.2~ynh1 +**Version incluse :** 22.2.3~ynh1 **Démo :** https://demo.nextcloud.com/ diff --git a/manifest.json b/manifest.json index 40e16bf..f65f6d3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "22.2.2~ynh1", + "version": "22.2.3~ynh1", "url": "https://nextcloud.com", "upstream": { "license": "AGPL-3.0", diff --git a/scripts/backup b/scripts/backup index 1a1944a..4127420 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,6 +27,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -84,7 +85,7 @@ ynh_backup --src_path="/etc/cron.d/$app" #================================================= ynh_print_info --message="Backing up data directory..." -ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big +ynh_backup --src_path="$datadir" --is_big #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index f32d139..3ed8f22 100755 --- a/scripts/install +++ b/scripts/install @@ -130,9 +130,12 @@ ynh_add_nginx_config #================================================= # CREATE THE DATA DIRECTORY #================================================= +ynh_script_progression --message="Creating a data directory..." --weight=1 # Define app's data directory datadir="/home/yunohost.app/$app/data" +ynh_app_setting_set --app=$app --key=datadir --value=$datadir + # Create app folders mkdir -p "$datadir" diff --git a/scripts/remove b/scripts/remove index b84d5bf..024ed93 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # STANDARD REMOVE @@ -46,6 +47,17 @@ ynh_script_progression --message="Removing app main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index cbb84a0..425e580 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,6 +28,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -119,8 +120,6 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Restoring data directory..." --weight=2 -datadir="/home/yunohost.app/$app/data" - # Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup. ynh_restore_file --origin_path="$datadir" --not_mandatory diff --git a/scripts/upgrade b/scripts/upgrade index 0fe9107..bd5e14d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,6 +50,12 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# If datadir doesn't exist, create it +if [ -z "$datadir" ]; then + datadir=/home/yunohost.app/$app + ynh_app_setting_set --app=$app --key=datadir --value=$datadir +fi + # Remove the option backup_core_only if it's in the settings.yml file ynh_app_setting_delete --app=$app --key=backup_core_only diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c26aeae..b210a00 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available Nextcloud version -next_version="22.2.2" +next_version="22.2.3" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="943be7dbd375f4b866dcfd9821533ff39bebfd4d3ba91f8cf13905fc3fc64df0" +nextcloud_source_sha256="66a29a6a490738c0abedb677cb68c7c91fabab3e6419a3c99d8b406899eb942a"