From 8bafabe2f9f676ec266b8d01c3a7d0501f933710 Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Sat, 30 Sep 2023 16:17:51 +0200 Subject: [PATCH] backup: Fix bug in adding existing unencryped backup location borg throws and warning "Warning: Attempting to access a previously unknown unencryped repository!\nDo you want to continue?" and then fails while asking for a manual confirmation. Avoid this by telling borg not to prompt (and confirm yes). This commit provides a fix for the issue described here: https://discuss.freedombox.org/t/how-do-i-restore-freedombox/2022/10 [sunil: Drop the part about handling the error message] Signed-off-by: Benedek Nagy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/backups/privileged.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plinth/modules/backups/privileged.py b/plinth/modules/backups/privileged.py index 3ebc65178..33d477246 100644 --- a/plinth/modules/backups/privileged.py +++ b/plinth/modules/backups/privileged.py @@ -339,6 +339,7 @@ def load_settings(app_id: str) -> dict[str, int | float | bool | str]: def _get_env(encryption_passphrase: str | None = None): """Create encryption and ssh kwargs out of given arguments.""" env = dict(os.environ, BORG_RELOCATED_REPO_ACCESS_IS_OK='yes', + BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK='yes', LANG='C.UTF-8') # Always provide BORG_PASSPHRASE (also if empty) so borg does not get stuck # while asking for a passphrase.