English version
(
French version below)
Version 1.4.1~ynh4 has just been released.
It fixes a serious bug in 1.4.1~ynh3: when the passphrase contains ampersands (&) leading it not being correctly written in /var/www/__APP__/.env, and therefore making either backups creation fail or repository initiated with the wrong passphrase [1].
In other word, there are three cases:
- If your passphrase does not contain any ampersand (
&): you are probably good
. You may still upgrade to 1.4.1~ynh4just to keep track with the release versions. - If your passphrase contains at least one ampersand, but your initial borg installation has been done before
1.4.1~ynh3, you are probably experiencing issues with backuping[2], you should upgrade yunohost to version12.1.28and upgrade borg to version1.4.1~ynh4and make the checks below - If your passphrase contains at least one ampersand, AND your initial borg installation has been using version
1.4.1~ynh3, then you probably need to fix the passphrase of your repository, see below
Foreword
Letâs remind that this work is driven by the work of volunteers. We do care about providing a reliable service. That being said, it is important to remind you have agreed on the terms of service and especially to this part:
YunoHost as software is released under the AGPLv3 license and is therefore provided without warranty of any kind and is not liable for any damages resulting from its use, nor from the use of the applications it allows to install.
So does this post, and its author is not liable for any possible damages.
Thatâs the reason why you are invited to fully read from the start to the end and understand the below steps before running the commands.
The upgrade
Follow these two steps:
- Upgrade your system, this will upgrade Yunohost to version
12.1.28 - Upgrade all your borg apps (borg and not borgserver which is another package)
The post-upgrade checks and fix
After the upgrade, open a shell session, log in as root, and retrieve all the borg instance IDs using the following command:
yunohost app list | grep -Po 'id: \Kborg(\b|__\d+)'
The following steps have to be run for each borg instance: ![]()
Then letâs check whether the passphrase is now correctly set in the system:
app_id=borg # change the value borg__2, borg__3, ... to check
# the other borg instances as returned by the command above
/var/www/$app_id/wrapper/borg list
If the command succeeds in listing your archives, STOP HERE, and repeat the commands above for the next borg instance ![]()
But if the command fails with this error:
passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.
Then first and foremost, be sure that youâre passphrase actually contains an ampersand:
grep BORG_PASSPHRASE /var/www/$app_id/.env | grep --color '&' && echo "The passphrase contains an ampersand, run the fix" || echo "Do NOT run the fix, that's another problem"
If the command above prints your passphrase correctly, then your borg repository has probably been initiated with a wrong one, having & replaced with __PASSPHRASE__ (see [1:1] for more info).
Letâs print the command that will be run to change the passphrase with the command below:
export app_id
(set -a; source /var/www/$app_id/.env; set +a; echo BORG_NEW_PASSPHRASE="${BORG_PASSPHRASE}" BORG_PASSPHRASE="${BORG_PASSPHRASE//&/__PASSPHRASE__}" /var/www/$app_id/venv/bin/borg key change-passphrase)
Inspect the result and when youâre ready, remove the call to echo in the command above, which will make the change effective.
If you do NOT see any output, then the command should have been run successfully.
Check now that borg is able to list your backups successfully:
/var/www/$app_id/wrapper/borg list
Donât forget to repeat the check and (if applicable) the fix for the other instances.
And youâre done! ![]()
French version
Une nouvelle version 1.4.1~ynh4 du paquet est maintenant disponible.
Elle corrige un bug important prĂ©sent dans la version 1.4.1~ynh3 : lorsque la phrase de passe (passphrase ou mot de passe si vous prĂ©fĂ©rez) contient des esperluette (&), elle nâest pas correctement restituĂ©e dans le fichier /var/www/__APP__/.env, ce qui entraĂźne lâĂ©chec des sauvegardes ou lâinitialisation dâun dĂ©pĂŽt borg avec la mauvaise phrase de passe [1:2].
En dâautres termes, il y a trois cas :
- Si votre phrase de passe ne contient aucune esperluette (
&) : vous nâavez probablement rien Ă faire
. Vous pouvez toujours mettre à niveau vers 1.4.1~ynh4juste pour suivre les versions de sortie. - Si votre phrase de passe contient au moins une esperluette, mais que votre installation initiale de Borg a été effectuée avant la
1.4.1~ynh3, vous rencontrez probablement des problĂšmes de sauvegarde[2:1]. Vous devez mettre Ă niveau Yunohost vers la version12.1.28et mettre Ă niveau Borg vers la version1.4.1~ynh4et effectuer les vĂ©rifications ci-dessous. - Si votre phrase de passe contient au moins une esperluette, ET que votre installation initiale de Borg a Ă©tĂ© rĂ©alisĂ©e Ă lâaide de la version
1.4.1~ynh3, vous devrez probablement corriger la phrase de passe de votre dépÎt, voir ci-dessous.
# Préambule
Nous tenons Ă rappeler que ce travail est menĂ© par des bĂ©nĂ©voles. Nous nous soucions de fournir un service fiable. Cela Ă©tant dit, il est important de rappeler que vous avez acceptĂ© les conditions dâutilisation et en particulier ce paragraphe :
YunoHost en tant que logiciel est publiĂ© sous licence AGPLv3 et est donc fourni sans garantie dâaucune sorte et nâest pas responsable des dommages rĂ©sultant de son utilisation, ni de lâutilisation des applications quâil permet dâinstaller.
De la mĂȘme maniĂšre, dans ce message, lâauteur nâest pas responsable des Ă©ventuels dommages.
Câest pourquoi vous ĂȘtes invité·es Ă lire attentivement ce post du dĂ©but Ă la fin et Ă comprendre les Ă©tapes ci-dessous avant dâexĂ©cuter les commandes.
# La mise Ă niveau
Suivez ces deux étapes :
- Mettez Ă niveau votre systĂšme, ce qui mettra Ă niveau Yunohost vers la version
12.1.28 - Mettez à niveau toutes vos applications Borg (Borg et non Borgserver, qui est un paquet différents)
Les vérifications et la correction post-mise à niveau
AprĂšs la mise Ă niveau, ouvrez une session shell, connectez-vous en tant que root et rĂ©cupĂ©rez tous les ID dâinstance Borg Ă lâaide de la commande suivante :
yunohost app list | grep -Po 'id: \Kborg(\b|__\d+)'
Les Ă©tapes ci-dessous doivent ĂȘtre exĂ©cutĂ©es pour chaque instance Borg : ![]()
Vérifions ensuite si la phrase de passe est maintenant correctement définie dans le systÚme :
app_id=borg # change the value borg__2, borg__3, ... to check
# the other borg instances as returned by the command above
/var/www/$app_id/wrapper/borg list
Si la commande parvient Ă lister vos sauvegardes, ARRĂTEZ-VOUS ICI, et rĂ©pĂ©tez les commandes ci-dessus pour la prochaine instance Borg ![]()
Mais si la commande échoue avec cette erreur :
passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.
Alors, assurez-vous dâabord que votre phrase de passe contient bien une esperluette :
grep BORG_PASSPHRASE /var/www/$app_id/.env | grep --color '&' && echo "The passphrase contains an ampersand, run the fix" || echo "Do NOT run the fix, that's another problem"
Si la commande affiche votre phrase de passe correctement, alors votre dĂ©pĂŽt Borg a probablement Ă©tĂ© initialisĂ© avec une mauvaise, ayant & remplacĂ© par __PASSPHRASE__ (voir [1:3] pour plus dâinformations).
Affichons maintenant la commande qui sera exécutée pour modifier la phrase de passe :
export app_id
(set -a; source /var/www/$app_id/.env; set +a; echo BORG_NEW_PASSPHRASE="${BORG_PASSPHRASE}" BORG_PASSPHRASE="${BORG_PASSPHRASE//&/__PASSPHRASE__}" /var/www/$app_id/venv/bin/borg key change-passphrase)
Inspectez le rĂ©sultat et, lorsque vous ĂȘtes prĂȘt·e, supprimez lâappel Ă echo dans la commande que vous venez dâexĂ©cuter, ce qui rendra le changement effectif.
Si Ă lâexĂ©cution de la commande aucun retour ne vous est affichĂ©, alors la commande a dĂ» sâexĂ©cuter avec succĂšs.
Vérifiez maintenant que Borg est capable de lister vos sauvegardes correctement :
/var/www/$app_id/wrapper/borg list
Nâoubliez pas de rĂ©pĂ©ter le contrĂŽle et (si nĂ©cessaire) la correction pour les autres instances.
Et voilĂ ! ![]()
See Passphrase not recognized when it contains ampersands (`&`) · Issue #231 · YunoHost-Apps/borg_ynh · GitHub for a more detailed explanation â©ïž â©ïž â©ïž â©ïž
You should probably this message in
/var/log/borg/borg.log:passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect.â©ïž â©ïž