Commit Graph

587 Commits

Author SHA1 Message Date
Michael Eischer
394c8de502 add package to create a prepopulated backend registry 2025-10-12 17:56:28 +02:00
Rani
3ae6a69154 Bugfix(sftp): fix loose permissions on sftp backend. (#5497) 2025-10-03 18:20:52 +00:00
Michael Eischer
fd241b8ec7 Merge pull request #5527 from MichaelEischer/drop-s3-static-credentials
s3: drop manual credentials loading from environment
2025-10-03 19:57:55 +02:00
Michael Eischer
4dc71f24c5 backends: pass error logger to backends 2025-10-03 18:22:42 +02:00
Michael Eischer
a30a36ca51 s3: drop manual credentials loading from environment
credentials.EnvAWS offers a superset of the manually implemented
credentials loading. Rework the error message that is shown if no
credentials were found but either access or secret key are set.
2025-09-24 21:02:02 +02:00
Michael Eischer
7257cd2e5f extra linters 2025-09-21 22:24:35 +02:00
Michael Eischer
60d80a6127 Fix linter warnings 2025-09-21 22:24:15 +02:00
Michael Eischer
6ff7cd9050 backend/util: extract background handling code 2025-09-08 10:42:35 +02:00
greatroar
1ed93bd54d backend,termstatus: Unify foreground/background detection
PR #5358 reintroduced a version of the TIOCGPGRP ioctl call that works
on all Unix platforms except Linux, due to a bug/inconsistency in
x/sys/unix. This commit fixes that by introducing termstatus.Tcgetpgrp.

It also introduces termstatus.Getpgrp and termstatus.Tcsetpgrp to deal
with the different signature of unix.Getpgrp in Solaris vs. all other
Unix platforms and an int-overflowing constant on AIX, so that some
AIX/Solaris-specific code can be removed elsewhere and
foreground/background detection is done the same everywhere except on
Windows.
2025-09-08 09:33:44 +02:00
Michael Eischer
914bd699be backend: always start backend process in separate process group
The process group is necessary to properly handle ctrl-c.
2025-09-06 19:51:10 +02:00
Michael Eischer
4c19d6410f backend: only move child process to foreground if already in foreground
The rclone and sftp backends require starting a child process. The are
first moved into the foreground and back into the background after the
initial startup is done.

However, this behavior is also active if restic itself is started in the
background. In this case, restic changing the foreground process may
confuse the shell and in case of bash causes it to exit. Thus, disable
modification of the controlling process group of the tty if restic is
run in the background.
2025-09-06 19:51:10 +02:00
Dominik Schulz
48e5c0984e Mark HTTP Error 507 as permanent
This change classifies HTTP error 507 (Insufficient Storage) as a
permanent error that should not be retried. I keep running into
this once in a while and there is literally no point in retrying when
the server is full.

Fixes #5429

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-05 19:04:16 +02:00
Michael Terry
a8535aba58 backend/local: ignore chmod "not supported" errors 2025-06-02 17:44:30 -04:00
Gilbert Gilb's
eefff0d793 docs: fix unit for S3 restore timeout
"d" is not a valid unit.
2025-03-27 21:20:50 +01:00
Michael Eischer
9eee32131a Merge pull request #5307 from Martin2112/dial_tls
Replace deprecated DialTLS with DialTLSContext.
2025-03-25 18:12:10 +01:00
Michael Eischer
0b22d8dc64 Merge pull request #5306 from MichaelEischer/sftp-better-errors
sftp: improve error messages
2025-03-24 18:43:47 +01:00
Martin Smith
47b048f437 Rename param as it looks like context isn't used. 2025-03-24 15:01:47 +00:00
Martin Smith
cd7f384d77 Replace deprecated DialTLS with DialTLSContext. 2025-03-24 14:05:13 +00:00
Michael Eischer
9aad8e9ea5 Merge pull request #5299 from Martin2112/go_cleanup
A few more small cleanups that should not change behaviour.
2025-03-24 13:59:39 +01:00
Michael Eischer
3adf7d4efb backend/sftp: wrap further errors 2025-03-24 12:45:15 +01:00
Michael Eischer
66ec735ac2 backend/sftp: include file path in error messages 2025-03-24 12:44:42 +01:00
Michael Eischer
63a71f70e3 backend/sftp: ensure all errors are wrapped with the method name 2025-03-24 12:32:52 +01:00
Michael Eischer
4b975bda37 backend/s3: increase timeout for test initialization 2025-03-23 17:28:08 +01:00
Michael Eischer
f8b481fd9b backend/s3: resolve credential retrieval deprecation 2025-03-23 17:28:08 +01:00
Michael Eischer
4350b95d27 backend/test: fix delayedRemoval timeout handling
The timeout for all blobs starts to run after the delete calls have been
issue. Thus, use the same start time for all blobs instead of individual
timeouts.
2025-03-23 16:36:31 +01:00
Michael Eischer
2e58561ad6 backend/test: remove redundant test call to the backend 2025-03-23 16:36:31 +01:00
Michael Eischer
17b585f7c7 backend/test: partially parallelize delayedRemove 2025-03-23 16:36:31 +01:00
Michael Eischer
4640b3c41a backend/test: parallelize slow tests 2025-03-23 16:36:31 +01:00
Martin Smith
4420fde378 Remove deprecated HTTP option that is now the default. 2025-03-23 10:10:54 +00:00
Martin Smith
f238f81ba6 Renames to fix clashes with reserved words. 2025-03-22 18:20:30 +00:00
Martin Smith
3788605127 Rename unused parameters to '_'. 2025-03-22 18:20:30 +00:00
Martin Smith
092899df8b Remove unnecessary type conversions. 2025-03-22 18:20:30 +00:00
Martin Smith
db8daeb192 Fix godoc comments. 2025-03-22 18:20:30 +00:00
Michael Eischer
445477312c Merge pull request #5251 from MichaelEischer/rclone-retries
Retry temporary rclone backend errors
2025-03-22 14:24:47 +01:00
Luz Paz
794341a494 doc: fix various typos
Found via `codespell -q 3 -L atleast,iinclude,ist,programm,reenable,ser,uptodate`
2025-03-05 20:47:08 -05:00
Michael Eischer
5e7ce45ede retry: test error retries for flaky backends 2025-02-16 22:56:43 +01:00
Michael Eischer
cb8575f001 rclone: remove redundant Warmup methods 2025-02-16 22:41:22 +01:00
Michael Eischer
8d1185b3b8 retry/rclone: retry errors up to 5 times 2025-02-16 22:40:55 +01:00
Michael Eischer
c970e58739 backend: refactor backend Connections and HasAtomicReplace into Properties 2025-02-16 22:27:58 +01:00
Gilbert Gilb's
536ebefff4 feat(backends/s3): add warmup support before repacks and restores (#5173)
* feat(backends/s3): add warmup support before repacks and restores

This commit introduces basic support for transitioning pack files stored
in cold storage to hot storage on S3 and S3-compatible providers.

To prevent unexpected behavior for existing users, the feature is gated
behind new flags:

- `s3.enable-restore`: opt-in flag (defaults to false)
- `s3.restore-days`: number of days for the restored objects to remain
  in hot storage (defaults to `7`)
- `s3.restore-timeout`: maximum time to wait for a single restoration
  (default to `1 day`)
- `s3.restore-tier`: retrieval tier at which the restore will be
  processed. (default to `Standard`)

As restoration times can be lengthy, this implementation preemptively
restores selected packs to prevent incessant restore-delays during
downloads. This is slightly sub-optimal as we could process packs
out-of-order (as soon as they're transitioned), but this would really
add too much complexity for a marginal gain in speed.

To maintain simplicity and prevent resources exhautions with lots of
packs, no new concurrency mechanisms or goroutines were added. This just
hooks gracefully into the existing routines.

**Limitations:**

- Tests against the backend were not written due to the lack of cold
  storage class support in MinIO. Testing was done manually on
  Scaleway's S3-compatible object storage. If necessary, we could
  explore testing with LocalStack or mocks, though this requires further
  discussion.
- Currently, this feature only warms up before restores and repacks
  (prune/copy), as those are the two main use-cases I came across.
  Support for other commands may be added in future iterations, as long
  as affected packs can be calculated in advance.
- The feature is gated behind a new alpha `s3-restore` feature flag to
  make it explicit that the feature is still wet behind the ears.
- There is no explicit user notification for ongoing pack restorations.
  While I think it is not necessary because of the opt-in flag, showing
  some notice may improve usability (but would probably require major
  refactoring in the progress bar which I didn't want to start). Another
  possibility would be to add a flag to send restores requests and fail
  early.

See https://github.com/restic/restic/issues/3202

* ui: warn user when files are warming up from cold storage

* refactor: remove the PacksWarmer struct

It's easier to handle multiple handles in the backend directly, and it
may open the door to reducing the number of requests made to the backend
in the future.
2025-02-01 18:26:27 +00:00
Michael Eischer
14d02df8bb Merge pull request #5162 from MichaelEischer/promote-feature-gates
Stabilize `explicit-s3-anonymous-auth` and `safe-forget-keep-tags` feature flags
2025-01-13 22:03:06 +01:00
Michael Eischer
098db935f7 Stabilize explicit-s3-anonymous-auth and safe-forget-keep-tags flags
The features can no longer be disabled.
2024-11-30 21:22:51 +01:00
Richard Grover
dfbd4fb983 Error if AZURE_ACCOUNT_NAME not set 2024-11-13 08:02:22 -07:00
Michael Eischer
1133498ef8 Merge pull request #5046 from konidev20/fix-gh-4521-azure-blob-storage-add-support-for-access-tiers
azure: add support for access tiers hot, cool and cold
2024-11-11 22:01:52 +01:00
Michael Eischer
569a117a1d improve fprintf related error handling 2024-11-01 17:07:43 +01:00
Michael Eischer
ded9fc7690 Merge pull request #5101 from MichaelEischer/sftp-load-error
sftp: check for broken connection in Load/List operation
2024-11-01 16:05:29 +01:00
Michael Eischer
71c185313e sftp: check for broken connection in Load/List operation 2024-11-01 15:33:27 +01:00
Michael Eischer
58dc4a6892 backend/retry: hide final log for stat() method
stat is only used to check the config file's existence. We don't want
log output in this case.
2024-11-01 15:17:54 +01:00
Srigovind Nayak
db686592a1 debug: azure add debug log to show access-tier 2024-10-20 20:24:49 +05:30
Srigovind Nayak
bff3341d10 azure: add support for hot, cool, or cool access tiers 2024-10-20 15:27:21 +05:30