Commit Graph
1214 Commits
Author SHA1 Message Date
JUSHUANGHUI LI d7aa4145e0 global: reject empty repository location files (#22052)
Return a fatal error before opening or creating a repository when its location file is empty after decoding and trimming whitespace.
2026-11-15 19:03:50 +00:00
Michael Eischer 335d7e38aa Merge pull request #22130 from junkerderprovinz/fix/issue-22112
stats: keep progress counters across snapshots
2026-11-15 20:01:16 +01:00
Rob MartinandMichael Eischer 2c9b353cbf repository: do not delete config on atomic backends during upgrade rollback (#22136)
In UpgradeRepo, if upgradeRepository fails, the error handler attempts
contingency rollback by re-uploading the original config file.

However, the contingency path unconditionally executed repo.be.Remove(ctx, h)
before calling repo.be.Save. On backends supporting atomic replacement (such
as local filesystems), a failed upgrade (e.g. out-of-disk-space or permissions
error while writing the temporary file) leaves the original, valid version 1
configuration file completely intact on disk.

Unconditionally removing the config file during rollback actively deletes
the working configuration. If the subsequent Save call also fails, the
repository is left permanently corrupted without a config file.

Condition the pre-removal on !repo.be.Properties().HasAtomicReplace, matching
the forward upgrade path in upgradeRepository. Add a unit test asserting that
aborted upgrades on atomic backends preserve the intact original configuration.

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-15 18:57:01 +00:00
Dean Chen 4dfa381b9f restorer: don't delete files when a directory tree can't be loaded (#22189)
When loading or iterating a directory tree failed, traverseTreeInner
returned a nil file list together with the error. If the error handler
ignored the error, the caller still called leaveDir with that nil list,
and restore --delete removed every existing entry of the directory in
the target, even though the expected content was simply unknown.

Force disable deletion in that case, the same way it is already done
for invalid node names.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-11-15 19:50:17 +01:00
Younes Beriane c4f9e50609 restorer: rewrite partially matching hard-linked files in full (#22086) 2026-11-15 18:40:11 +00:00
Michael Eischer 516c8d32e0 Merge pull request #22117 from Grivn/fix/legacy-null-tree
data: read empty trees from older repaired snapshots
2026-11-15 19:27:39 +01:00
Michael Eischer 6619ac9620 prune: drop test already covered by unit test 2026-11-15 19:14:35 +01:00
Michael Eischer 354f6aeed6 Untangle and clarify the contributing guide (#22169)
* Small typos and clarification in contributing guide

* cross-link contributing guide and issue/pr template

* drop GOPATH mention

* don't include merge commits in PRs

* make high review delays explicit

* explicitly ask for link to current PR in changelog template

* clarify docs changes

* use bug template as authoritative place'

* consolidate development information in 090_participating

Also move issue / PR creation relevant information into contributing.md.

* clarify meaning of assigning to a pull request

* link to minimum go version

* minor typos

* golanci-lint is always applied in full

* add micro summary

* more typo fixes

* always run golangci-lint

* Simplify issue/pr template

* Fix IRC webchat link

* Move security policy to SECURITY.md

* address review comments
2026-11-15 17:40:08 +01:00
Junker der Provinz e9a07fd773 changelog: link the pull request 2026-11-06 01:09:05 +01:00
John Maguire 7f6d8acb85 backend/b2: Support Multi-Bucket Application Keys (#22104) 2026-11-05 20:52:49 +00:00
Michael Eischer 068a324dcd Merge pull request #22124 from pujitha24/auto/issue-22120
prune: report failure to list pack files as a fatal error
2026-11-05 21:24:23 +01:00
Wei-Lun Li 9a0b9e0eb5 data: return an error for too large numbers in ParseDuration (#22163) 2026-11-05 19:36:49 +00:00
subomiandMichael Eischer 83a2726a30 s3: add option to disable AWS dual-stack endpoints (#22060)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-05 19:07:43 +00:00
Junker der ProvinzandWinfried Plappert 84c2d0223f stats: keep progress counters across snapshots
The file, blob and size counters were reset for every snapshot, so the
progress line only reflected the last processed snapshot.

Co-authored-by: Winfried Plappert <18740761+wplapper@users.noreply.github.com>
2026-10-21 22:44:24 +02:00
Pujitha Paladugu bba1b68082 prune: report failure to list pack files as a fatal error
Motivation: when listing pack files fails during prune (for example due
to a request timeout), the error was returned unwrapped and main printed
it with "%+v", which dumps a stack trace. As discussed in the issue, the
error needs one more level of wrapping before it can be treated as a
fatal error.

Approach: in decidePackAction, wrap an error from listing pack files
with errors.Fatalf("failed to list pack files: %v"). Errors that are
already fatal (e.g. ErrSizeNotMatching) and errors after context
cancellation are returned unchanged. The underlying error is preserved
via Unwrap. Retry log messages are unchanged; only the final error
output is shortened and says where the failure occurred.

Validation: `go test ./internal/repository/ -run Prune` and
`go test ./cmd/restic/ -run Prune` pass. The new test
TestPrunePackListError (backend whose pack list fails) fails without
the change and passes with it. I did not reproduce a real REST backend
timeout.

Report: https://github.com/restic/restic/issues/22120
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)
2026-10-18 12:58:49 -07:00
Michael Eischer cb1d66a398 add changelog go version bump 2026-10-17 22:57:11 +02:00
Grivn d714e22605 data: read empty trees from older repaired snapshots
Older repair snapshots versions serialized missing subtrees as nodes:null.
The streaming decoder rejects these trees, preventing prune and other
commands from traversing snapshots that previous releases could read.

Accept null as an empty node list. Add decoder coverage and a regression
that prunes, checks and restores a snapshot with a legacy empty subtree.
2026-10-16 01:58:41 +08:00
Sergey Kolomiichuk ab17711e31 selfupdate: replace deprecated golang.org/x/crypto/openpgp with ProtonMail/go-crypto (#21997) 2026-09-20 18:33:24 +00:00
Etienne D ba802d42b7 fix(swift): store APIKey as SecretString to prevent debug log leak (#22007) 2026-08-29 20:11:48 +00:00
Arpit Jain 8baffc4027 repository: reject key and config files that are too short (#21977)
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-07-22 20:38:07 +00:00
Matthias Dötsch 905ca56ee8 Address review feedback on #21937:
- addToPacks now returns uint32 directly and the value is passed through
  store() to indexMap.add unchanged, instead of casting between int and
  uint32.
- merge() appends idx2.packs to idx.packs without going through
  addToPacks, so it now checks the pack count against the uint32 limit
  itself + error if exceeded.
- optimize changelog message
2026-07-13 07:25:08 +02:00
Matthias Dötsch e428de5f84 Reduce in-memory index entry size by storing packIndex as uint32
Each blob in a repository requires one index entry in memory, which is one
of the largest contributors to restic's memory usage. The indexEntry.packIndex
field, an index into the per-Index packs slice, was stored as a machine-word
int (8 bytes on amd64) although the value is always a small array index.

Store it as a uint32 instead. This shrinks indexEntry from 64 to 56 bytes on
64-bit platforms (56 % 8 == 0, so no padding is added), reducing index memory
by roughly 12% -- about 100 MB for a repository with ~13 million blobs, as
confirmed by profiling. uint32 allows 4.29 billion packs (>30 billion blobs at
the assumed 8 blobs/pack), far beyond any real repository; addToPacks guards
against overflow defensively. The on-disk repository format is unaffected.
2026-07-08 06:01:15 +00:00
Michael Eischer d8ef26afa4 Merge branch 'patch-release' 2026-07-05 16:27:43 +02:00
Alexander Neumann 09a1eb6714 Prepare changelog for 0.19.1 2026-07-05 09:52:30 +02:00
Winfried PlappertandMichael Eischer 75de8b54e6 restic check and restic repair packs: treat missing packfiles the same as damaged and truncated packfiles (#21845)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-06-28 12:09:42 +02:00
Winfried PlappertandMichael Eischer 9e1a526611 Fix broken snapshots via restic repair snapshots --forget (#21907)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-06-27 22:09:10 +02:00
Michael Eischer 9670cd7459 find: fix fallback to index if pack cannot be listed
`find` would only look up completely missing pack files in the index. A
still existing but broken pack file would result in an error.
2026-06-26 22:16:55 +02:00
Gilbert Gilb's db03aed816 feat(backends/s3): add warmup support for check command (#5248) 2026-06-25 20:46:55 +02:00
Michael Eischerandrawtaz fc422d4145 Apply suggestions from code review
Co-authored-by: rawtaz <rawtaz@users.noreply.github.com>
2026-06-24 19:30:11 +02:00
Michael Eischer f058670219 polish changelogs 2026-06-23 19:55:12 +02:00
Ricardo Sawir 32be2e559b fuse: reset treeCache on snapshot reload to fix stale latest symlink (#21873)
The treeCache in SnapshotsDir was never cleared when snapshots were
reloaded. This caused the "latest" symlink to keep pointing to the
previous snapshot even after new snapshots were added.

Add a generation counter to SnapshotsDirStructure that is incremented
whenever the directory structure is rebuilt (in makeDirs). The
treeCache checks this generation on each lookup and resets itself
when the generation changes, ensuring cached nodes (including symlinks)
are refreshed after a snapshot reload.
2026-06-23 19:26:29 +02:00
Eyüp Can Akman add4fa1efb backup: skip source paths that cannot be accessed (#21852) 2026-06-23 19:26:13 +02:00
Michael Eischer c7c3414641 archiver: ignore duplicate but excluded directory entry (#21900) 2026-06-23 19:26:10 +02:00
Michael Eischer 8ef295e2f5 snapshots: revert default --lastest behavior to pre-0.19.0
the changed behavior now only applies when using `--group-by`.
2026-06-23 19:15:14 +02:00
Michael Eischer debf95f58d backend/sftp: fix removing files on windows sftp 2026-06-23 19:14:54 +02:00
Michael Eischer cb24c4f566 snapshots: show location name instead of current timezone (#21877) 2026-06-23 19:11:19 +02:00
Michael Eischer d6fd4ae26f mount: fix crash in mountpoint validation (#21879) 2026-06-23 19:09:57 +02:00
Michael Eischer 4134bdfac2 stats: hide progress bar for json output (#21871) 2026-06-23 19:08:36 +02:00
Srigovind Nayak 82a665384b chore: update changelog for issue 5234 2026-06-23 19:08:12 +02:00
Ricardo Sawir 55e335ec6c fuse: reset treeCache on snapshot reload to fix stale latest symlink (#21873)
The treeCache in SnapshotsDir was never cleared when snapshots were
reloaded. This caused the "latest" symlink to keep pointing to the
previous snapshot even after new snapshots were added.

Add a generation counter to SnapshotsDirStructure that is incremented
whenever the directory structure is rebuilt (in makeDirs). The
treeCache checks this generation on each lookup and resets itself
when the generation changes, ensuring cached nodes (including symlinks)
are refreshed after a snapshot reload.
2026-06-22 18:31:51 +00:00
Winfried Plappert d30d6b6281 backup - show excluded files and directories in verbose mode - text/JSON (#21887) 2026-06-21 16:11:42 +00:00
Eyüp Can Akman 8d7679c831 backup: skip source paths that cannot be accessed (#21852) 2026-06-21 17:16:16 +02:00
Michael Eischer d9dd1b7534 archiver: ignore duplicate but excluded directory entry (#21900) 2026-06-21 15:49:08 +02:00
Michael Eischer 369da8a770 snapshots: revert default --lastest behavior to pre-0.19.0
the changed behavior now only applies when using `--group-by`.
2026-06-21 15:28:22 +02:00
Michael Eischer 28521d27c1 Merge pull request #21897 from MichaelEischer/sftp-fix-chmod
backend/sftp: fix removing files on windows sftp
2026-06-20 19:29:49 +02:00
Winfried PlappertandMichael Eischer 284daaf0b4 restic list pack snapshotID - create lists of packfiles for a given snapshot as text (#5396)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-06-20 15:46:44 +00:00
Michael Eischer 203e595ccb backend/sftp: fix removing files on windows sftp 2026-06-19 23:23:01 +02:00
Michael Eischer 0536e15bbf snapshots: show location name instead of current timezone (#21877) 2026-06-14 14:02:20 +02:00
Michael Eischer ae96b2a0f8 mount: fix crash in mountpoint validation (#21879) 2026-06-14 13:55:26 +02:00
Michael Eischer bae49d00ee stats: hide progress bar for json output (#21871) 2026-06-13 15:13:26 +02:00