Add SudoPassCmd configuration for more convenience#112
Open
MaxG87 wants to merge 18 commits into
Open
Conversation
Rename the existing `Configuration` union type alias to `DeviceConfiguration`
and introduce a new `Configuration` BaseModel that wraps the list of device
configurations under a `deviceConfigurations` field.
For TOML, the parent section is now `butter-backup` with the array of device
entries under `device-configurations`:
[[butter-backup.device-configurations]]
Name = "..."
For JSON/JSON5/YAML the wrapper key is `deviceConfigurations`:
{ "deviceConfigurations": [...] }
Update all callers, tests, and example config files accordingly.
Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/8df34a6f-2b3a-4151-8bd2-1d7d91224187
Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
Add an optional `SudoPassCmd: str | None = None` field to the `Configuration` model. When set, it holds a shell command whose stdout is a sudo password that can be used to refresh the sudo credential cache. Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/8df34a6f-2b3a-4151-8bd2-1d7d91224187 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
When `SudoPassCmd` is set in the configuration, run `SudoPassCmd | sudo -Sv` to refresh the sudo credential cache: - before device decryption in the `open` command - before device decryption in the `backup` command - before unmounting in the `close` command This prevents interactive password prompts during long backup sessions. Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/8df34a6f-2b3a-4151-8bd2-1d7d91224187 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/202d0ec1-b3d9-4703-8590-464a78b2398c Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/c3eca6b4-12ee-4225-864d-0f6c4d8eda57 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/c3eca6b4-12ee-4225-864d-0f6c4d8eda57 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
…r (suggestion 5) Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/c3eca6b4-12ee-4225-864d-0f6c4d8eda57 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
…valid path after context exit Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/c3eca6b4-12ee-4225-864d-0f6c4d8eda57 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/ff32282e-aca6-4e6e-903f-d1a2ad839953 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
…ose test Agent-Logs-Url: https://github.com/MaxG87/ButterBackup/sessions/ff32282e-aca6-4e6e-903f-d1a2ad839953 Co-authored-by: MaxG87 <5477952+MaxG87@users.noreply.github.com>
While here, two explicit composite strategies were rewritten to be just strategies.
The file got way too long. All tests regarding sudo_pass_cmd are extracted into their own file for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.