This PR changes to use relative database paths by default. The default mode is to store all databases in the same folder.
With this update, the paths stored in the server database can now be relative, in which case they are resolved relative to the datafolder.
This makes it simpler to move the data folder as the paths are not stored in full.
For new backups, relative paths are assigned.
For existing backups, the full paths are retained.
If the database path is updated manually, the path will be made relative, if it is relative to the datafolder; otherwise a full path is stored.
This fixes#6677
The SelfOnly mode was removed as was the "removeAdditionalSources" logic. Instead, the new SelfLimited mode always removes sensitive information, such that by default we do not store any sensitive information, not even with encryption enabled.
This is required to avoid accidentially leaking secrets found in remote sources, or the target url, in case the leak happens somewhere else than on the remote destination.
Additionally, this resolves an issue where remote source information could leak via the DisplayNames property.
This updates ngclient to 225, and also adds `--duplicati-webservice-suppress-welcome-page` to automatically disable the welcome page that is shown on new installs.
This PR has a large blast radius because it takes the final step and bumps up the Controller to be fully async.
We have historically done a piece-by-piece update, so all operations were already async but the controller interface was kept synchronous.
With this update, the controller is now fully async and all tests are updated.
Most places where the new C# compiler warns about function names not ending in `Async` were also adressed, giving a massive refactor change.
Functionally, no changes are done.
This PR fixes an issue where the callback for updating the usage reporter was not correctly registered.
The effect of this was that settings changes should update the usagereporter (disabling or setting the level), but due to the missing callback settings were not applied until the server restarted.
With this fix, the settings are applied immediately.
In some cases the database update can fail, and this could leave the transaction open.
Eventually, it will be collected and the transaction disposed so it will be sorted, but in the meantime attempts to save settings will fail as SQLite does not support multiple active transactions.
This PR adds failure dispose of the transactions in a few places to ensure failures does not cascade outside the original failure.
The logic is now that the properties for each of the server settings are defined on the constant that triggers them, instead of splitting it across the API and internal database.
This makes it less error prone to introduce newsensitive server settings.
This PR adds support for generating a self-signed CA and then using that CA to generate TLS certificates.
A new tool `duplicati-configure` / `Duplicati.CommandLine.ConfigureTool.exe` is added to manage the certificates. The tool saves the configuration in the database and is meant to run with elevated privileges for the initial CA installation.
The option `--configure-https` can be added to server/trayicon, and if the process has permissions, this will automatically install the CA certificate.
If a CA is configured, the server will automatically issue, renew and use a TLS certificate.
With this setup, the TLS is opt-in, but once the flow is well tested, we can switch it to opt-out.
This PR adds masking to remote sources so the passwords are not leaked to the browser. The logic works the same as for TargetURL, where the sensitive fields are replaced by a password placeholder before being transmitted via the endpoints.
When data returns, the masking is removed by looking at the original source and the unmasked value is then encrypted before being stored in the database.
Since the sources is an array and not just a single field, the logic here uses the mount point as a "key" for figuring out which new sources map to the original sources. This is robust in the face of re-ordering, deletions and additions.
If there is just a single remote source (assumed most common) this will match even if the prefix does not, making it possible to change the prefix in this case.
For multi-remote sources, it is not possible to change the prefix without also re-typing all masked properties.
If there is a need later, we could extend the matching to look for how many unique protocols are there, and maybe servers as well to try to match better when the prefixes have been renamed.
There is a guard right before saving a source that rejects it if the source contains the placeholder so we ensure that even faulty logic cannot persist an invalid connection string.
This adds a connection string repo, where connection strings can be stored.
The general idea is that it is possible to store connection strings, say an S3 connection, and then re-use the connection string for multiple backups, editing as needed.
The implementation supports listing connection strings, creating, updating, and deleting them.
The connection strings are masked so sensitive information is not available in the browser, and the logic patches connection strings internally to ensure markers are replaced with the correct values.
The connection string itself is stored in full, such that a Duplicati version roll-back will not make the connectionstring become invalid.
There is also an endpoint that allows updating existing backups using the connection string, so it is easy to rotate keys. The logic for this feature is that it retains: scheme, port, host, path, and any extra settings on the target url.
It does not remove settings from the target, but will overwrite or add settings from the connectionstring.
When updating the server settings, the server would not emit the new settings on save, causing the UI to be inconsistent if websocket is active.
This happened primarily when saving advanced options.
This PR adds a VACUUM call to the database after encryption has changed. This is done to ensure any non-encrypted data is scrubbed and not present in unused pages after encryption is applied.
This PR adds an option to disable control from the console.
With this option it is possible to keep a connection to the console, but not allow remote administration.
This PR fixes an issue with restore from config that would mask the internal objects passphrase and cause all requests to fail due to invalid passphrase.
This PR adds settings to choose a Power Mode provider, which will detect if the system is in a paused/suspended state and avoid starting tasks while being suspended.
This currently only works for Windows, where the previous inplementation is named `NET` (for .NET) and the new mode is named `Native` and using the Windows documented approach with a hidden window that listens for `WM_POWERBROADCAST` messages.
The default is `Native` but can now also be disabled by choosing the `None` provider.
This updates the masked password feature to be better at detecting variations of the password mask, such as removing one or more asterisks from the string.
This also updates the "Test destination" endpoints to support a backupId so the call can unmask the target urls.
This PR adds the ability to manage backup configurations outside of the the client.
The implementation ensures that locally created configurations cannot be affected by the remotely managed backups.
If the instance is not connected to a remote console, this has no effect.
This PR updates the local database to add the column `ExternalID` that tracks backups that are managed remotely.
This PR adds a masking function that replaces sensitive parameters with a masking string, such that the passwords are never submitted to the client during edits.
For now, the export feature (both as JSON and as commandline) do not mask the sensitive parameters.
This fixes#2024
This adds a nonce to the refresh token such that each request to obtain a refresh token must now also provide a matching nonce.
When using non-persisted logins, the request to the server is the same, but the "remember me" flag toggles a shorter duration for the refresh token.
The FE can then store the nonce in either local storage for persisted logins or in session storage for non-persisted logins.
The default is currently to always issue refresh tokens with a nonce, but this can be toggled with the JWT configuration.
The ngax client does not have the non-persisted login so it stores the nonce in local storage, using a name that is compatible with ngclient so the user can swap between them without needing to re-login.
The server util was updated to also store the nonce.
This fixes#6451
This PR adds the ability to subscribe to messages over a websocket.
To prevent polling data, the server can now push messages through the websocket, so the client can instantly update when new data is available.
The change is backwards compatible, still serving the status updates over the socket. If the client is providing the authentication token, it is auto-subscried to the legacy status message.
If the client is using the new authentication message, it needs to subscribe to get the status updates (and any other services it needs).
The event system has been extended to support new, and more accurate, events. This is the first step towards removing the general status update and the long-poll mechanism.
This also re-introduces the blocking marker, so the client can know if the operation is halted due to too many pending transfers.
Some endpoints have been moved to service implementations, to allow serving the exact same data from both endpoints and websocket.
This PR also updates the way the progress is handled, so that all transfers are returned to the client, and the transfer speeds for each transfer is calculated based on a small sample buffer, so the values are more accurate even if the program is paused during transfers.