Allow environment variable resolution in configuration file #548

Merged
witten merged 1 commits from essembeh/borgmatic:configuration-env-resolve into master 2022-06-16 18:18:15 +00:00
Contributor
  • all string fields containing an environment variable like ${FOO} will
    be resolved
  • supported format ${FOO}, ${FOO:-bar} and ${FOO-bar} to allow default
    values if variable is not present in environment
  • add --no-env argument for CLI to disable the feature which is enabled
    by default

Resolves: #546

- all string fields containing an environment variable like ${FOO} will be resolved - supported format ${FOO}, ${FOO:-bar} and ${FOO-bar} to allow default values if variable is not present in environment - add --no-env argument for CLI to disable the feature which is enabled by default Resolves: #546
essembeh added 1 commit 2022-06-16 16:55:33 +00:00
97b5cd089d Allow environment variable resolution in configuration file
- all string fields containing an environment variable like ${FOO} will
  be resolved
- supported format ${FOO}, ${FOO:-bar} and ${FOO-bar} to allow default
  values if variable is not present in environment
- add --no-env argument for CLI to disable the feature which is enabled
  by default

Resolves: #546
Owner

This looks great. And tests too! Thank you so much for taking the time to do this when all you needed was the database password from the environment. Clever use of the negative look-ahead for an escaped $.. I wouldn't have thought of that. Heads up that I may rename the --no-env flag for consistency with other borgmatic flags. And I can write up some documentation when I get a chance.

This looks great. And tests too! Thank you so much for taking the time to do this when all you needed was the database password from the environment. Clever use of the negative look-ahead for an escaped `$`.. I wouldn't have thought of that. Heads up that I may rename the `--no-env` flag for consistency with other borgmatic flags. And I can write up some documentation when I get a chance.
witten merged commit ea45f6c4c8 into master 2022-06-16 18:18:15 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#548
No description provided.