tasket / wyng-backup

Fast backups for logical volumes & disk images
GNU General Public License v3.0
245 stars 16 forks source link

Automated password and passphrase input #171

Closed gangamstyle closed 1 year ago

gangamstyle commented 1 year ago

My attempt to migrate from wyng 0.3 to a latest version has terribly failed due to misunderstanding on how to provide non-interactive password to wyng.

So how to provide password to wyng to make auto-backup from script ? ENV variable ? config ? It is insane to enter it each time by hand!

tasket commented 1 year ago

@gangamstyle Wyng is designed so that the passphrase prompt will always come first. Directing the passphrase to Wyng's standard input will work.

Also check out the --authmin option which reduces the number of times you have to enter the passphrase.

tasket commented 1 year ago

I see that using getpass() creates a problem for piped input. Looking into it now...

tasket commented 1 year ago

@gangamstyle A fix has been posted to the '08wip' branch. This should allow sending passphrase over piped/redirected input.

gangamstyle commented 1 year ago

Thanks, I tried stdin before and right now it should be fixed. But, until it is beta and API is flexible, please consider using industry standard for session management: environment variables. It is supported by everything (linux, windows). Borg API is a good example, it is stable and simple: https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables

tasket commented 1 year ago

OK, I have pushed the fix to the main (beta) branch.

Thanks for the suggestion. I'll consider adding support for some parameters via env vars, although I do not expect them to proliferate much in the near term. You may want to see issue #118 which is to support a Python module API for Wyng.

ldeso commented 1 year ago

I had this issue as well and I can confim that the last commit fixed it.