mirror of
https://github.com/YunoHost-Apps/borg_ynh.git
synced 2024-09-03 18:16:05 +02:00
[fix] Install process was broken
This commit is contained in:
parent
bae5b36e7b
commit
09d5463b90
4 changed files with 18 additions and 45 deletions
|
@ -6,7 +6,7 @@
|
||||||
"en": "Backup your server on a host server using Borg.",
|
"en": "Backup your server on a host server using Borg.",
|
||||||
"fr": "Sauvegardez votre serveur sur un serveur distant avec Borg."
|
"fr": "Sauvegardez votre serveur sur un serveur distant avec Borg."
|
||||||
},
|
},
|
||||||
"version": "1.1.15~ynh2",
|
"version": "1.1.16~ynh1",
|
||||||
"url": "https://borgbackup.readthedocs.io",
|
"url": "https://borgbackup.readthedocs.io",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
"fr": "Dans quel repo borg souhaitez-vous sauvegarder vos fichiers ?"
|
"fr": "Dans quel repo borg souhaitez-vous sauvegarder vos fichiers ?"
|
||||||
},
|
},
|
||||||
"help":{
|
"help":{
|
||||||
"en": "Specify a remote repository using this format: ssh://USER@DOMAIN.TLD:PORT/~/backup . "USER" is *not* meant to be an existing user on the guest server. Instead, it will be created *on the host server* during the installation of the Borg Server App. It's also possible to use a local repository using a syntax such as /mount/my_external_harddrive/backups"
|
"en": "Specify a remote repository using this format: ssh://USER@DOMAIN.TLD:PORT/~/backup . \"USER\" is *not* meant to be an existing user on the guest server. Instead, it will be created *on the host server* during the installation of the Borg Server App. It's also possible to use a local repository using a syntax such as /mount/my_external_harddrive/backups"
|
||||||
},
|
},
|
||||||
"example": "ssh://john@serverb.tld:22/~/backup"
|
"example": "ssh://john@serverb.tld:22/~/backup"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
# App package root directory should be the parent folder
|
# App package root directory should be the parent folder
|
||||||
PKG_DIR=$(cd ../; pwd)
|
PKG_DIR=$(cd ../; pwd)
|
||||||
BORG_VERSION=1.1.15
|
BORG_VERSION=1.1.16
|
||||||
|
|
||||||
pkg_dependencies="python3-pip python3-dev libacl1-dev libssl-dev liblz4-dev python3-jinja2 python3-setuptools python-virtualenv virtualenv libfuse-dev pkg-config"
|
pkg_dependencies="python3-pip python3-dev libacl1-dev libssl-dev liblz4-dev python3-jinja2 python3-setuptools python-virtualenv virtualenv libfuse-dev pkg-config"
|
||||||
|
|
||||||
|
@ -16,12 +16,11 @@ install_borg_with_pip () {
|
||||||
fi
|
fi
|
||||||
if [ ! -d /opt/borg-env ]; then
|
if [ ! -d /opt/borg-env ]; then
|
||||||
python3 -m venv /opt/borg-env
|
python3 -m venv /opt/borg-env
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/pip install wheel
|
||||||
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup[fuse]==$BORG_VERSION
|
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup[fuse]==$BORG_VERSION
|
||||||
echo "#!/bin/bash
|
echo "#!/bin/bash
|
||||||
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
|
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
|
||||||
if is_buster; then
|
touch "/opt/borg-env/$(ynh_get_debian_release)"
|
||||||
touch /opt/borg-env/buster
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
# We need this to be executable by other borg apps
|
# We need this to be executable by other borg apps
|
||||||
chmod a+x /usr/local/bin/borg
|
chmod a+x /usr/local/bin/borg
|
||||||
|
@ -55,7 +54,16 @@ ynh_save_args () {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args
|
||||||
|
|
||||||
|
# Send an email to inform the administrator
|
||||||
|
#
|
||||||
|
# usage: ynh_send_readme_to_admin app_message [recipients]
|
||||||
|
# | arg: -m --app_message= - The message to send to the administrator.
|
||||||
|
# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root
|
||||||
|
# example: "root admin@domain"
|
||||||
|
# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you
|
||||||
|
# example: "root admin@domain user1 user2"
|
||||||
|
|
||||||
# Send an email to inform the administrator
|
# Send an email to inform the administrator
|
||||||
#
|
#
|
||||||
|
@ -113,36 +121,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
|
||||||
# Send the email to the recipients
|
# Send the email to the recipients
|
||||||
echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
|
echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ynh_debian_release () {
|
|
||||||
lsb_release --codename --short
|
|
||||||
}
|
|
||||||
|
|
||||||
is_buster () {
|
|
||||||
if [ "$(ynh_debian_release)" == "buster" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
is_stretch () {
|
|
||||||
if [ "$(ynh_debian_release)" == "stretch" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
is_jessie () {
|
|
||||||
if [ "$(ynh_debian_release)" == "jessie" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ yunohost app install https://github.com/YunoHost-Apps/borgserver_ynh -a \"ssh_us
|
||||||
|
|
||||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/borg_ynh"
|
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/borg_ynh"
|
||||||
|
|
||||||
ynh_send_readme_to_admin "$message" "root"
|
ynh_send_readme_to_admin "$message"
|
||||||
ynh_print_ON
|
ynh_print_ON
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -69,12 +69,10 @@ fi
|
||||||
# Replace backports with pip
|
# Replace backports with pip
|
||||||
[ ! -e " /etc/apt/sources.list.d/$app-stretch-backports.list" ] || rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
|
[ ! -e " /etc/apt/sources.list.d/$app-stretch-backports.list" ] || rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
|
||||||
|
|
||||||
# Reinstall borg if stretch -> buster migration
|
# Reinstall borg if debian change of major version
|
||||||
if is_buster; then
|
if [ ! -f "/opt/borg-env/$(ynh_get_debian_release)" ] ; then
|
||||||
if [ ! -f /opt/borg-env/buster ] ; then
|
|
||||||
ynh_secure_remove /opt/borg-env
|
ynh_secure_remove /opt/borg-env
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
|
|
Loading…
Add table
Reference in a new issue