From 3d5346f3ec6057ffab28207ed366bd2dce5a03a3 Mon Sep 17 00:00:00 2001 From: Moul Date: Mon, 2 May 2022 19:23:03 +0200 Subject: [PATCH] [fix] Add upgrade support datadir move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade from the state before the refactoring from 1.8.1~ynh0 to 1.8.2~ynh1 Move Duniter home directory to the YunoHost App path Check if the destination exists, meaning it’s not running < 1.8.1~ynh1 then run the datadir move Package_check: Add upgrade check from commit before the refactoring --- check_process | 2 +- scripts/upgrade | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index e5e6e8d..3bb4ffc 100644 --- a/check_process +++ b/check_process @@ -10,7 +10,7 @@ setup_private=0 setup_public=0 upgrade=1 - #upgrade=1 from_commit=CommitHash + upgrade=1 from_commit=b50d8bc6c1401fadfcf2de701ec490d7ec05b9f0 backup_restore=1 multi_instance=0 port_already_use=0 diff --git a/scripts/upgrade b/scripts/upgrade index 3b1cea5..a0f9261 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -96,6 +96,17 @@ tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture ynh_exec_warn_less dpkg -i $tempdir/duniter-server-v1.8.*-linux-*.deb +#================================================= +# MOVE DUNITER DIRECTORY +#================================================= +if [[ ! -d "${datadir}" ]]; then + ynh_script_progression --message="Moving data directory…" + mv /root/.config/duniter $datadir + chmod 750 "$datadir" + chmod -R o-rwx "$datadir" + chown -R $app:www-data "$datadir" +fi + #================================================= # UPDATE A CONFIG FILE #=================================================