diff --git a/scripts/restore b/scripts/restore index 094eb13..3c3a96b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +70,17 @@ fi # Remove the option backup_core_only if it's in the settings.yml file ynh_app_setting_delete "$app" backup_core_only +code_migration=$(ynh_app_setting_get "$app" code_migration) + +# make sure we revert the last code organization +if [ "$code_migration" -eq 1 ] +then + mv "$final_path/code/"* "$final_path" + mv "$final_path/media" "$final_path/code/data/media" + mv "$final_path/import" "$final_path/code/data/music" + ynh_secure_remove "$final_path/code" +fi + #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -85,7 +96,7 @@ ynh_system_user_create "$app" ynh_install_app_dependencies build-essential curl ffmpeg \ libjpeg-dev libmagic-dev libpq-dev postgresql python3-dev python3-venv \ - redis-server \ + redis-server libldap2-dev libsasl2-dev \ `# add arm support` \ zlib1g-dev libffi-dev libssl-dev diff --git a/scripts/upgrade b/scripts/upgrade index 74f64ec..b95cc56 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,6 +41,7 @@ if [ ! -d "$final_path/code/" ]; then mv "$final_path/!(code)" "$final_path/code/" mv "$final_path/code/data/media" "$final_path/media" mv "$final_path/code/data/music" "$final_path/import" + ynh_app_setting_set "$app" code_migration 1 fi #================================================= @@ -119,7 +120,7 @@ ynh_system_user_create "$app" ynh_install_app_dependencies build-essential curl ffmpeg \ libjpeg-dev libmagic-dev libpq-dev postgresql python3-dev python3-venv \ - redis-server \ + redis-server libldap2-dev libsasl2-dev \ `# add arm support` \ zlib1g-dev libffi-dev libssl-dev @@ -231,8 +232,15 @@ then # makes sure no SSO credentials to be passed ynh_app_setting_set "$app" skipped_uris "/" fi + #================================================= # RELOAD NGINX #================================================= -systemctl reload nginx \ No newline at end of file +systemctl reload nginx + +#================================================= +# REMOVE CODE MIGRATION FLAG +#================================================= + +ynh_app_setting_delete "$app" code_migration \ No newline at end of file