Commit Graph
148 Commits
Author SHA1 Message Date
Kenneth Skovhede fc478146f3 Update ServerUtil probing
This PR updates the probing logic to not try the database if a password is supplied on the commandline.

It also fixes a crash that could happen at an unwanted place, if the user does not have write access to the supplied data folder. After this, the application will still crash due to not having  a place to write information, but it does not crash in the preloader logic. This also prevents creating the folder while probing for the database.

This PR also fixes a case where the database could become encrypted, if the ServerUtil was providing an encryption key to an unencrypted database. Before this fix, the database would be encrypted with the key provided to ServerUtil, which would most likely cause the Server/TrayIcon to fail starting and perhaps crash.

This fixes #6377
2025-07-10 21:03:16 +02:00
Kenneth Skovhede 279351a8b6 Updated HttpServerConnection to support nullable.
Fixed an issue that caused crashing on start if the TrayIcon was not hosting the server.
2025-07-08 13:03:33 +02:00
Kenneth Skovhede 19ac279939 Apply Secret Provider to TrayIcon
If the secret provider is used to supply arguments only used by the TrayIcon it does not work.

The secret provider is applied in the Server part, so any settings passed through are correctly resolved, but for the few options that apply directly to the TrayIcon this was not resolved.

With this PR, the secret provider is applied to TrayIcon options as well.

This applies to:
- `--hosturl`
- `--browser-command`
- `--host-cert-hash`
- `--webservice-password`
2025-07-02 20:42:35 +02:00
Kenneth SkovhedeandGitHub ffde75a7ee Merge branch 'master' into feature/pkill-termination-issues 2025-07-01 15:18:58 +02:00
Marcelo C. b7dc8e81fe Fixes typo and improves argument handling
Ensures the unmodified command-line arguments are passed to the help detect function.

Related to https://github.com/duplicati/duplicati/pull/5889#issuecomment-3020522797
2025-07-01 09:41:31 -03:00
Marcelo C. 3863dbe7ce Addresses shutdown and thread safety issues
Improvement on AvaloniaRunner, HttpServerConnection, and HostedInstanceKeeper to prevent race conditions during shutdown.

Adds cancellation tokens and locking mechanisms to ensure that operations are properly stopped and resources are released in a controlled manner.

Also handles a NullReferenceException during Avalonia shutdown, and avoids invoking `InstanceShutdown` or `ConnectionClosed` multiple times.
2025-06-25 15:24:04 -03:00
Kenneth Skovhede c9f985ecdd Final removal of FIXMEGlobal 2025-05-05 16:13:46 +02:00
Marcelo C. bf22d7e178 Changed parameter from boolean to Enum for clarity of purpose 2025-04-02 10:15:21 -03:00
Marcelo C. 2da12c12bb Refactoring of how permissions are set whilst obtaining DataFolder
This addresses [Issue](https://github.com/duplicati/duplicati/issues/6114).

Whenever in non-write context, the permissions of the folder are not set.

Changing pattern from static constructor execution.
2025-04-01 15:21:40 -03:00
Kenneth Skovhede e056e651f9 Fixed issues with cross-talk options from TrayIcon and Server 2025-03-25 11:36:44 +01:00
Kenneth Skovhede 1a38df7709 Cleaned up some callbacks to not use events with async methods.
Implemented argument validation for the TrayIcon and server startup.
2025-03-25 11:14:03 +01:00
Kenneth Skovhede ee454e0f38 Fixed trayicon shutdown sequence, and made status updates async 2025-03-25 10:56:01 +01:00
Kenneth Skovhede fca218dc60 Allow trayicon without server
This adds support for starting the trayicon even if there is no server.

The trayicon will start up in a disconnected state and stay like that until it manages to connect.

This fixes Support TrayIcon running with no connection	#5993
2025-03-25 10:40:45 +01:00
Marcelo C. b035c69e4d Integrating the IPv6 & IPv4 detection
It should be noted that I was unable to completely remove IPv4 on Windows 11 to a state where it would not provide the 127.0.0.1 loopback, even when disabling Ipv4 in various ways, including with registry flags.

On ubuntu/linux, after completely disabling ipv4 the ipv6 loopback was returned.
2025-03-11 16:24:15 -03:00
Kenneth Skovhede ddd34ca9c6 Second instance of TrayIcon opens logged in view.
This fixes #6003
2025-03-05 14:53:51 +01:00
Kenneth Skovhede 5c4a0594a5 Improved TrayIcon detached.
Implemented support for disconneted state with TrayIcon.
Added some notification support (Windows and Linux).
Changed some logic to prevent hangs on clicks.
2025-02-08 17:30:27 +01:00
Kenneth SkovhedeandGitHub 28e3fa1063 Merge pull request #5914 from duplicati/feature/prevent-windows-subfolder-storage
Improve data folder assignment
2025-01-31 14:52:45 +01:00
Kenneth Skovhede fac12ba772 Further consolidated the data folder.
Added support for `--portable-mode` and `--server-datafolder` for the CLI, ServerUtil, and Agent.

Fixed a few places where file reads were not cached properly.

Moved some responsibilities of UpdaterManager into DataFolderManager.

This now supports storing `machineid.txt` and `installation.txt` inside the path pointed to by `--server-datafolder` or alternatively with `--portable-mode`.

It is possible that some fringe backwards compatibility is lost with this update.

Fixed an issue with AutoUpdater crashing on check/download.

This fixes #5902
2025-01-28 13:01:35 +01:00
Marcelo C. cee1b8428d Centralizing the check on Helper function. 2025-01-21 12:45:53 -03:00
Marcelo C. 2e502ea7be Help Command unification
All CLI tools and executables now accept a unified set of help command variants:

"help", "/help","--help", "usage", "/usage", "--usage", "/h", "-h"

Affected executables:

Duplicati.Agent
Duplicati.CommandLine
Duplicati.CommandLine.AutoUpdater
Duplicati.CommandLine.BackendTester
Duplicati.CommandLine.BackendTool
Duplicati.CommandLine.ConfigurationImporter
Duplicati.CommandLine.SecretTool
Duplicati.CommandLine.Snapshots
Duplicati.GUI.TrayIcon
Duplicati.Server
Duplicati.Service
Duplicati.WindowsService

Note that SharpAesCrypt command is not included in this because the parameter parsing is part of the SharpAesCrypt code base.
2025-01-17 14:00:14 -03:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth SkovhedeandGitHub 58a5fc57f4 Implemented support for emitting intermediate certificates from pfx (#5739)
* Implemented support for emitting intermediate certificates from pfx files

* Added certificate check to crash earlier

* Fixed loading certificate on Windows
2024-12-05 10:34:10 +01:00
Kenneth Skovhede a97a472ab2 Made password source explicit 2024-11-26 11:26:50 +01:00
Kenneth Skovhede c99e819d70 Merge remote-tracking branch 'origin/master' into feature/add-secret-provider 2024-11-01 08:49:52 +01:00
Kenneth Skovhede ff25d91663 Simplified code a bit.
Added support for multiple cert-hashes.
Made `server-util` auto-detect hashes as well.
2024-10-29 14:38:23 +01:00
Kenneth Skovhede 56816abed8 Reverted to not storing the certificate as a file, since the x509Certificate loader was the broken part, not Kestrel. 2024-10-29 13:55:12 +01:00
Kenneth Skovhede e914794b30 Simplified running TrayIcon with self-signed certificate.
Added workaround method to avoid loading certificate directly as that crashes .NET with EC-based keys.
2024-10-29 13:28:44 +01:00
Kenneth Skovhede b9f2d16df6 Fixed incorrect reference 2024-10-29 12:24:49 +01:00
Kenneth Skovhede 4783050d53 Simplified logic by having an option to disable https.
Simplified checks for https by having a single property that unifies the logic.
2024-10-29 11:15:06 +01:00
Kenneth Skovhede f9154137a3 Merge remote-tracking branch 'origin/master' into feature/ex-certificates 2024-10-29 09:24:53 +01:00
Kenneth Skovhede 34d13a20e2 Initial version of the external secret provider 2024-10-24 16:06:59 +02:00
Kenneth Skovhede f77338a829 Fixed a stray namespace 2024-10-03 16:33:46 +02:00
Marcelo Ceccon 7b958a0878 Fixes to the multiple instance detection system
Exception was bundled in the innerexception and thus the catch statement was not functioning as expected.

Additionally adding ? operator to the  ApplicationExitEvent ServerStartedEvent events.
2024-10-03 10:05:15 +02:00
Max 1bb03a5673 upstream sync 2024-09-11 21:31:04 +02:00
Kenneth Skovhede 23d74d4e18 Minor tweaks to the logic around starting the hosted instance from the TrayIcon 2024-09-07 08:25:16 +02:00
Kenneth Skovhede d8c8ce7988 Removed the use of DeviceId due to lack of sufficient key material.
Kept the infrastructure to allow re-introducing it later if a better source for a device key is found.
Added support for not having any valid settings encryption key.
Added warnings if the user is running without a settings encryption key.
Added additional checks during startup to help with troubleshooting and configuring a setup with a settings encryption key.
Docker builds will now warn if no encryption key is set.
This fixes #5518
2024-08-31 11:02:14 +02:00
Kenneth Skovhede 595ac3c7ee Refactored the code to use the same method for detecting an existing server database.
This prevents creating empty databases when probing for one.
2024-08-30 13:08:37 +02:00
Kenneth Skovhede 3548475360 Implemented preload support.
This commit adds the option to provide preload/preset options that change the default values for Duplicati's commandline or environment variables.
This fixes #5480
2024-08-28 00:18:55 +02:00
Kenneth Skovhede 3e3985b164 Added detection for invalid setup.
Added help message if an invalid detached configuration is provided.
This fixes #5468
2024-08-20 12:17:04 +02:00
Kenneth Skovhede b12c4d4945 Allow specifying port only for tray-icon 2024-08-20 12:15:46 +02:00
Max 9d3286e240 rework certificates to support EC keys and preparation for GUI options 2024-08-06 21:37:35 +02:00
Kenneth Skovhede 3f29642f6c Implemented JWT tokens.
Added auth requirement on all endpoints.
Added SignIn-, Access- and Refresh-Tokens based on JWT.
Upgraded stored password to be based on PBKDF2.
Added default password assignment.
Updated logic to support auth-header and re-sign-in for tray-icon and web-ui.
2024-06-19 13:54:10 +02:00
Kenneth Skovhede ca425808c5 Merge remote-tracking branch 'origin/master' into feature/remove-httpserver 2024-06-09 21:23:59 +02:00
Kenneth Skovhede 9f79025744 Removed HttpServer.
Re-implemented everything using ASP.NET.
Changed some requests to use JSON instead of FORM data.
Some work towards deleting the FIXMEGlobal instance.
Auth is missing, XSRF does not work correctly.
2024-06-07 15:56:43 +02:00
Jojo-1000 930f1c8bd3 Fix most unsupported platform warnings. 2024-05-30 01:50:02 +02:00
Kenneth Skovhede 2e7b8fc468 Merge remote-tracking branch 'npodbielski/feature/http-server-modernization' into feature/remove-httpserver 2024-05-28 14:45:26 +02:00
Kenneth Skovhede dfb6ee0f29 Updated TLS version to None or SystemDefault to use the OS "best match" versions. 2024-04-24 21:17:38 +02:00
natan 70741dc99c Merge branch 'refs/heads/master' into feature/http-server-modernization 2024-04-24 15:45:23 +02:00
Kenneth Skovhede 787b2bf04f Removed code for supporting .NET < 4.8 2024-04-24 11:21:03 +02:00
natan f9f6dfee6b Merge branch 'refs/heads/feature/kestrel-avalonia-upgrade' into feature/http-server-modernization
# Conflicts:
#	Duplicati.Library.RestAPI/UpdatePollThread.cs
#	Duplicati/Server/Program.cs
#	Duplicati/Server/webroot/ngax/scripts/services/ServerStatus.js
#	Duplicati/WebserverCore/DuplicatiWebserver.cs
2024-04-22 09:35:53 +02:00