garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.31k stars 39 forks source link

Support --insecure-no-password #497

Open yushiyangk opened 3 weeks ago

yushiyangk commented 3 weeks ago

Is your feature request related to a problem? Please describe. I would like to create backups of non-confidential files without password encryption.

Describe the solution you'd like Since restic 0.17, the --insecure-no-password flag has been supported to allow creation of repos without password encryption. It would be great if Backrest could support this flag also.

Right now if I try to create a repo without a password, I get an error message saying

Missing repo password. Either provide a password or set one of the env variables RESTIC_PASSWORD, RESTIC_PASSWORD_COMMAND, RESTIC_PASSWORD_FILE.

Perhaps there can be a checkbox for disabling the password? Alternatively, if the goal is to discourage passwordless backups, could the error condition be updated to allow no password to be set when --insecure-no-password is added as a flag?

Thank you!

garethgeorge commented 3 weeks ago

Hey, very reasonable. The blocker here at the moment is just a UI validation: https://github.com/garethgeorge/backrest/blob/main/webui/src/views/AddRepoModal.tsx#L690-L738 . The existing validation should additionally check what flag overrides have been specified (I think a simple substring search for --insecure-no-password would be sufficient).

This should be supported out of the box by the daemon. I'm about to leave on vacation so I won't get to this for a few weeks, but it should be very straightforward.