mirror of
https://github.com/YunoHost-Apps/borgserver_ynh.git
synced 2024-09-03 20:36:20 +02:00
[fix] Remove backports (#9)
* [fix] Remove backports * [fix] Upgrade don't forget to install pip borg package
This commit is contained in:
parent
132431ef3f
commit
2cb38b3183
5 changed files with 30 additions and 20 deletions
|
@ -6,7 +6,7 @@
|
||||||
"en": "Offer backup storage to a friend.",
|
"en": "Offer backup storage to a friend.",
|
||||||
"fr": "Offrez un espace de stockage à un⋅e ami⋅e."
|
"fr": "Offrez un espace de stockage à un⋅e ami⋅e."
|
||||||
},
|
},
|
||||||
"version": "1.0.1",
|
"version": "1.1.10~ynh1",
|
||||||
"url": "https://borgbackup.readthedocs.io",
|
"url": "https://borgbackup.readthedocs.io",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -116,10 +116,6 @@ ynh_check_app_version_changed () {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ynh_install_backports () {
|
|
||||||
echo "deb http://httpredir.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/$app-stretch-backports.list
|
|
||||||
}
|
|
||||||
|
|
||||||
ynh_remove_backports () {
|
ynh_remove_backports () {
|
||||||
rm /etc/apt/sources.list.d/$app-stretch-backports.list
|
rm /etc/apt/sources.list.d/$app-stretch-backports.list
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,16 +30,17 @@ ynh_export ssh_user public_key quota
|
||||||
ynh_save_args ssh_user public_key quota
|
ynh_save_args ssh_user public_key quota
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE BACKPORTS
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
|
||||||
# We need borg 1.1+ available only in backports
|
|
||||||
ynh_install_backports
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STORE SETTINGS FROM MANIFEST
|
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_package_install -t stretch-backports borgbackup
|
|
||||||
|
if [ ! -d /opt/borg-env ]; then
|
||||||
|
virtualenv --python=python3 /opt/borg-env
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup
|
||||||
|
echo "#!/bin/bash
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
|
||||||
|
chmod u+x /usr/local/bin/borg
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE SSH USER USED BY BORG
|
# CREATE SSH USER USED BY BORG
|
||||||
|
|
|
@ -31,17 +31,18 @@ export ssh_user=$(ynh_app_setting_get $app ssh_user)
|
||||||
export public_key=$(ynh_app_setting_get $app public_key)
|
export public_key=$(ynh_app_setting_get $app public_key)
|
||||||
export quota=$(ynh_app_setting_get $app quota)
|
export quota=$(ynh_app_setting_get $app quota)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CONFIGURE BACKPORTS
|
|
||||||
#=================================================
|
|
||||||
# We need borg 1.1+ available only in backports
|
|
||||||
ynh_install_backports
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_package_install -t stretch-backports borgbackup
|
|
||||||
|
if [ ! -d /opt/borg-env ]; then
|
||||||
|
virtualenv --python=python3 /opt/borg-env
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup
|
||||||
|
echo "#!/bin/bash
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
|
||||||
|
chmod u+x /usr/local/bin/borg
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE SSH USER USED BY BORG
|
# CREATE SSH USER USED BY BORG
|
||||||
|
|
|
@ -33,3 +33,15 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
# Replace backports with pip
|
||||||
|
if is_stretch; then
|
||||||
|
ynh_remove_backports
|
||||||
|
|
||||||
|
if [ ! -d /opt/borg-env ]; then
|
||||||
|
virtualenv --python=python3 /opt/borg-env
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup
|
||||||
|
echo "#!/bin/bash
|
||||||
|
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
|
||||||
|
chmod u+x /usr/local/bin/borg
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue