git-remote-restic icon indicating copy to clipboard operation
git-remote-restic copied to clipboard

Support specifying restic options

Open tionis opened this issue 1 year ago • 2 comments

I'm using restic via an append only ssh backend (using ssh forced commands) and would like to use the same or a similar backend for git-remote-restic.
To use the backend with normal restic backups I do something like restic -o rclone.program='ssh backup-host forced-command' -r rclone: backup. This approach is also explained here. Perhaps such an options could be encoded in the remote string?

tionis avatar Oct 20 '24 14:10 tionis

Encoding in the remote string sounds like it could get very unwieldy. One option is to utilize the gitconfig file to store these options. This would look like:

  1. Use a named git remote. Now running git push <name> will run git-remote-retic <name> <url>.
  2. The tool can then read any additional keys from the git config, for example we could create remote.<name>.restic_option which would contain an option string (e.g. remote.<name>.restic_option = rclone.program='ssh backup-host forced-command'). I recommend specifying a single option because git config keys can be specified multiple times, and then you don't have to invent a quoting system.
  3. Call options.Parse to parse them; apply them to the config.

I would be willing to review a PR that added this kind of behavior.

CGamesPlay avatar Oct 21 '24 00:10 CGamesPlay

That sound like a good idea! I will look into it.

tionis avatar Oct 21 '24 12:10 tionis