vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Unable to use some placeholders in archive names

Open daPhipz opened this issue 11 months ago • 12 comments

Description

When trying to add the following placeholders (see here) to the archive name, Vorta says "Error in archive name template.":

  • {reverse-fqdn}
  • {utcnow}
  • {pid}
  • {borgversion}
  • {borgmajor}
  • {borgminor}
  • {borgpatch}

When I navigate away from that tab in Vorta (e.g. to the "Schedule" tab) and then go back, the "problematic" part of the archive name is removed from the text input field

Reproduction

  • [X] I tried to reproduce the issue.
  • [X] I was able to reproduce the issue.

OS

Kubuntu 22.10

Version of Vorta

0.9.1

What did you install Vorta with?

Flatpak

Version of Borg

1.2.4 according to Vorta, 1.2.6 according to borg --version (I guess one comes with the Flatpak and the other is a deb package)

Logs

No response

daPhipz avatar Mar 02 '24 21:03 daPhipz

We may not pass those to Borg and our current placeholders are filled by Vorta only. I think. If this is the case, we should look into passing them through, as you expect here.

m3nu avatar Mar 04 '24 07:03 m3nu

@m3nu I think that if we pass them through to borg, we may not be able to show the preview. We can just add the missing keys from borg to vorta.

https://github.com/borgbackup/borg/blob/b82bf4a232c6c7d63796d2366a147f74c5ab13dc/src/borg/helpers/parseformat.py#L264C5-L272C20

AdwaitSalankar avatar Mar 06 '24 06:03 AdwaitSalankar

Will this change solve it for you, @daPhipz ? It's a clever change actually.

m3nu avatar Mar 06 '24 08:03 m3nu

@m3nu I think that if we pass them through to borg, we may not be able to show the preview. We can just add the missing keys from borg to vorta.

https://github.com/borgbackup/borg/blob/b82bf4a232c6c7d63796d2366a147f74c5ab13dc/src/borg/helpers/parseformat.py#L264C5-L272C20

I don't really know how to (read that) code - would this solution mean that the placeholders would work, but the preview text under the text field could be wrong? Or where is the compromise?

I personally don't care about the preview if the actual naming works, but maybe the user should be informed in that case.

daPhipz avatar Mar 06 '24 20:03 daPhipz

Both (Placeholders and the Preview) will work here. The naming would be same as preview.

AdwaitSalankar avatar Mar 07 '24 17:03 AdwaitSalankar

In that case, I am perfectly fine with this solution! Thank you very much for this quick PR! :heart_eyes:

daPhipz avatar Mar 07 '24 17:03 daPhipz

@m3nu, is this PR good to be closed then?

AdwaitSalankar avatar Mar 13 '24 18:03 AdwaitSalankar

Yes, we will merge it. Let's just give others a chance to look at it too.

m3nu avatar Mar 14 '24 15:03 m3nu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jun 13 '24 02:06 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jun 21 '24 02:06 github-actions[bot]

Could someone reopen this, since there is already a PR in the works?

daPhipz avatar Jun 21 '24 10:06 daPhipz