Aneesh Nireshwalia
8f49cdbb86
Merge remote-tracking branch 'old-origin/master' into add-smb-backend
2023-03-15 15:29:22 -06:00
Michael Eischer
7c8a401d97
Merge pull request #4176 from LXGaming/fix/impostor
...
Fix scan_finished JSON MessageType
2023-03-12 12:14:40 +01:00
greatroar
a7786c67f1
cmd, restic: Refactor and fix snapshot filtering
...
This turns snapshotFilterOptions from cmd into a restic.SnapshotFilter
type and makes restic.FindFilteredSnapshot and FindFilteredSnapshots
methods on that type. This fixes #4211 by ensuring that hosts and paths
are named struct fields instead of unnamed function arguments in long
lists of such.
Timestamp limits are also included in the new type. To avoid too much
pointer handling, the convention is that time zero means no limit.
That's January 1st, year 1, 00:00 UTC, which is so unlikely a date that
we can sacrifice it for simpler code.
2023-02-19 15:04:25 +01:00
Aneesh Nireshwalia
4b0f27a0b8
Correct help for default smb Connections to 5
2023-02-15 14:20:47 -07:00
Alex Thomson
4cbbf5d952
Fix scan_finished JSON MessageType
...
Corrected the scan_finished JSON MessageType from status to verbose_status
2023-02-10 23:45:20 +01:00
Michael Eischer
acb40d2b94
Refactor group-by to parse options into a struct
2023-02-10 23:18:14 +01:00
Aneesh Nireshwalia
2882872736
Fix SMB test setup for Mac
2023-02-08 15:10:51 -07:00
Aneesh Nireshwalia
c9dba2cdd7
Use connection pointer directly in putConnection
...
Setting *pc back to nil is too easily defeated to be useful.
This is more concise and prevents pointer from getting heap-allocated.
2023-02-05 07:41:58 -07:00
Aneesh Nireshwalia
a3e9be1656
Increase default max SMB connections to 5
2023-02-04 23:01:01 -07:00
Aneesh Nireshwalia
d062a82896
Correct formatting
2023-02-01 01:36:05 -07:00
Aneesh Nireshwalia
46c26643a7
Add SecretString support for options
2023-02-01 01:34:34 -07:00
Aneesh Nireshwalia
aab8a5f36f
Move copyright notice below imports
2023-01-31 17:48:36 -07:00
Aneesh Nireshwalia
59ecedacaf
Fix review comments for temp file creation
...
Add rclone copyright notice for smb files.
Change temp file creation code to match sftp code.
Remove fastrand dependency.
2023-01-31 17:35:18 -07:00
Aneesh Nireshwalia
3f1673d6aa
Fix lint issues
2023-01-30 21:03:27 -07:00
Aneesh Nireshwalia
5ff9f58fbb
Add document and cleanup config
...
Add documentation for configuring smb repository.
Clean up configuration for smb. Renamed address to host.
Add option to configure user in smb repo url as well.
Options take highest precendence.
2023-01-30 19:45:37 -07:00
Aneesh Nireshwalia
46c3dc618a
Add unrelease issue and cleanup configs
...
Removed extra environment variables
2023-01-30 16:46:52 -07:00
Aneesh N
375a9b7940
Add smb changes ( #6 )
...
* backend/smb: Add SMB backend and testcases
Add new SMB storage backend for restic.
Added test cases for testing SMB backend.
---------
Co-authored-by: Aneesh Nireshwalia <aneeshynot@gmail.com>
Co-authored-by: Srigovind Nayak <sgovind.dev@outlook.com>
2023-01-30 15:42:07 -07:00
greatroar
d129baba7a
repository: Reuse buffers in Repository.LoadUnpacked
...
This method had a buffer argument, but that was nil at all call sites.
That's removed, and instead LoadUnpacked now reuses whatever it
allocates inside its retry loop.
2023-01-30 22:01:01 +01:00
Michael Eischer
49fa8fe6dd
Merge pull request #4175 from fergus-dall/deadlock-fix
...
Fix deadlock in Lock.Stale
2023-01-26 22:45:13 +01:00
Michael Eischer
12f167ee79
Merge pull request #4167 from aneesh-n/progress-percent-eta-fix
...
ui/backup: Fix percent and eta in backup progress
2023-01-26 22:42:10 +01:00
Michael Eischer
bb018fbc3e
Merge pull request #4163 from MichaelEischer/fix-windows-self-upgrade
...
self-upgrade: Fix handling of `--output` on windows
2023-01-26 22:40:36 +01:00
Fergus Dall
04da31af2b
Fix deadlock in Lock.Stale
...
With debug logging enabled this method would take a lock and then
format the lock as a string. Since PR #4022 landed the string
formatting method has also taken the lock, so this deadlocks.
Instead just record the lock ID, as is done elsewhere.
2023-01-27 03:21:37 +11:00
Alexander Neumann
65923e9c26
Merge pull request #4152 from MichaelEischer/invalid-locks
...
Improve handling of invalid locks
2023-01-25 08:19:53 +01:00
Michael Eischer
e16a6d4c50
self-update: add basic test for extractToFile
2023-01-22 15:39:42 +01:00
Michael Eischer
34e67e3510
self-update: Fix handling of --output
on windows
...
The code always assumed that the upgrade happens in place. Thus writing
the upgrade to a separate file fails, when trying to remove the file
stored at that location.
2023-01-22 15:39:42 +01:00
Aneesh Nireshwalia
ed23edeb62
ui/backup: Fix percent and eta in backup progress
...
Added missing call to scanFinished=true.
This was causing the percent and eta to never get
printed for backup progress even after the scan was finished.
2023-01-21 13:25:08 -07:00
Michael Eischer
0f398b82e3
Merge pull request #4145 from greatroar/index-encode
...
index: Optimize generatePackList
2023-01-21 01:01:12 +01:00
greatroar
99755c634b
index: Optimize generatePackList
...
name old time/op new time/op delta
EncodeIndex/100-8 1.56ms ± 2% 1.48ms ± 3% -5.37% (p=0.000 n=10+10)
EncodeIndex/1000-8 14.5ms ± 2% 13.1ms ± 2% -9.49% (p=0.000 n=9+10)
EncodeIndex/10000-8 120ms ± 2% 116ms ± 2% -3.58% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
EncodeIndex/100-8 306kB ± 1% 275kB ± 1% -10.28% (p=0.000 n=10+10)
EncodeIndex/1000-8 3.69MB ±11% 2.88MB ± 5% -22.07% (p=0.000 n=10+9)
EncodeIndex/10000-8 35.9MB ±11% 31.9MB ±10% -11.13% (p=0.005 n=10+10)
name old allocs/op new allocs/op delta
EncodeIndex/100-8 3.39k ± 0% 2.39k ± 0% -29.61% (p=0.000 n=10+10)
EncodeIndex/1000-8 32.6k ± 0% 22.9k ± 0% -29.63% (p=0.000 n=10+9)
EncodeIndex/10000-8 326k ± 0% 229k ± 0% -29.71% (p=0.000 n=10+10)
The bulk of the allocation rate improvement comes from just removing the
debug.Log calls: every one of those copied a restic.ID to the heap.
2023-01-14 20:41:07 +01:00
Michael Eischer
57acc769b4
lock: Ignore empty lock files
...
These may be left behind by backends which do not guarantee atomic
uploads.
2023-01-14 18:15:46 +01:00
Michael Eischer
20ad14e362
lock: add help message how to recover from invalid locks
2023-01-14 18:04:22 +01:00
Michael Eischer
c995b5be52
lock: cleanup error message
...
The error message is now `Fatal: unable to create lock in backend:
[...]` instead of `unable to create lock in backend: Fatal: [...]`.
2023-01-14 17:57:02 +01:00
Michael Eischer
1adf28a2b5
repository: properly return invalid data error in LoadUnpacked
...
The retry backend does not return the original error, if its execution
is interrupted by canceling the context. Thus, we have to manually
ensure that the invalid data error gets returned.
Additionally, use the retry backend for some of the repository tests, as
this is the configuration which will be used by restic.
2023-01-14 17:57:02 +01:00
Michael Eischer
6d9675c323
repository: cleanup error message on invalid data
...
The retry printed the filename twice:
```
Load(<lock/04804cba82>, 0, 0) returned error, retrying after 720.254544ms: load(<lock/04804cba82>): invalid data returned
```
now the warning has changed to
```
Load(<lock/04804cba82>, 0, 0) returned error, retrying after 720.254544ms: invalid data returned
```
2023-01-14 17:57:02 +01:00
Michael Eischer
fb43cbab49
Merge pull request #4129 from greatroar/cleanup
...
cache: Replace readCloser+LimitedReader by backend.LimitedReadCloser
2023-01-14 12:17:25 +01:00
Michael Eischer
4a7a6b06af
ui/backup: Use progress.Updater for progress updates
2023-01-14 01:20:43 +01:00
Michael Eischer
e499bbe3ae
progress: extract progress updating into Updater struct
...
This allows reusing the code to create periodic progress updates.
2023-01-14 01:13:08 +01:00
Michael Eischer
c15b4bceae
backup: extract StdioWrapper from ProgressPrinters
...
The StdioWrapper is not used at all by the ProgressPrinters. It is
called a bit earlier than previously. However, as the password prompt
directly accessed stdin/stdout this doesn't cause problems.
2023-01-14 00:58:13 +01:00
greatroar
72922a79ed
cache: Replace readCloser+LimitedReader by backend.LimitedReadCloser
2023-01-03 19:03:36 +01:00
Panagiotis Cheilaris
3b516d4b70
convert uid/gid -1 to 0 only in 32-bit tar dump
...
Only for a 32-bit build of restic, convert a uid or gid value of -1 to 0.
2022-12-30 18:12:12 +01:00
Panagiotis Cheilaris
a86a56cf3b
fix lint issue with function name 'tarId'
...
See https://github.com/golang/lint/issues/89 and
https://github.com/golang/lint/issues/124
2022-12-28 18:46:58 +01:00
Panagiotis Cheilaris
050ed616ae
be more explicit with uid or gid of value -1
2022-12-28 18:44:36 +01:00
Panagiotis Cheilaris
10fa5cde0a
in tar dump, convert uid, gid of value -1 to zero
2022-12-27 16:36:04 +01:00
Michael Eischer
90fb6f70b4
Merge pull request #4089 from greatroar/errors
...
Clean up error handling further
2022-12-24 10:41:56 +01:00
greatroar
1678392a6d
checker: Make ErrLegacyLayout a value, not a type
2022-12-17 09:41:07 +01:00
greatroar
d9002f050e
backend: Don't Wrap errors from url.Parse
...
The messages from url.Error.Error already start with the word "parse".
2022-12-17 09:41:07 +01:00
greatroar
b150dd0235
all: Replace some errors.Wrap calls by errors.WithStack
...
Mostly changed the ones that repeat the name of a system call, which is
already contained in os.PathError.Op. internal/fs.Reader had to be
changed to actually return such errors.
2022-12-17 09:41:07 +01:00
Michael Eischer
cccc17e4e9
Merge pull request #4086 from blackpiglet/modify_access_denied_code
...
Fix: change error code in function isAccessDenied to AccessDenied
2022-12-16 21:55:52 +01:00
Xun Jiang
cc5325d22b
Fix: change error code in function isAccessDenied to AccessDenied
...
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
2022-12-16 21:41:16 +01:00
Michael Eischer
da0e45cf40
Merge pull request #4083 from greatroar/cleanup
...
repository: Remove empty cleanup functions in tests
2022-12-16 21:39:30 +01:00
Michael Eischer
1bfe98bdc0
Merge pull request #2398 from DanielG/b2-hide-file
...
b2: Fallback to b2_hide_file when delete returns unauthorized
2022-12-13 22:52:23 +01:00