borgweb icon indicating copy to clipboard operation
borgweb copied to clipboard

Doesn't work with encrypted backups?

Open d2718nis opened this issue 5 years ago • 3 comments

Hey, just to make sure, it doesn't work with password-protected repositories, right? After clicking on "Start Backup" button I get these logs:

127.0.0.1 - - [26/Oct/2020 04:01:47] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:47] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:47] "GET /backup/status HTTP/1.1" 200 -
Enter passphrase for key /path/to/repo: 127.0.0.1 - - [26/Oct/2020 04:01:47] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:48] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:48] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:48] "GET /backup/status HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 04:01:48] "GET /backup/status HTTP/1.1" 200 -
...

And it will continue requesting /backup/status indefinitely once in a second or so. The only difference on the frontend is that button now states "Stop Backup", but nothing happens under the hood if I get it right.

Thanks.

d2718nis avatar Oct 26 '20 01:10 d2718nis

If you automate your backups (or if you use some tool not made for asking for passphrase), you can't have it interactively ask for a passphrase (neither for the borg key, nor for ssh key in case you use a remote repo).

There's BORG_PASSPHRASE (see borg docs) and some others to automate answering that question.

The repo can be encrypted when doing it like that.

ThomasWaldmann avatar Oct 26 '20 16:10 ThomasWaldmann

So, theoretically the best way is to add BORG_PASSPHRASE or even BORG_PASSCOMMAND at the beginning of the BACKUP_CMD config value, right?

https://github.com/borgbackup/borgweb/blob/master/borgweb/config.py#L24

d2718nis avatar Oct 26 '20 20:10 d2718nis

For example, yes.

ThomasWaldmann avatar Oct 26 '20 21:10 ThomasWaldmann