Commit graph

375 commits

Author SHA1 Message Date
TW
5e2da157be
Merge pull request #9769 from ThomasWaldmann/docs-key-subcommands
docs: add docs for "key add", "key list" and "key remove"
2026-06-13 23:47:58 +02:00
Thomas Waldmann
d5cd72b179 docs: add docs for "key add", "key list" and "key remove"
The multi-key feature (#9743) added the "borg key add", "borg key list"
and "borg key remove" subcommands but never wired up their docs:

- scripts/make.py: map key_add/key_list/key_remove to the "key" usage
  group, so build_man can locate their examples (it previously aborted
  with FileNotFoundError: docs/usage/key_add.rst).
- docs/usage/key.rst: include the three new generated snippets so they
  show up on the HTML key page.
- regenerate the affected docs: new key_{add,list,remove}.rst.inc usage
  snippets, new borg-key-{add,list,remove}.1 man pages, and borg-key.1
  (SYNOPSIS + SEE ALSO now reference the new subcommands).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 21:37:21 +02:00
Thomas Waldmann
8f4231d21b key: allow --key-location for authenticated* modes
The authenticated and authenticated-blake3 modes do not encrypt data, but
they still have a real key (id/auth key material) stored as a key blob.
That blob can live as a keyfile or as a repokey just like the encrypted
modes, so make it configurable instead of always forcing repokey storage.

- AuthenticatedKeyBase: set LOCATION_CONFIGURABLE = True so --key-location
  (at repo-create) and "borg key change-location" apply.
- key change-location: only copy sessionid/cipher when present (those are
  AEAD-only; authenticated keys do not have them).
- repo-info: report the key storage location for authenticated keys too,
  and handle the authenticated-blake3 variant (was only "authenticated").
- repo-create help: stop claiming authenticated* has no keyfile/repokey
  storage; only "none" truly has no key.
- add change-location round-trip tests for authenticated mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:57:26 +02:00
Thomas Waldmann
d2bc45f56d
key: unify keyfile/repokey classes, locate key independent of type byte (#9743)
Borg used to read the manifest's key-type byte and then look for the key in
exactly one place (keyfile or repokey) depending on the key class that byte
selected. As a result every crypto suite was duplicated into a keyfile class
and a repokey class that differed only in TYPE, NAME, ARG_NAME and STORAGE.

Now key *location* is independent of the type byte: detection tries keyfiles
first and repokeys afterwards until a passphrase unlocks a key. The type byte
still selects the crypto suite (id hash, MAC, cipher) to instantiate. Where a
key is stored (keyfile vs repokey) is therefore a per-key property
(self.storage), not a separate class, so a repository may even hold a mix of
keyfile- and repo-stored borg keys.

With storage decoupled from class identity, the keyfile/repokey class pairs
collapse into one class per crypto suite:
- modern AEAD: AESOCBKey, CHPOKey, Blake3AESOCBKey, Blake3CHPOKey
- legacy borg 1.x (read-only): AESCTRKey, Blake2AESCTRKey
There is now exactly one type byte per modern crypto suite (the old separate
repokey type bytes 0x11/0x21/0x31/0x41 were removed; borg2 is beta and only
needs to read repos it created). identify_key() matches on TYPES_ACCEPTABLE.

CLI: --encryption selects only the crypto suite (aes-ocb, chacha20-poly1305,
blake3-aes-ocb, blake3-chacha20-poly1305, authenticated*, none); the storage
location is chosen with the new --key-location=repokey|keyfile (default
repokey). The old combined modes (repokey-aes-ocb etc.) were removed.
borg key import also gained --key-location. borg key change-location no longer
swaps key classes or rewrites the manifest; it just re-saves the unlocked key
at the new location.

Keyfile removal (key remove, change-location) now overwrites the keyfile with
random data via secure_erase() before unlinking, consistent with save().

borg 1.x legacy read compatibility is preserved (the legacy class merge is a
behavior-preserving rename; the legacy type bytes incl. PASSPHRASE stay in
TYPES_ACCEPTABLE).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 23:48:45 +02:00
Thomas Waldmann
5eab183183
remove leftover socket: protocol code
The unix-socket transport (socket:// repositories, the --socket option and
"borg serve" over a socket) was never part of a stable borg 2 release and the
old RPC protocol it relied on is gone, so the remaining code was dead:

- legacy remote: drop the unreachable proto == "socket" connection branch and
  the now-unused self.sock handling, "import socket" and get_socket_filename
  import (LegacyRemoteRepository is only built for proto == "ssh")
- helpers: remove get_socket_filename() and its export
- parseformat: drop "socket" from local_path_re - socket:// is now treated like
  any other unknown scheme (a local path) rather than being special-cased
- tests: drop test_socket and the self.sock check in the legacy reopen helper
- docs: drop the stale --socket entry from the manually maintained
  common-options.rst.inc (the auto-generated usage/man docs are left untouched
  here and will be rebuilt in a separate commit)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 18:51:55 +02:00
Thomas Waldmann
ff6d0e8775
fix typos / grammar in transfer docs 2026-06-06 19:34:46 +02:00
Thomas Waldmann
5d8b761a6c
crypto: integrate blake3, blake2b is legacy, fixes #8867
BLAKE3 is generally faster and provides a more modern construction for
keyed hashing (using its internal keyed mode instead of the construction
used for BLAKE2b).

Key types changed:
- authenticated-blake2 -> authenticated-blake3
- {keyfile,repokey}-blake2-aes-ocb -> {keyfile,repokey}-blake3-aes-ocb
- {keyfile,repokey}-blake2-chacha20-poly1305 -> {keyfile,repokey}-blake3-chacha20-poly1305

This also fixes the slightly unusual way how we used blake2b,
it is only supported for importing borg 1.x repos.

New repos either use HMAC-SHA256 or BLAKE3.
2026-06-06 19:34:45 +02:00
Thomas Waldmann
39ac734b9c
support "rest:" repository URLs, fixes #9593
That is borgstore's REST http over stdio (over ssh, if a host is given).
2026-06-01 21:11:55 +02:00
Thomas Waldmann
05994d2e4e
docs: update to 'borg key change-passphrase' in env help, fixes #9697 2026-06-01 20:55:56 +02:00
Thomas Waldmann
6cfb90dae9
repo-compress: remove this command for now
for packs, this needs to get implemented differently to perform well.
processing needs to be pack-after-pack and the index needs to be
updated correctly and carefully, e.g. considering interruptions
of repo-compress.
2026-05-22 13:00:13 +02:00
Hugo Wallenburg
c8f8defc0f
Fixes tests/docs assuming XDG_* vars not used on macOS
The move to platformdirs and its current usage _does_ honor XDG_*
variables on macOS if they are set. Tests were set up to assume this to
be untrue and the docs matched that.

This commit adds tests asserting that XDG_* variables are used when they
are present on macOS, with default locations still in ~/Library.
2026-04-03 11:34:10 +02:00
Thomas Waldmann
f12f67a76d
build_usage build_man 2026-03-15 14:37:50 +01:00
Thomas Waldmann
4f2f2255c3
create --paths-from-shell-command, fixes #5968
This adds the `--paths-from-shell-command` option to the `create` command, enabling the use of shell-specific features like pipes and redirection when specifying input paths. Includes related test coverage.
2026-03-10 20:16:26 +01:00
Thomas Waldmann
f2bdb689c5
improve configuration precedence docs 2026-03-10 18:36:34 +01:00
Thomas Waldmann
678df16bad
add support for auto-generated environment variables (jsonargparse) 2026-03-10 18:36:31 +01:00
Thomas Waldmann
63a45c6c21
add support for yaml config files, default config 2026-03-10 18:36:30 +01:00
Thomas Waldmann
dd38e2c2df
docs: archive specification, FAQ, fixes #9248, fixes #9053 2026-03-06 21:36:05 +01:00
Mrityunjay Raj
02f447536c docs: document platformdirs change and platform-specific directory paths, fixes #7332 2026-02-27 11:50:35 +05:30
Thomas Waldmann
0b05b44c0a
rename BORG_RLIST_FORMAT to BORG_REPO_LIST_FORMAT, #9411 2026-02-24 10:42:50 +01:00
defnvary
4344eb37d1 use zstd from python stdlib or backport.zstd, closes #9261 2026-02-23 00:33:21 +05:30
Rohan salunke
179b5cdd92
Regenerate usage docs from current CLI help source
This also fixes #8146 (experimental markings in docs).
2026-02-22 11:50:58 +01:00
Thomas Waldmann
4073bb263f
fix S3 url description, fixes #9249
- profile also must be followed by @
- in URL specs, it is "scheme", not "schema"
- note that the scheme is usually https
2026-01-28 12:12:26 +01:00
Thomas Waldmann
fcbf7f3572
build_usage build_man 2025-12-23 18:00:09 +01:00
Thomas Waldmann
43c7878a56
docs: update installation requirements and BORG_FUSE_IMPL about mfusepy 2025-12-20 19:31:51 +01:00
TW
1b9779b4f3
Merge pull request #9162 from ThomasWaldmann/docs/archive-series-note-8955
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled
docs: highlight archive series naming for fast incrementals (fixes #8955)
2025-11-18 02:11:46 +01:00
Thomas Waldmann
15f59233b5
completion: borg can now generate completion scripts for supported shells, fixes #9172
Added `shtab` dependency for shell completion functionality:
- bash completion (works).
- zsh completion (known-broken due to iterative/shtab#183).
2025-11-17 18:47:00 +01:00
Thomas Waldmann
71ca0ac6a7
docs: add prominent note to borg create about archive series and files cache; recommend stable NAME per series for performance (#8955) 2025-11-10 02:37:55 +01:00
Thomas Waldmann
5c44dad125
diff --sort-by: enhanced sorting, fixes #8998
use borg diff --sort-by=spec1,spec2,spec2 for enhanced sorting.

remove legacy --sort behaviour (sort by path), this was deprecated
since 1.4.2.

Co-authored-by: Daniel Rudolf <github.com@daniel-rudolf.de>

This is a port of #9005 to master branch.
2025-11-03 19:25:02 +01:00
Thomas Waldmann
7e6dea9408
BORG_MSGPACK_VERSION_CHECK=no to disable the version check, fixes #9109
(cherry picked from commit 2d63dc9a4f)
2025-11-01 16:48:00 +01:00
Atemu
fdabbd7633
extract: document how to use wildcards in PATHs
Fixes https://github.com/borgbackup/borg/issues/8589
2025-10-10 11:20:08 +02:00
Thomas Waldmann
2c7bec0149
manual corrections/reverts 2025-09-23 14:56:35 +02:00
Thomas Waldmann
3120f9cd1c
fixed typos and grammar (AI)
this was done by Junie AI.
2025-09-23 14:56:23 +02:00
Thomas Waldmann
f327af11a6
build_usage build_man 2025-08-02 11:12:20 +02:00
Thomas Waldmann
9b26b1011a
build_usage build_man 2025-06-18 17:35:37 +02:00
Thomas Waldmann
7741b503ad
reformat text 2025-06-09 14:19:14 +02:00
Thomas Waldmann
c850f508f8
fix grammar 2025-06-09 14:19:12 +02:00
TW
f3cfc72b9d
Merge pull request #8331 from qyanu-pull-requests/3818simplifyexport-master
docs: borg-serve: simplify example of env in authorized_keys
2025-06-09 14:17:46 +02:00
Thomas Waldmann
81bacd04c5
docs: add docs for serve --permissions / BORG_REPO_PERMISSIONS 2025-06-08 13:49:09 +02:00
Thomas Waldmann
6e548ed1f0
build_man build_usage 2025-05-19 23:20:38 +02:00
Thomas Waldmann
7644b04df2
docs: remove outdated docs/man files about borg change-passphrase
this is borg key change-passphrase now.
2025-05-19 23:18:19 +02:00
Vaskebjoern
15e55bfd2e
docs: add S3/B2 urls to documentation for repository urls, fixes #8833 2025-05-19 10:41:07 +02:00
Thomas Waldmann
524d927871
build_usage build_man 2025-05-06 01:37:17 +02:00
Thomas Waldmann
bcb178418e
BORG_DEBUG_PASSPHRASE: also show "other" env vars, docs 2025-05-05 21:21:38 +02:00
Thomas Waldmann
ae4aaa96b9
better support other repo by misc. passphrase env vars, fixes #8457
- borg repo-create and borg transfer not only support --repo / --other-repo options,
  but also already supported related BORG_REPO and BORG_OTHER_REPO env vars.
- similar to that, the passphrases now come from BORG_[OTHER_]PASSPHRASE, BORG_[OTHER_]PASSCOMMAND or BORG_[OTHER_]PASSPHRASE_FD.
- borg repo-create --repo B --other-repo A does not silently copy the passphrase of key A
  to key B anymore, but either asks for the passphrase or reads it from env vars.
2025-05-05 21:09:31 +02:00
Thomas Waldmann
477e8f53fb
build_man build_usage 2025-04-28 21:42:30 +02:00
Thomas Waldmann
9e6d90754e
remove remainders of append-only support
Some features like append-only repositories rely on a server-side component
that enforces them (because that shall only be controllable server-side,
not client-side).

So, that can only work, if such a server-side component exists, which is the
case for borg 1.x ssh: repositories (but not for borg 1.x non-ssh: repositories).

For borg2, we currently have:
- fs repos
- sftp: repos
- rclone: repos (enabling many different cloud providers)
- s3/b3: repos
- ssh: repos using client/server rpc code similar as in borg 1.x

So, only for the last method we have a borg server-side process that could enforce some features, but not for any of the other repo types.

For append-only the current idea is that this should not be done within borg,
but solved by a missing repo object delete permission enforced by the storage.

borg create could then use credentials that miss permission to delete,
while borg compact would use credentials that include permission to delete.
2025-04-28 18:55:15 +02:00
Thomas Waldmann
4550a49b0f
build_usage / build_man 2025-04-21 21:08:42 +02:00
vancheese
8df4bf75d4
docs: borg commands updated with --repo option, fixes #8550 2025-04-01 17:28:57 +02:00
Ken Kundert
45b8e629ac update prune documentation for new --keep-within intervals 2025-01-10 11:12:20 -08:00
Ken Kundert
b9498ca571
Allow timespan to be specified with common time units (#8626)
allow timespan to be specified with common time units, fixes #8624

Co-authored-by: Ken Kundert <ken@theKunderts.net>
2025-01-08 18:48:10 +01:00