Support specifying restic options
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?
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:
- Use a named git remote. Now running
git push <name>will rungit-remote-retic <name> <url>. - The tool can then read any additional keys from the git config, for example we could create
remote.<name>.restic_optionwhich 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. - 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.
That sound like a good idea! I will look into it.