diff --git a/manifest.json b/manifest.json index 52f7cde..a86c667 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Offer backup storage to a friend.", "fr": "Offrez un espace de stockage à un⋅e ami⋅e." }, - "version": "1.1.16~ynh2", + "version": "1.1.16~ynh3", "url": "https://borgbackup.readthedocs.io", "license": "BSD-3-Clause", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 6a33ffa..d9a3d50 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,6 +17,7 @@ install_borg_with_pip () { if [ ! -d /opt/borg-env ]; then python3 -m venv /opt/borg-env /opt/borg-env/bin/python /opt/borg-env/bin/pip install wheel + ynh_print_info --message="Installing/compiling borg, this may take some time..." /opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup[fuse]==$BORG_VERSION echo "#!/bin/bash /opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg diff --git a/scripts/upgrade b/scripts/upgrade index 54c5b50..902b165 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,8 +54,11 @@ if [ -f "/etc/yunohost/hooks.d/backup/17-data_home" ]; then ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home fi +# Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions... if echo "$ssh_user" | grep -q ' '; then - ynh_app_setting_set --app=$app --key=ssh_user --value="$(grep "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIadutuK2" /home/*/.ssh/authorized_keys | grep borg | cut -d/ -f3)" + ssh_user=$(grep "$ssh_user" /home/*/.ssh/authorized_keys | grep borg | cut -d/ -f3) + [ -n "$ssh_user" ] || ynh_die "Unable to retrieve ssh_user please fix /etc/yunohost/apps/$app/settings.yml manually :( !" + ynh_app_setting_set --app=$app --key=ssh_user --value="$ssh_user" fi if echo "$public_key" | grep -q -v ' '; then