borgbase / vorta

Desktop Backup Client for Borg Backup
https://vorta.borgbase.com
GNU General Public License v3.0
2.02k stars 134 forks source link

check if ssh agent actually provides requested key if it is password protected #2143

Open Renner0E opened 2 days ago

Renner0E commented 2 days ago

The problem

I use password protected ssh key files with vorta. I use keepassxc as my ssh-agent. So when I unlock my database only then my SSH keys can actually be used.

When the server is reachable but the SSH key is not unlocked then vorta gives this error: ERROR - Connection closed by remote host. Is borg working on the server?

So when I boot up my PC (Vorta is in autostart and is set to Backup Daily and runs missed updates) Vorta immediately wants to run backups. I have no time to unlock my database before Vorta runs.

This would be very convenient as I would probably never have to run a manual backup again.

Requested Solution

Add an option to configure either on a per repo/key basis to check if the ssh agent has that requested key in it and if does, run the backup. If not, try it again if the key is available later -> Error if certain threshold/max tries is passed.

Vorta checks in the background when the SSH agent provides the key for the missed backup?

Alternatives

A delay after autostart would probably also work but is certainly not ideal.

I could probably get the borg command from vorta logs and use a systemd timer/cron/whatever and another script that checks which ssh keys are in the agent but I'd have to update the script it each time I change some option in vorta.

I want to avoid using non protected SSH keys.

Additional context

Fedora Linux 41 Vorta Flatpak

m3nu commented 2 days ago

Related: #2133