Skip to content

Add missing placeholder keys #2227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 13, 2025
Merged

Conversation

VandalByte
Copy link
Collaborator

@VandalByte VandalByte commented Apr 12, 2025

Description

This PR adds the missing placeholder keys available in borg into vorta.

While I was working on it I noticed dt.utcnow() was deprecated, so I replaced it with the new preferred method.

Output of dt.utcnow() [DEPRECATED]

2025-04-12 18:25:42.922358

Output of dt.now(timezone.utc) [NEW]

2025-04-12 18:25:42.922358+00:00

Which according to google is a full ISO 8601 timestamp, and according to borg docs, borg accepts the ISO 8601 format.

Related Issue

Closes #1954

Motivation and Context

Vorta currently raises an "Error in archive name template" when users include valid Borg placeholders such as {utcnow}, {pid}, {borgversion} etc. in the archive name. These placeholders are documented in borg should be supported. Adding support for those placeholders should address the error.

How Has This Been Tested?

Tested it by running the application build.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@VandalByte
Copy link
Collaborator Author

Had a small import error, but it's been fixed.

@m3nu m3nu merged commit 39c1c7f into borgbase:master Apr 13, 2025
7 checks passed
@m3nu
Copy link
Contributor

m3nu commented Apr 13, 2025

Thanks! Looks like a reasonable change.

@VandalByte VandalByte deleted the dev-placeholder-keys branch April 14, 2025 04:35
@VandalByte VandalByte mentioned this pull request Apr 27, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use some placeholders in archive names
2 participants