Add a config entry for BORG_CHECK_I_KNOW_WHAT_I_AM_DOING env var #724
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#724
Loading…
Reference in New Issue
No description provided.
Delete Branch "arakmar/borgmatic:env_check_i_know_what_i_am_doing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It can be very useful especially with recent index count mismatch bugs in borg 1.2.x
e0a39c9bbe
to8f1d4a339e
8f1d4a339e
to1174eda171
1174eda171
to061a74cbc2
061a74cbc2
to2cdb44debd
2cdb44debd
tod05ec9fa2c
Thanks for submitting this and updating tests as well! It generally looks good except for the case-sensitivity issue. (See comments.)
@ -36,3 +37,3 @@
) in DEFAULT_BOOL_OPTION_TO_ENVIRONMENT_VARIABLE.items():
value = storage_config.get(option_name, False)
environment[environment_variable_name] = 'yes' if value else 'no'
environment[environment_variable_name] = 'YES' if value else 'NO'
It looks like this will break some of the other environment variables due to the fact that the value: 1. is case-sensitive, and 2. has different expectations for different Borg environment variables. See the documentation here for details: https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables
In theory, it shouldn't be a problem because downcase is not required for BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK and BORG_RELOCATED_REPO_ACCESS_IS_OK. (by looking at the borg code : https://github.com/borgbackup/borg/blob/master/src/borg/helpers/yes_no.py#L8)
But you're right, to be cleaner (and future proof), I created a downcase and an uppercase list of env var.
d05ec9fa2c
to7d18f59079
Looks great, thank you!
Released in borgmatic 1.8.0. Thanks again!
FYI: #730
I think this is because
check_i_know_what_i_am_doing
defaults tofalse
and therefore the Borg environment variable always gets set.