Add a config entry for BORG_CHECK_I_KNOW_WHAT_I_AM_DOING env var #724

Merged
witten merged 1 commits from arakmar/borgmatic:env_check_i_know_what_i_am_doing into main 2023-07-10 16:38:09 +00:00
Contributor

It can be very useful especially with recent index count mismatch bugs in borg 1.2.x

It can be very useful especially with recent index count mismatch bugs in borg 1.2.x
arakmar added 1 commit 2023-07-09 09:50:09 +00:00
arakmar force-pushed env_check_i_know_what_i_am_doing from e0a39c9bbe to 8f1d4a339e 2023-07-09 10:41:31 +00:00 Compare
arakmar force-pushed env_check_i_know_what_i_am_doing from 8f1d4a339e to 1174eda171 2023-07-09 10:43:21 +00:00 Compare
arakmar force-pushed env_check_i_know_what_i_am_doing from 1174eda171 to 061a74cbc2 2023-07-09 10:48:30 +00:00 Compare
arakmar force-pushed env_check_i_know_what_i_am_doing from 061a74cbc2 to 2cdb44debd 2023-07-09 10:53:58 +00:00 Compare
arakmar force-pushed env_check_i_know_what_i_am_doing from 2cdb44debd to d05ec9fa2c 2023-07-09 10:54:25 +00:00 Compare
witten requested changes 2023-07-09 23:22:23 +00:00
witten left a comment
Owner

Thanks for submitting this and updating tests as well! It generally looks good except for the case-sensitivity issue. (See comments.)

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'
Owner

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

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
Author
Contributor

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.

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.
arakmar marked this conversation as resolved
arakmar force-pushed env_check_i_know_what_i_am_doing from d05ec9fa2c to 7d18f59079 2023-07-10 08:37:08 +00:00 Compare
Owner

Looks great, thank you!

Looks great, thank you!
witten merged commit d29667ca3c into main 2023-07-10 16:38:09 +00:00
Owner

Released in borgmatic 1.8.0. Thanks again!

Released in borgmatic 1.8.0. Thanks again!
Owner

FYI: #730

I think this is because check_i_know_what_i_am_doing defaults to false and therefore the Borg environment variable always gets set.

FYI: https://projects.torsion.org/borgmatic-collective/borgmatic/issues/730 I think this is because `check_i_know_what_i_am_doing` defaults to `false` and therefore the Borg environment variable always gets set.
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#724
No description provided.