Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rluetzner
Copy link
Contributor

This shows a password prompt, if neither the --password-file or --password-command option is given and the RESTIC_PASSWORD env variable is unset.

There's no way to hand over the password to restic as a CLI parameter, so we use the RESTIC_PASSWORD env variable under the hood to set it instead. The env variable is only valid for the restic process we call internally, so the next time redu is run, it'll prompt for the password again.

This fixes #27 .

Copy link
Contributor Author

@rluetzner rluetzner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I'm reeeeeeeally new to Rust (apart from the changes yesterday, this is my first time working with Rust), I have a few questions and comments already.

This shows a password prompt, if neither the `--password-file` or
`--password-command` option is given **and** the `RESTIC_PASSWORD` env
variable is unset.

There's no way to hand over the password to restic as a CLI parameter,
so we use the `RESTIC_PASSWORD` env variable under the hood to set it
instead. The env variable is only valid for the restic process we call
internally, so the next time redu is run, it'll prompt for the password
again.
@rluetzner
Copy link
Contributor Author

Tested the new code and cmd.env() works as expected. 🙂

@drdo
Copy link
Owner

drdo commented Aug 1, 2024

Great job! LGTM

@drdo drdo merged commit 761e8e3 into drdo:main Aug 1, 2024
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.

Prompt for password and/or repository if they are not provided via restic env vars or redu cmd line arguments

2 participants