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

Merge pull request #32 from YunoHost-Apps/testing

Testing
This commit is contained in:
ljf (zamentur) 2021-04-11 19:15:41 +02:00 committed by GitHub
commit a6d63d0ec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -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.1.16~ynh2", "version": "1.1.16~ynh3",
"url": "https://borgbackup.readthedocs.io", "url": "https://borgbackup.readthedocs.io",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"maintainer": { "maintainer": {

View file

@ -17,6 +17,7 @@ install_borg_with_pip () {
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 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 /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

View file

@ -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 ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home
fi fi
# Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions...
if echo "$ssh_user" | grep -q ' '; then 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 fi
if echo "$public_key" | grep -q -v ' '; then if echo "$public_key" | grep -q -v ' '; then