From f3e044a7d6fb489933e7c174afecd1ced9137d71 Mon Sep 17 00:00:00 2001 From: Olivier Berger Date: Wed, 29 May 2024 11:41:16 +0200 Subject: [PATCH 01/22] Fix typo in README.md Tiny typo fix. Hth --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8c919c..6568c3f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency From e983d815f9d07075c11813ac187d536797ea9a39 Mon Sep 17 00:00:00 2001 From: Olivier Berger Date: Wed, 29 May 2024 18:27:51 +0200 Subject: [PATCH 02/22] Tiny typo fix in DESCRIPTION.md Editing the root cause of the typo --- doc/DESCRIPTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 07e01d2..08b2fca 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -4,7 +4,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency From dbee3a50332cc9755b436c4cc116c1cacf6a6cc1 Mon Sep 17 00:00:00 2001 From: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:46:59 -0500 Subject: [PATCH 03/22] Update backup-with-borg Fix mail encoding and typos --- conf/backup-with-borg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/backup-with-borg b/conf/backup-with-borg index 0912891..466edd6 100644 --- a/conf/backup-with-borg +++ b/conf/backup-with-borg @@ -60,7 +60,7 @@ for application in $(sudo ls /etc/yunohost/apps/); do done #========================================================= -# SEND MAIL TO NOTIFY SUCCED OR FAILED OPERATIONS +# SEND MAIL TO NOTIFY ABOUT SUCCEEDED OR FAILED OPERATIONS #========================================================= partial_errors="$(cat "$log_file" | grep -E "Error|Skipped")" @@ -79,9 +79,9 @@ else fi if [[ -n "$errors" && $mailalert != "never" ]]; then - cat <(echo -e "$errors\n\n\n") "$log_file" "$err_file" | mail -s "[borg] Backup failed from $domain onto $repository" root + cat <(echo -e "$errors\n\n\n") "$log_file" "$err_file" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "[borg] Backup failed from $domain onto $repository" root exit 1 elif [ "$mailalert" == "always" ]; then - cat "$log_file" | mail -s "[borg] Backup succeed from $domain onto $repository" root + cat "$log_file" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "[borg] Backup succeeded from $domain onto $repository" root exit 0 fi From 0a4ea21bebda2ac13f471970c728f1571bbe3601 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 10 Jun 2024 16:56:42 +0000 Subject: [PATCH 04/22] Auto-update READMEs --- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README_es.md b/README_es.md index 097e3cd..28abf9f 100644 --- a/README_es.md +++ b/README_es.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency diff --git a/README_eu.md b/README_eu.md index 4ca632f..c77570e 100644 --- a/README_eu.md +++ b/README_eu.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency diff --git a/README_fr.md b/README_fr.md index 494ac91..f05b46d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency diff --git a/README_gl.md b/README_gl.md index 8b4dc22..ce6a53d 100644 --- a/README_gl.md +++ b/README_gl.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency diff --git a/README_zh_Hans.md b/README_zh_Hans.md index ae401a3..304fe41 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -22,7 +22,7 @@ This app is the "client" part, meant to be installed on the server to be backed ### Features -- Backup on a remote machine, in comination with the [borg server app](https://apps.yunohost.org/app/borgserver) +- Backup on a remote machine, in combination with the [borg server app](https://apps.yunohost.org/app/borgserver) - ... or on a [commercial borg service](https://www.borgbackup.org/support/commercial.html) - Backups are encrypted (the remote server can't read the content) and deduplicated (optimize space) - Backups are ran automatically, you can choose when and at which frequency From 30aa65c7efdcdbf806eb636ea68caeb97a125a71 Mon Sep 17 00:00:00 2001 From: Mateusz <2871798+orhtej2@users.noreply.github.com> Date: Fri, 24 May 2024 00:36:33 +0200 Subject: [PATCH 05/22] Create 1.2.8.md --- doc/POST_UPGRADE.d/1.2.8.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/POST_UPGRADE.d/1.2.8.md diff --git a/doc/POST_UPGRADE.d/1.2.8.md b/doc/POST_UPGRADE.d/1.2.8.md new file mode 100644 index 0000000..1041730 --- /dev/null +++ b/doc/POST_UPGRADE.d/1.2.8.md @@ -0,0 +1,7 @@ +[Borg pre-version 1.2.5 had CVE in archive format](https://github.com/borgbackup/borg/blob/1.2.8/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811). One liner to check if you're affected is: + +```sh +sudo env BORG_RSH="ssh -i /root/.ssh/id___APP___ed25519 -oStrictHostKeyChecking=yes " BORG_PASSPHRASE="$(sudo yunohost app setting __APP__ passphrase)" BORG_RELOCATED_REPO_ACCESS_IS_OK=yes BORG_REPO="$(sudo yunohost app setting __APP__ repository)" __INSTALL_DIR__/venv/bin/borg upgrade --show-rc --check-tam $BORG_REPO +``` + +Consult the linked documentation on how to interpret the result. From 4fba0e04de0a2fbff7f05311fc41bc42041dab77 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:59:07 +0200 Subject: [PATCH 06/22] Update manifest.toml: lack of permissions block ends up in the config panel being broken because the webadmin wants a label? --- manifest.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifest.toml b/manifest.toml index b91c260..05c4eb8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -81,6 +81,8 @@ ram.runtime = "50M" [resources.install_dir] + [resources.permissions] + [resources.apt] packages = [ "python3-pip", From d866d0fcaff69a0d2f41ff8d7ab3634515fb7965 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 20:06:39 +0200 Subject: [PATCH 07/22] add logging conf --- conf/logging.conf | 23 +++++++++++++++++++++++ scripts/install | 5 ++++- scripts/upgrade | 5 ++++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 conf/logging.conf diff --git a/conf/logging.conf b/conf/logging.conf new file mode 100644 index 0000000..7739e4f --- /dev/null +++ b/conf/logging.conf @@ -0,0 +1,23 @@ +[loggers] +keys=root + +[handlers] +keys=logfile + +[formatters] +keys=logfile + +[logger_root] +level=NOTSET +handlers=logfile + +[handler_logfile] +class=FileHandler +level=INFO +formatter=logfile +args=('/var/log/__APP__/borg.log', 'a') + +[formatter_logfile] +format=%(asctime)s %(levelname)s %(message)s +datefmt= +class=logging.Formatter diff --git a/scripts/install b/scripts/install index 57da313..2adbf74 100755 --- a/scripts/install +++ b/scripts/install @@ -71,6 +71,9 @@ chown "$app:$app" "$install_dir/backup-with-borg" ynh_add_config --template="sudoer" --destination="/etc/sudoers.d/$app" chown root:root "/etc/sudoers.d/$app" +ynh_add_config --template="logging.conf" --destination="$install_dir/logging.conf" +chown "$app:$app" "$install_dir/logging.conf" + #================================================= # SYSTEM CONFIGURATION #================================================= @@ -78,7 +81,7 @@ ynh_script_progression --message="Adding system configurations related to $app.. # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" +yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" --log "/var/log/$app/borg.log" # Disable the service, this is to prevent the service from being triggered at boot time systemctl disable $app.service --quiet diff --git a/scripts/upgrade b/scripts/upgrade index 93a6039..1ddafe9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,6 +93,9 @@ chown "$app:$app" "$install_dir/backup-with-borg" ynh_add_config --template="sudoer" --destination="/etc/sudoers.d/$app" chown root:root "/etc/sudoers.d/$app" +ynh_add_config --template="logging.conf" --destination="$install_dir/logging.conf" +chown "$app:$app" "$install_dir/logging.conf" + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -100,7 +103,7 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" +yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" --log "/var/log/$app/borg.log" # Disable the service, this is to prevent the service from being triggered at boot time systemctl disable $app.service --quiet From 9c033bf31f636016d8f0f8499de4c60c3f81b478 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 20:07:07 +0200 Subject: [PATCH 08/22] backup/restore backup-with-borg and logging files --- scripts/backup | 3 +++ scripts/restore | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/scripts/backup b/scripts/backup index 964f5d9..1a8036e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -22,6 +22,9 @@ ynh_backup --src_path="/etc/sudoers.d/$app" ynh_backup --src_path="/root/.ssh/id_${app}_ed25519" --not_mandatory ynh_backup --src_path="/root/.ssh/id_${app}_ed25519.pub" --not_mandatory +ynh_backup --src_path="$install_dir/backup-with-borg" +ynh_backup --src_path="$install_dir/logging.conf" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 7f7831c..4738f2c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,6 +37,13 @@ chmod go=--- "/etc/yunohost/hooks.d/backup_method/05-${app}_app" ynh_restore_file --origin_path="/etc/sudoers.d/$app" chown root:root "/etc/sudoers.d/$app" +ynh_restore_file --origin_path="$install_dir/backup-with-borg" +chmod u+x "$install_dir/backup-with-borg" +chown "$app:$app" "$install_dir/backup-with-borg" + +ynh_restore_file --origin_path="$install_dir/logging.conf" +chown "$app:$app" "$install_dir/logging.conf" + #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= From 014972b8109f35a911ec644484ef50bb0823c02c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 20:09:16 +0200 Subject: [PATCH 09/22] use env var BORG_REPO and BORG_LOGGING_CONF to manage repo and logs --- conf/backup_method | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/conf/backup_method b/conf/backup_method index 0d9540f..c314628 100644 --- a/conf/backup_method +++ b/conf/backup_method @@ -5,7 +5,8 @@ borg="__INSTALL_DIR__/venv/bin/borg" app="__APP__" BORG_PASSPHRASE="$(yunohost app setting "$app" passphrase)" -repo="$(yunohost app setting "$app" repository)" #$4 +BORG_REPO="$(yunohost app setting "$app" repository)" +BORG_LOGGING_CONF="__INSTALL_DIR__/logging.conf" if ssh-keygen -F "__SERVER__" >/dev/null ; then BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes " @@ -17,22 +18,16 @@ do_need_mount() { true } -LOGFILE=/var/log/backup_borg.err -log_with_timestamp() { - sed -e "s/^/[$(date +"%Y-%m-%d_%H:%M:%S")] /" | tee -a $LOGFILE -} - do_backup() { export BORG_PASSPHRASE + export BORG_REPO export BORG_RSH + export BORG_LOGGING_CONF export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes work_dir="$1" name="$2" - repo="$3" - size="$4" - description="$5" - current_date=$(date +"%Y-%m-%d_%H:%M") - pushd "$work_dir" + size="$3" + description="$4" set +e if "$borg" init -e repokey "$repo" ; then # human_size=`echo $size | awk '{ suffix=" KMGT"; for(i=1; $1>1024 && i < length(suffix); i++) $1/=1024; print int($1) substr(suffix, i, 1), $3; }'` @@ -41,35 +36,38 @@ do_backup() { # evaluated_time=$(($size / ($speed * 1000 / 8) / 3600)) echo "Hello, -Your first backup on $repo is starting. +Your first backup on $BORG_REPO is starting. This is an automated message from your beloved YunoHost server." | /usr/bin/mail.mailutils -a "Content-Type: text/plain; charset=UTF-8" -s "[YNH] First backup is starting" "root" fi set -e - "$borg" create "$repo::_${name}-${current_date}" ./ 2>&1 >/dev/null | log_with_timestamp - popd + # About the {now} placeholder: + # https://borgbackup.readthedocs.io/en/stable/usage/create.html#description + # In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. + "$borg" create "::_${name}-{now}" "$work_dir" # About thi _20 it's a crazy fix to avoid pruning wordpress__2 # if you prune wordpress - "$borg" prune "$repo" -P "_${name}-" --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 2>&1 >/dev/null | log_with_timestamp + "$borg" prune -P "_${name}-" --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 # Prune legacy archive name without error on wordpress/wordpress__2 - "$borg" prune "$repo" -P "${name}_" --keep-within 2m --keep-monthly=12 2>&1 >/dev/null | log_with_timestamp + "$borg" prune -P "${name}_" --keep-within 2m --keep-monthly=12 # We prune potential manual backup older than 1 year - "$borg" prune "$repo" --keep-within 1y 2>&1 >/dev/null | log_with_timestamp + "$borg" prune --keep-within 1y } do_mount() { export BORG_PASSPHRASE + export BORG_REPO export BORG_RSH + export BORG_LOGGING_CONF work_dir="$1" name="$2" - repo="$3" - size="$4" - description="$5" - "$borg" mount "$repo::$name" "$work_dir" 2>&1 >/dev/null | log_with_timestamp + size="$3" + description="$4" + "$borg" mount "::$name" "$work_dir" } work_dir="$2" @@ -80,13 +78,13 @@ description="$6" case "$1" in need_mount) - do_need_mount "$work_dir" "$name" "$repo" "$size" "$description" + do_need_mount "$work_dir" "$name" "$size" "$description" ;; backup) - do_backup "$work_dir" "$name" "$repo" "$size" "$description" + do_backup "$work_dir" "$name" "$size" "$description" ;; mount) - do_mount "$work_dir" "$name" "$repo" "$size" "$description" + do_mount "$work_dir" "$name" "$size" "$description" ;; *) echo "hook called with unknown argument \`$1'" >&2 From d3f58d01d01907fa6701f148f38477c9cf420e97 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 20:12:09 +0200 Subject: [PATCH 10/22] avoid an error about the fact that the repo already exists (I assume that getting the config of a repo is fast, but maybe not?) --- conf/backup_method | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/backup_method b/conf/backup_method index c314628..9103a6e 100644 --- a/conf/backup_method +++ b/conf/backup_method @@ -29,7 +29,8 @@ do_backup() { size="$3" description="$4" set +e - if "$borg" init -e repokey "$repo" ; then + if ! "$borg" config -l > /dev/null 2>&1; then + "$borg" init -e repokey # human_size=`echo $size | awk '{ suffix=" KMGT"; for(i=1; $1>1024 && i < length(suffix); i++) $1/=1024; print int($1) substr(suffix, i, 1), $3; }'` # Speed in Kbps # speed=1000 From 7d36895fcbfcde86b2d10f55ed51b6a271b278d9 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 20:53:29 +0200 Subject: [PATCH 11/22] add more info in logs --- conf/backup_method | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/backup_method b/conf/backup_method index 9103a6e..10543ea 100644 --- a/conf/backup_method +++ b/conf/backup_method @@ -46,17 +46,17 @@ This is an automated message from your beloved YunoHost server." | /usr/bin/mail # About the {now} placeholder: # https://borgbackup.readthedocs.io/en/stable/usage/create.html#description # In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. - "$borg" create "::_${name}-{now}" "$work_dir" + "$borg" create --stats "::_${name}-{now}" "$work_dir" # About thi _20 it's a crazy fix to avoid pruning wordpress__2 # if you prune wordpress - "$borg" prune -P "_${name}-" --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 + "$borg" prune -P "_${name}-" --list --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 # Prune legacy archive name without error on wordpress/wordpress__2 - "$borg" prune -P "${name}_" --keep-within 2m --keep-monthly=12 + "$borg" prune -P "${name}_" --list --keep-within 2m --keep-monthly=12 # We prune potential manual backup older than 1 year - "$borg" prune --keep-within 1y + "$borg" prune --list --keep-within 1y } do_mount() { From 4e15f55b9bda8d84e51aaa59d32a187ac7ff4cdb Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 21 Jun 2024 21:11:16 +0200 Subject: [PATCH 12/22] prune -P is deprecated, use --glob-archives --- conf/backup_method | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/conf/backup_method b/conf/backup_method index 10543ea..2efb46c 100644 --- a/conf/backup_method +++ b/conf/backup_method @@ -46,14 +46,9 @@ This is an automated message from your beloved YunoHost server." | /usr/bin/mail # About the {now} placeholder: # https://borgbackup.readthedocs.io/en/stable/usage/create.html#description # In the archive name, you may use the following placeholders: {now}, {utcnow}, {fqdn}, {hostname}, {user} and some others. - "$borg" create --stats "::_${name}-{now}" "$work_dir" + "$borg" create --stats "::${name}-{now}" "$work_dir" - # About thi _20 it's a crazy fix to avoid pruning wordpress__2 - # if you prune wordpress - "$borg" prune -P "_${name}-" --list --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 - - # Prune legacy archive name without error on wordpress/wordpress__2 - "$borg" prune -P "${name}_" --list --keep-within 2m --keep-monthly=12 + "$borg" prune --glob-archives "${name}-*" --list --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12 # We prune potential manual backup older than 1 year "$borg" prune --list --keep-within 1y From 9bd51cc876f4bdf6a40d5cb5d6cacef1e7ec1e0e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:11:09 +0200 Subject: [PATCH 13/22] Update manifest.toml: bump RAM build requirement to 500M, cf https://forum.yunohost.org/t/30126 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 05c4eb8..c55c2f7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -24,7 +24,7 @@ multi_instance = true ldap = "not_relevant" sso = "not_relevant" disk = "50M" -ram.build = "50M" +ram.build = "500M" ram.runtime = "50M" [install] From 910751dd132775cae942de99925c3b68016557c6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:16:28 +0200 Subject: [PATCH 14/22] Update manifest.toml: bump version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index c55c2f7..07a5401 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Borg Backup" description.en = "Regularly create deduplicated, encrypted backups sent to another server using Borg" description.fr = "Créez régulièrement des sauvegardes dédupliquées et chiffées envoyées sur un autre serveur à l'aide de Borg" -version = "1.2.8~ynh1" +version = "1.2.8~ynh2" maintainers = ["ljf"] From 619b53356f392a0986668d36ca6dcd856d3351d7 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 24 Jun 2024 23:16:32 +0000 Subject: [PATCH 15/22] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6568c3f..42bcd90 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**Shipped version:** 1.2.8~ynh1 +**Shipped version:** 1.2.8~ynh2 ## Documentation and resources - Official app website: diff --git a/README_es.md b/README_es.md index 28abf9f..a3e1387 100644 --- a/README_es.md +++ b/README_es.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**Versión actual:** 1.2.8~ynh1 +**Versión actual:** 1.2.8~ynh2 ## Documentaciones y recursos - Sitio web oficial: diff --git a/README_eu.md b/README_eu.md index c77570e..99dc3fb 100644 --- a/README_eu.md +++ b/README_eu.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**Paketatutako bertsioa:** 1.2.8~ynh1 +**Paketatutako bertsioa:** 1.2.8~ynh2 ## Dokumentazioa eta baliabideak - Aplikazioaren webgune ofiziala: diff --git a/README_fr.md b/README_fr.md index f05b46d..3a91d55 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**Version incluse :** 1.2.8~ynh1 +**Version incluse :** 1.2.8~ynh2 ## Documentations et ressources - Site officiel de l’app : diff --git a/README_gl.md b/README_gl.md index ce6a53d..89f6c60 100644 --- a/README_gl.md +++ b/README_gl.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**Versión proporcionada:** 1.2.8~ynh1 +**Versión proporcionada:** 1.2.8~ynh2 ## Documentación e recursos - Web oficial da app: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 304fe41..ea090e0 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -34,7 +34,7 @@ This app is the "client" part, meant to be installed on the server to be backed Maybe counter-intuitively, you should *first* install this app (`borg_ynh`) and *then* (`borgserver_ynh`) on the other machine. In fact, at the end of the install of `borg_ynh`, you will be provided with the info, in particular the SSH public key, to be used to setup `borgserver_ynh` on the other machine. -**分发版本:** 1.2.8~ynh1 +**分发版本:** 1.2.8~ynh2 ## 文档与资源 - 官方应用网站: From 68d887fa7dd00f424c4c73f5fa11d77950aae8a6 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 25 Jun 2024 14:37:22 +0200 Subject: [PATCH 16/22] add log file to the service in restore script too --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 4738f2c..afd6c98 100755 --- a/scripts/restore +++ b/scripts/restore @@ -50,7 +50,7 @@ chown "$app:$app" "$install_dir/logging.conf" ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" +yunohost service add $app --description="Deduplicating backup program" --test_status="systemctl show $app.service -p ActiveState --value | grep -v failed" --log "/var/log/$app/borg.log" # Disable the service, this is to prevent the service from being triggered at boot time systemctl disable $app.service --quiet From 54af11bd4a0d2d2a6687596296521c516da74cda Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 28 Jun 2024 10:26:42 +0200 Subject: [PATCH 17/22] fix config panel --- scripts/config | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/config b/scripts/config index a6972e7..edb17a7 100644 --- a/scripts/config +++ b/scripts/config @@ -53,6 +53,10 @@ $(BORG_PASSPHRASE="$(ynh_app_setting_get $app passphrase)" BORG_RSH="ssh -i /roo EOF } +get__conf() { + ynh_app_setting_get --app=$app --key=conf +} + #================================================= # SPECIFIC VALIDATORS FOR TOML SHORT KEYS #================================================= @@ -74,6 +78,15 @@ set__data_multimedia() { ynh_secure_remove /home/yunohost.multimedia/.nobackup fi } + +set__conf() { + if [ -n "${conf}" ] + then + # Update the config of the app + ynh_app_setting_set --app=$app --key=conf --value=$conf + fi +} + #================================================= # GENERIC FINALIZATION #================================================= From b9dc0d16fadccc4ae3c339044d4ab86eaec27812 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 28 Jun 2024 08:26:46 +0000 Subject: [PATCH 18/22] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 42bcd90..8a3c1c1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Borg Backup for YunoHost -[![Integration level](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![Working status](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![Working status](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![Install Borg Backup with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) diff --git a/README_es.md b/README_es.md index a3e1387..409719c 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Borg Backup para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![Instalar Borg Backup con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) diff --git a/README_eu.md b/README_eu.md index 99dc3fb..b4b35a1 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Borg Backup YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![Instalatu Borg Backup YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) diff --git a/README_fr.md b/README_fr.md index 3a91d55..f2439c1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Borg Backup pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![Installer Borg Backup avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) diff --git a/README_gl.md b/README_gl.md index 89f6c60..816c7f1 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Borg Backup para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![Instalar Borg Backup con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) diff --git a/README_zh_Hans.md b/README_zh_Hans.md index ea090e0..9c4e690 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Borg Backup -[![集成程度](https://dash.yunohost.org/integration/borg.svg)](https://dash.yunohost.org/appci/app/borg) ![工作状态](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/borg.svg)](https://ci-apps.yunohost.org/ci/apps/borg/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/borg.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/borg.maintain.svg) [![使用 YunoHost 安装 Borg Backup](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=borg) From 0cffc5bba4dac410dce80b43fccedf9c08da7410 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 2 Jul 2024 09:15:25 +0200 Subject: [PATCH 19/22] Update conf/backup_method --- conf/backup_method | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/backup_method b/conf/backup_method index 2efb46c..29a3980 100644 --- a/conf/backup_method +++ b/conf/backup_method @@ -29,7 +29,7 @@ do_backup() { size="$3" description="$4" set +e - if ! "$borg" config -l > /dev/null 2>&1; then + if ! "$borg" list > /dev/null 2>&1; then "$borg" init -e repokey # human_size=`echo $size | awk '{ suffix=" KMGT"; for(i=1; $1>1024 && i < length(suffix); i++) $1/=1024; print int($1) substr(suffix, i, 1), $3; }'` # Speed in Kbps From a8e76eda94df84bfc27d7897e310bd83c90a7523 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 3 Jul 2024 09:31:03 +0200 Subject: [PATCH 20/22] add a working bookworm version to test --- tests.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests.toml b/tests.toml index 050cb44..4b39e88 100644 --- a/tests.toml +++ b/tests.toml @@ -27,6 +27,17 @@ test_format = 1.0 args.on_calendar = "Daily" args.mailalert = "never" + [default.test_upgrade_from.159bd111c63fcce0a1b8b3d589b517aa15007a21] + name = "First workin bookworm version/manifest v2" + args.server = "domain.tld:22" + args.ssh_user = "package_checker" + args.passphrase = "A_Passphrase" + args.conf = 1 + args.data = 1 + args.apps = "all" + args.on_calendar = "Daily" + args.mailalert = "never" + [local_directory] args.repository = "/mnt/backup" From 15fe05c5ce4b69c0c0f26ac89a70ba40e2cae10a Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 3 Jul 2024 09:31:30 +0200 Subject: [PATCH 21/22] g --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 4b39e88..5f33aa8 100644 --- a/tests.toml +++ b/tests.toml @@ -28,7 +28,7 @@ test_format = 1.0 args.mailalert = "never" [default.test_upgrade_from.159bd111c63fcce0a1b8b3d589b517aa15007a21] - name = "First workin bookworm version/manifest v2" + name = "First working bookworm version/manifest v2" args.server = "domain.tld:22" args.ssh_user = "package_checker" args.passphrase = "A_Passphrase" From e20b7394cd33fabe1be3ea2294922c83a1339329 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 3 Jul 2024 10:22:37 +0200 Subject: [PATCH 22/22] fix upgrade args --- tests.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests.toml b/tests.toml index 5f33aa8..f9de7b5 100644 --- a/tests.toml +++ b/tests.toml @@ -29,14 +29,13 @@ test_format = 1.0 [default.test_upgrade_from.159bd111c63fcce0a1b8b3d589b517aa15007a21] name = "First working bookworm version/manifest v2" - args.server = "domain.tld:22" - args.ssh_user = "package_checker" + args.repository = "ssh://sam@domain.tld:22/~/backup" args.passphrase = "A_Passphrase" args.conf = 1 args.data = 1 args.apps = "all" args.on_calendar = "Daily" - args.mailalert = "never" + args.mailalert = "errors_only" [local_directory]