• Bug#1092640: backupninja: restic wrapper doesn't support Swift keystone

    From Didier 'OdyX' Raboud@21:1/5 to All on Tue Jul 15 11:07:54 2025
    This is a multi-part message in MIME format.

    --nextPart5364913.31r3eYUQgx
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain; charset="utf-8"

    Control: tags -1 +patch

    On Fri, 10 Jan 2025 11:41:25 +0100 Didier 'OdyX' Raboud <[email protected]> wrote:
    Package: backupninja
    Version: 1.2.2-1
    Severity: important
    Tags: upstream

    Dear Maintainer,

    While wanting to use backupninja to orchestrate restic to backup towards Infomaniak's Swissbackup, I noticed that it doesn't support the neededt OS_PROJECT_* and other variables needed for keystone v3 authentication.
    This is documented at the restic side here: https://restic.readthedocs.io/en/latest/
    030_preparing_a_new_repo.html#openstack-swift
    and it looks like a similar issue was reported upstream here: https://0xacab.org/liberate/backupninja/-/issues/11331 (but I did not
    manage to get an account there yet).

    Would it be useful to provide a patch here?

    Hello there Jérôme,

    as discussed yesterday at DebConf, here comes a patch that I have successfully tested for Swift Keystone v3 authentication.

    I don't have Swift Keystone v2 at hand, but I'm quite confident in the logic I wrote (but really happy for a second pair of eyes!).

    Anything more I could do to get this integrated?

    Best,

    OdyX
    --nextPart5364913.31r3eYUQgx
    Content-Disposition: attachment;
    filename="0001-Support-Swift-v3-in-addition-to-Swift-v2.patch" Content-Transfer-Encoding: 7Bit
    Content-Type: text/x-patch; charset="UTF-8";
    name="0001-Support-Swift-v3-in-addition-to-Swift-v2.patch"

    From 7563762321c10c808fa1dc311c98144e11d4e5a1 Mon Sep 17 00:00:00 2001
    From: Didier Raboud <[email protected]>
    Date: Tue, 15 Jul 2025 09:39:49 +0200
    Subject: [PATCH] Support Swift v3 in addition to Swift v2

    Bug-Upstream: https://0xacab.org/liberate/backupninja/-/issues/11331 Bug-Debian: https://bugs.debian.org/1092640
    ---
    examples/example.restic | 19 ++++++++++++
    handlers/restic.in | 64 ++++++++++++++++++++++++++++++++++-------
    2 files changed, 72 insertions(+), 11 deletions(-)

    diff --git a/examples/example.restic b/examples/example.restic
    index 9fbb124..4507d6a 100644
    --- a/examples/example.restic
    +++ b/examples/example.restic
    @@ -95,6 +95,7 @@ password = secret
    #aws_session_token =

    [swift]
    +## swift v2 needs:

    #os_auth_url =

    @@ -108,6 +109,24 @@ password = secret

    #os_region_name =

    +## swift v3 needs:
    +
    +#os_identity_api_version = 3
    +
    +#os_auth_url =
    +
    +## One of
    +#os_tenant_id =
    +#os_tenant_name =
    +
    +#os_username =
    +
    +#os_password =
    +
    +#os_region_name =
    +
    +#os_user_domain_name =
    +
    [b2]

    #b2_account_id =
    diff --git a/handlers/restic.in b/handlers/restic.in
    index 28cf099..9ac8f02 100644
    --- a/handlers/restic.in
    +++ b/handlers/restic.in
    @@ -45,6 +45,8 @@ getconf os_tenant_name
    getconf os_username
    getconf os_password
    getconf os_region_name
    +getconf os_id