From b4a88ccbf08f1cd4f02c0cdf941e992b65463881 Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 7 May 2021 19:24:28 +0200 Subject: [PATCH 1/2] [fix] Support 4.2 --- manifest.json | 4 ++-- scripts/install | 2 +- scripts/restore | 3 ++- scripts/upgrade | 7 +++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 12e10f4..6bb4e87 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~ynh4", + "version": "1.1.16~ynh5", "url": "https://borgbackup.readthedocs.io", "license": "BSD-3-Clause", "maintainer": { @@ -15,7 +15,7 @@ "url": "https://reflexlibre.net" }, "requirements": { - "yunohost": ">= 4.1.0" + "yunohost": ">= 4.2.3" }, "multi_instance": true, "services": [], diff --git a/scripts/install b/scripts/install index 984b315..19f41c5 100755 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ install_borg_with_pip #================================================= ynh_script_progression --message="Creating SSH user used by Borg..." -adduser $ssh_user --quiet --gecos ",,," --shell /bin/bash --disabled-password +ynh_system_user_create --username=$ssh_user --home_dir=/home/$ssh_user --use_shell --groups ssh.app #================================================= # AUTORIZE SSH FOR THIS USER diff --git a/scripts/restore b/scripts/restore index d0fa4ae..50fd626 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,9 @@ install_borg_with_pip #================================================= # CREATE SSH USER USED BY BORG #================================================= +ynh_script_progression --message="Creating SSH user used by Borg..." -adduser $ssh_user --quiet --gecos ",,," --shell /bin/bash --disabled-password +ynh_system_user_create --username=$ssh_user --home_dir=/home/$ssh_user --use_shell --groups ssh.app #================================================= # AUTORIZE SSH FOR THIS USER diff --git a/scripts/upgrade b/scripts/upgrade index fa5d421..009582a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,6 +77,13 @@ if [ ! -f "/opt/borg-env/$(ynh_get_debian_release)" ] ; then ynh_secure_remove /opt/borg-env fi +#================================================= +# CREATE SSH USER USED BY BORG +#================================================= +ynh_script_progression --message="Creating SSH user used by Borg..." + +ynh_system_user_create --username=$ssh_user --home_dir=/home/$ssh_user --use_shell --groups ssh.app + #================================================= # UPGRADE DEPENDENCIES #================================================= From af5f17351b67ea9d21a1a324fa1917e7add533ee Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 7 May 2021 19:29:23 +0200 Subject: [PATCH 2/2] [enh] Remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 4a4c3eb..bb5bf94 100755 --- a/scripts/remove +++ b/scripts/remove @@ -34,7 +34,7 @@ fi #================================================= # We keep files cause we don't know what the user want to do about # backups stored in the home directory -userdel $ssh_user +ynh_system_user_delete --username=$ssh_user #================================================= # REMOVE CRON FILES