borg2: Make `serve --rest` the default, move legacy support to a `--legacy` option
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 875
- Avg merge
- 11h 15m
- Merged PRs (30d)
- 192
Description
After the removal of the legacy RPC protocol with #9732 (with a few exceptions, see below), it might be worth considering making the REST protocol the default mode of `borg2 serve`.
At this point, client-side use of the legacy RPC protocol is limited to `borg2 transfer --from-borg1`, where it is only used to migrate an existing borg1 repo to borg2. On the server side, `borg2 serve` still supports serving a borg1 repo via the legacy RPC protocol so users do not need to keep a separate borg1 installation around during migration.
However, `borg2 serve` still defaults to the legacy RPC protocol and requires `--rest` to serve a borg2 repo via the new REST protocol. I suggest inverting this default: `borg2 serve` should serve a borg2 repo via the REST protocol by default. Serving a borg1 repo via the legacy RPC protocol should require an explicit option such as `--legacy`.
In general, legacy compatibility modes should require explicit opt-in, while the default behavior should reflect the current architecture.
The main downside is that existing SSH forced-command configurations would need to be adjusted. However, borg2 is already a breaking release, and the remaining legacy RPC support exists primarily to facilitate migration from borg1. Given that context, requiring an explicit compatibility flag for legacy operation seems reasonable.
Prior discussion: https://github.com/borgbackup/borg/issues/9593#issuecomment-4682065257
Related: #9765
Contributor guide
Assessment
This issue has not been assessed yet.