From df87ccece82ad6018ebc274b23bbd4e126ded5bc Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 14 Aug 2026 17:21:02 +0200 Subject: [PATCH 1/4] Offer a way to change the passphrase through the config panel --- config_panel.toml | 15 +++++++++++++++ manifest.toml | 2 +- scripts/config | 19 ++++++++++++++++--- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index f55ad18..52c4dbd 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -36,6 +36,21 @@ name.fr = "Configuration de Borg" type = "string" readonly = true + [main.general.change_passphrase] + ask.en = "Change the backup passphrase" + ask.fr = "Modifier le phrase de passe des sauvegardes" + type = "boolean" + bind = "null" + + [main.general.new_passphrase] + ask.en = "Fill your new passphrase (NEEDS TO BE STRONG)" + ask.fr = "Renseignez votre nouvelle phrase de passe (DOIT ÊTRE ROBUSTE)" + type = "password" + bind = "null" + help.en = "Keep it safe! There will be **no way** to restore your backup if you lose it. Do not communicate it to the remote host server holder, or anyone else." + help.fr = "Gardez-la précieusement ! Il sera **impossible** de restaurer vos sauvegardes sans celle-ci. Elle est destinée à rester **secrète** : ne la donnez **pas** à la personne qui gère le serveur distant - où à n'importe qui d'autre !" + visible = "change_passphrase" + [main.general.remote_path] ask.en = "Remote borg command (remote-path)" type = "string" diff --git a/manifest.toml b/manifest.toml index f4772c1..4323b92 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,7 +42,7 @@ ram.runtime = "50M" [install.passphrase] ask.en = "Provide a strong passphrase to encrypt your backups. No blank space" - ask.fr = "Indiquez une phrase de passe forte pour chiffrer vos sauvegardes. Sans espaces" + ask.fr = "Indiquez une phrase de passe robuste pour chiffrer vos sauvegardes. Sans espaces" help.en = "Keep it safe! There will be **no way** to restore your backup if you lose it. Do not communicate it to the remote host server holder, or anyone else." help.fr = "Gardez-la précieusement ! Il sera **impossible** de restaurer vos sauvegardes sans celle-ci. Elle est destinée à rester **secrète** : ne la donnez **pas** à la personne qui gère le serveur distant - où à n'importe qui d'autre !" type = "password" diff --git a/scripts/config b/scripts/config index aacacfc..ff6cb89 100644 --- a/scripts/config +++ b/scripts/config @@ -57,9 +57,6 @@ get__data_multimedia() { get__last_backups() { local backup_list - # Source the env file inside the command substitution ("$(...)") - # so the variables don't pollute the rest of the function and of the script. - # Indeed the command substitution spawns a subshell which is convenient here. backup_list=$(ynh_exec_as_app "$borg_with_env_vars" list --short --last 50 "${repository}" 2> /dev/null) if [ -z "$backup_list" ]; then @@ -123,5 +120,21 @@ set__remote_path() { ynh_config_add --template="env.jinja" --destination="$install_dir/.env" --jinja } +set__new_passphrase() { + if [ -n "${new_passphrase}" ]; then + ( + set -eEux -o pipefail + set -a + source "${install_dir}/.env" + BORG_NEW_PASSPHRASE="${new_passphrase}" "${install_dir}/venv/bin/borg" key change-passphrase + ) + ynh_app_setting_set --key=passphrase --value="${new_passphrase}" + # store the new value into the `passphrase` variable so the template for `.env` + # takes the changes into account + passphrase="${new_passphrase}" + ynh_config_add --template="env.jinja" --destination="${install_dir}/.env" --jinja + fi +} + #================================================= ynh_app_config_run $1 From bc23288a4f5aee931056ed2bc1967a1002dc4068 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 14 Aug 2026 17:52:47 +0200 Subject: [PATCH 2/4] The blank spaces are allowed in passphrase --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4323b92..c15e449 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,8 +41,8 @@ ram.runtime = "50M" example = "ssh://john@serverb.tld:22/~/backup" [install.passphrase] - ask.en = "Provide a strong passphrase to encrypt your backups. No blank space" - ask.fr = "Indiquez une phrase de passe robuste pour chiffrer vos sauvegardes. Sans espaces" + ask.en = "Provide a strong passphrase to encrypt your backups" + ask.fr = "Indiquez une phrase de passe robuste pour chiffrer vos sauvegardes" help.en = "Keep it safe! There will be **no way** to restore your backup if you lose it. Do not communicate it to the remote host server holder, or anyone else." help.fr = "Gardez-la précieusement ! Il sera **impossible** de restaurer vos sauvegardes sans celle-ci. Elle est destinée à rester **secrète** : ne la donnez **pas** à la personne qui gère le serveur distant - où à n'importe qui d'autre !" type = "password" From 4f9ed40fbff8cdf76bbdf48bd0e4ea9be30da728 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 14 Aug 2026 18:18:31 +0200 Subject: [PATCH 3/4] Bump package revision --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index c15e449..5c6a32a 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.4.5~ynh3" +version = "1.4.5~ynh4" maintainers = ["ljf", "fflorent"] From 5fac5686c0a7ec7fbc14ec94369ecf42fbdff978 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 14 Aug 2026 18:18:31 +0200 Subject: [PATCH 4/4] Auto-update READMEs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d35789d..2159a22 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It shall NOT be edited by hand. Regularly create deduplicated, encrypted backups sent to another server using Borg [![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://www.borgbackup.org) -[![Version: 1.4.5~ynh3](https://img.shields.io/badge/Version-1.4.5~ynh3-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/borg/) +[![Version: 1.4.5~ynh4](https://img.shields.io/badge/Version-1.4.5~ynh4-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/borg/)