Commit Graph
517 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub ffacd37e44 Merge branch 'master' into fix-ipv6-uri 2024-03-04 13:41:10 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Jojo-1000 a45ce610df Fix URI parsing for IPv6 addresses and add tests.
Closes #5057
2023-11-10 13:53:10 +01:00
vilaureu 71971df893 fix #4716 by falling back to System hasher
When only having OpenSSL 3 installed, FasterHashing.FasterHash.Create()
currently throws an EntryPointNotFoundException.
Mitigate this by falling back to HashAlgorithm.Create in the error case.
2022-11-19 11:33:33 +01:00
Kenneth Skovhede 8abd6a108f Removed unused key generator 2022-06-14 21:18:00 +02:00
Doug Krahmer 1cbe2643b1 Add file size verification to FileBackend PutAsync() 2022-03-18 11:13:19 -07:00
Riccardo Paolo Bestetti 528478fda4 Implement exponential backoff for backend errors 2022-01-20 23:22:08 +01:00
Beppo 270b9457a8 Timeparser.cs: summay: Update URL to duplicity man page
Domain, path and section is changed.
2021-09-01 14:52:30 +02:00
Kenneth Hsu 8d99be95d8 Make period in regex filters match newline characters.
By default, the dot (.) element matches every character _except_ the
newline character.  This causes issues with files that have a newline
character in the name.  For example, they are excluded when restoring
the containing directory.

By specifying the RegexOptions.Singleline option, the dot (.) element
will match every character, including the newline character.

This fixes #4508.
2021-05-14 18:34:41 -07:00
Tyler Gill fa33e5f135 Remove CopyStream buffering logic (will try to make a separate pull request for that) 2021-03-28 23:20:20 -06:00
Tyler Gill 3539112cca Store the Utility buffer in a WeakReference so the GC can collect it if necessary. 2021-03-22 09:47:17 -06:00
Tyler Gill 06c28387d5 Address some more feedback 2021-03-20 16:09:23 -06:00
Tyler Gill 47dccff835 Fix a few more things. 2021-03-20 13:37:41 -06:00
Tyler Gill 719adbf1f1 Clean up a few more bugs and inconsistencies in ReadLimitLengthStream. 2021-03-19 13:59:09 -06:00
Tyler Gill 7f1b6bc7a2 Fix some bugs in ReadLimitLengthStream changes, and add a unit test for some of the new behavior.
Also make NonSeekableStream block seeks via the Position setter.
2021-03-18 12:24:11 -06:00
Tyler Gill 9a4632d551 Remove SubStream and add functionality to ReadLimitLengthStream. Switch to using that.
Also add some hardening around the Position and make sure the stream starts at relative Position 0.
2021-03-17 20:37:46 -06:00
Tyler Gill 27b526daa8 Responding to some comments. 2021-03-17 17:25:19 -06:00
Tyler Gill 7894152489 A few more improvements to the MicrosoftGraphBackends.
First, when performing an upload using an upload session, data is streamed directly from the input stream to the request stream. (It is no longer read into an intermediate buffer first.)
Hopefully this will help these uploads respond to throttling behavior better.
Second, these backends now check for and respect a Retry-After header if it is present.
On 5xx errors, the existing exponential backoff is used for the intermediate retries.
A few other minor things have also been cleaned up (e.g., using Task.Delay instead of Thread.Sleep)
2021-03-15 18:04:39 -06:00
Kenneth SkovhedeandGitHub ecc2cc57ef Merge pull request #4401 from warwickmm/cache_dir_environment_variable
Add $XDG_CACHE_HOME to Linux CacheFiles filter
2021-03-06 15:02:01 +01:00
Kenneth Hsu 6ddcdfb403 Exclude XDG_CACHE_HOME cache directory on Linux if defined.
This fixes #3633.
2020-12-27 17:21:58 -08:00
Gurthurb 763ae5cb68 Avoid NullReferenceException if an IAsyncResult or WebRequest doesn't contain a WebResponse property
An example of when this happens is when shutting down TrayIcon (using its context menu), at least on Windows. This is quite annoying when debugging with Visual Studio (having the default exception settings).
2020-12-27 22:21:03 +01:00
Kenneth Hsu 5951047ff1 Fix incorrect or misleading indentations.
This also adds braces to clarify scope where beneficial.
2020-11-21 13:58:16 -08:00
Kenneth SkovhedeandGitHub a5cea90867 Merge pull request #4293 from warwickmm/fix_export_encoding
Avoid decoding URL parameters when removing passwords
2020-09-23 11:10:02 +02:00
Dean Ferreyra 5f972c2437 Make FilterEntry of type Simple for @ again
Switch back to using `FilterType.Simple` for `@` filters to fix the
restore picker again.

In LocalDatabase.cs, replace code that was explicitly looking for the
presence of wildcard characters to instead trigger off of
`FilterType.Wildcard`.  This fixes the "find" command.

Change FilterEntry.ToString() to prefix Simple filters with `@` so
that if simple filters with wildcard characters make the round-trip
through a string, their `FilterType.Simple` type is preserved.
2020-09-01 23:04:03 -07:00
Dean Ferreyra fd76fb32ef Fix FilterEntry for @ entries to be of type Regexp 2020-08-31 21:25:18 -07:00
Dean Ferreyra aa50b1dfbf Fix typo in comment 2020-08-30 20:04:07 -07:00
Dean Ferreyra 5f94cc19a7 Fix restore GUI handling of folders with * or ?
Add new filter syntax, prefixing with an "at sign"; i.e., `@...`, that
disables glob expansion, treating `*` and `?` wildcard characters as
literal characters.

In the GUI, change the restore file picker to prefix paths with `@`
when expanding a node to avoid mistaking literal `*` or `?` characters
for wildcards characters and triggering the following error:
```
Filter for list-folder-contents must be a path prefix with no wildcards Parameter name: filter
```

This fixes #4300.
2020-08-30 17:07:04 -07:00
Kenneth Hsu f28550f4b5 Use overload instead of optional parameters.
From Codacy:

The overloading mechanism should be used in place of optional parameters for several reasons:

* Optional parameter values are baked into the method call site code,
  thus, if a default value has been changed, all referencing assemblies
  need to be rebuilt, otherwise the original values will be used.
* The Common Language Specification (CLS) allows compilers to ignore
  default parameter values, and thus require the caller to explicitly
  specify the values. For example, if you want to consume a method with
  default argument from another .NET compatible language (for instance
  C++/CLI), you will have to provide all arguments. When using method
  overloads, you could achieve similar behavior as default arguments.
* Optional parameters prevent muddying the definition of the function
  contract. Here is a simple example: if there are two optional
  parameters, when one is defined, is the second one still optional or
  mandatory?
2020-08-24 07:51:57 -07:00
Kenneth Hsu d4d7874aaf Avoid decoding URL parameters when removing passwords.
In revision c41f2c6a60 ("moved all sanitization logic into backup class
and moved from regex to using internal Uri library"), we cleaned up the
removal of passwords from an exported backup configuration.  However,
the use of Uri.QueryParameters resulted in exporting decoded parameter
values, which violated some assumptions made by the decode_uri function
in AppUtils.js.  This caused usernames in the JSON to contain '@'
instead of '%40', which led to incorrect decomposition of the target URL
into its components in the UI.

This concerns issue #3619.
2020-08-24 07:41:00 -07:00
Kenneth Hsu e964072690 Target .NET Framework 4.7.1.
This updates all projects to target .NET Framework 4.7.1.  The
TencentCOS and Tardigrade backends depend on .NET Standard 2.0.  When a
.NET Framework prior to 4.7.1 is targeted, the system cannot be sure
that all the dependencies exist, so it copies all dependent assemblies
to the output directory.  This causes many assemblies from the System
namespace to become bundled in the release.

https://stackoverflow.com/a/48875007

We had previously attempted to make individual projects target 4.7.1
(see pull request #4242), but this can cause compatibility issues when
4.6.2 projects depend on 4.7.1. projects.

This will require Mono 5.10.0 or greater (previously, we required 5.0.0
or greater).

https://www.mono-project.com/docs/about-mono/releases/5.10.0/#class-libraries

This fixes issue #4234.
2020-07-26 19:46:01 -07:00
Kenneth Hsu 0f4cfdb156 Fix confusing indentation.
The body of an if statement was not indented relative to the condition.
This also adds braces to clarify the body of the statement.
2020-04-26 19:51:12 -07:00
Rod Savard e79f331ae6 add Edge and Chrome cache folders 2020-04-06 16:27:42 -07:00
Kenneth Hsu 74573bf5ff Remove unnecessary variable assignment. 2020-01-25 13:51:27 -08:00
warwickmmandGitHub 52929e9eb2 Merge pull request #4042 from seantempleton/stopnowexceptions
Fix database corruptions that can occur with "stop now".

This was a source of the "Detected non-empty blocksets with no associated blocks!" exception.
2020-01-06 09:57:44 -08:00
warwickmmandGitHub df2c70e8d2 Merge pull request #4039 from drwtsn32x/filter-cleanup
Support additional Recycle Bin paths in default Windows filters
2020-01-06 09:51:18 -08:00
Sean Templeton 3b6306b556 Fix exceptions caused by Stop Now
The LocalDatabase class was deleting from the BlocklistHash table based on the volume id of blocks. The deletes for the Blockset and BlocksetEntry tables were using a union query which included the same query the BlocklistHash delete was using. Changed the BlocklistHash delete query to use the union as well to ensure that all three tables would use the same query to delete the necessary rows. This fixes the "Detected non-empty blocksets with no associated blocks!" error.

Moved a write call in the DataBlockProcessor to send a volume for upload after setting blockvolume to null. This prevents a null reference exception because otherwise it would be sent to the SpillCollector and it tries to add a block, but the volume has already been closed.

Added the ? operator to the RegistryUtility class to prevent a null reference exception while debugging. It was annoying catching it in the debugger.

Fixes #4037
2020-01-05 21:43:56 -06:00
drwtsn32x f4321ea115 fix typo 2020-01-01 16:50:34 -08:00
drwtsn32x c50d07ec40 fix typo 2020-01-01 16:49:40 -08:00
drwtsn32x e55d555558 Change case of recycle bins 2020-01-01 16:43:04 -08:00
drwtsn32x 559ab450a4 Improve Windows Temp filter 2020-01-01 16:40:10 -08:00
drwtsn32x 9cabdc51d0 Improve Windows Install filter 2020-01-01 16:25:22 -08:00
drwtsn32x 7e9eb58cdd remove Temp from SystemFiles 2020-01-01 16:18:42 -08:00
drwtsn32x e15b3a9278 add slash to 'usrclass' 2020-01-01 16:05:53 -08:00
drwtsn32x 54820bc192 remove duplicate 'ntuser' line 2020-01-01 16:02:57 -08:00
drwtsn32x 9b51773e6f add recycle bin, change all to be off root of drive 2020-01-01 15:59:43 -08:00
drwtsn32x dd7cc60e46 move '$Recycle.bin' to SystemFiles filter for consistency 2020-01-01 15:57:14 -08:00
drwtsn32x a5439fd30f remove 'Windows' duplicate 2020-01-01 15:54:57 -08:00
Kenneth Hsu 83ac03843d Fix spelling errors in comments.
In doing so, we also normalized some line endings.
2019-12-14 09:52:55 -08:00
drwtsn32x 942d8b820d removed getter 2019-11-26 19:27:46 -08:00
drwtsn32x 77a1e3b88a disable attribute masking 2019-11-22 08:00:58 -08:00