1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00

[fix] SSH key not registered correctly

This commit is contained in:
ljf 2020-02-27 18:22:07 +01:00
parent 6d18b6bfd4
commit ebb5184638
3 changed files with 21 additions and 7 deletions

View file

@ -6,7 +6,7 @@
"en": "Offer backup storage to a friend.",
"fr": "Offrez un espace de stockage à un⋅e ami⋅e."
},
"version": "1.1.10~ynh3",
"version": "1.1.10~ynh4",
"url": "https://borgbackup.readthedocs.io",
"license": "BSD-3-Clause",
"maintainer": {

View file

@ -26,7 +26,7 @@ ynh_export () {
local ynh_arg=""
for var in $@;
do
ynh_arg=$(echo $var | awk '{print toupper($0)}')
ynh_arg=$(echo "$var" | awk '{print toupper($0)}')
if [ "$var" == "path_url" ]; then
ynh_arg="PATH"
fi
@ -43,7 +43,7 @@ ynh_save_args () {
if [ "$var" == "path_url" ]; then
setting_var="path"
fi
ynh_app_setting_set $app $setting_var ${!var}
ynh_app_setting_set $app $setting_var "${!var}"
done
}

View file

@ -14,6 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
app=$YNH_APP_INSTANCE_NAME
ssh_user=$(ynh_app_setting_get --app=$app --key=ssh_user)
#=================================================
# CHECK IF AN UPGRADE IS NEEDED
@ -33,8 +34,21 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
# Replace backports with pip
rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
install_borg_with_pip
ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
if [ -f "/etc/apt/sources.list.d/$app-stretch-backports.list" ]; then
rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
install_borg_with_pip
fi
if [ -f "/etc/yunohost/hooks.d/backup/17-data_home" ]; then
ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home
fi
if echo "$ssh_user" | grep -v ' '; then
ynh_app_setting_set --app=$app --key=ssh_user --value="$(grep -Po 'no-user-rc \K.*$' /home/$ssh_user/.ssh/authorized_keys)"
fi