summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src
AgeCommit message (Collapse)AuthorFilesLines
2024-04-18Limit the size of custom list names to 30 graphemesEmīls4-65/+45
2024-04-17Refactor away Daemon::app_version_infoJoakim Hulthe2-50/+43
2024-04-17Do not query latest version unless staleJoakim Hulthe1-37/+56
2024-04-17Make sure to query app verion every 24 hoursJoakim Hulthe2-59/+123
even if the daemon was restarted.
2024-04-16Add DAITA to relay selectionDavid Lönnhager1-1/+3
2024-04-16Add DAITA Windows client and updated tuncfgDavid Lönnhager2-1/+73
2024-04-12Add ClearCustomLists RPC callJoakim Hulthe3-36/+95
2024-04-12Add ClearCustomApiAccessMethods rpc callJoakim Hulthe3-0/+32
2024-04-09Use single-threaded runtime when launching serviceDavid Lönnhager3-11/+24
2024-04-09Initialize logging when running Windows serviceDavid Lönnhager1-1/+1
2024-04-03Enable single-use-lifetimes rustc lintLinus Färnstrand1-2/+2
Removes superfluous lifetime definitions. Simplifying the code
2024-03-28Do not panic when reading public key of relayMarkus Pettersson1-11/+6
Avoid panic when reading public key of relay due to unwrapping an unexpected relay type. The unwrap happened if an OpenVPN relay was selected on Android, which should not happen in the first place.
2024-03-27Exit before dropping tokio runtimeDavid Lönnhager1-11/+12
2024-03-27Refactor `mullvad-relay-selector`Markus Pettersson10-333/+343
Implement a system built on 'queries' for selecting appropriate relays. A query is a set of constraints which dictates which relay(s) that *can* be chosen by the relay selector. The user's settings can naturally be expressed as a query. The semantics of merging two queries in a way that always prefer user settings is defined by the new `Intersection` trait. Split `mullvad-relay-selector` into several modules: - `query.rs`: Definition of a query on different types of relays. This module is integral to the new API of `mullvad-relay-selector` - `matcher.rs`: Logic for filtering out candidate relays based on a query. - `detailer.rs`: Logic for deriving connection details for the selected relay. - `tests/`: Integration tests for the new relay selector. These tests only use the public APIs of `RelaySelector` and make sure that the output matches the expected output in different scenarios.
2024-03-27Warn when running --launch-daemon-status on devJoakim Hulthe2-0/+8
2024-03-27Reset device check counter more seldomMarkus Pettersson1-143/+145
Only reset the device check counter if the daemon successfully connects to a Wireguard relay. Otherwise, the counter is either persisted through multiple tunnel connections (OpenVPN) or incremented on successive failures to connect to a Wireguard relay.
2024-03-21Do uniqueness check when starting windows serviceJoakim Hulthe1-4/+12
2024-03-21Split daemon command flags into dedicated structJoakim Hulthe1-23/+35
2024-03-21Refactor daemon oneshot commandsJoakim Hulthe3-84/+118
2024-03-18Update trust-dns to fix spinning issueDavid Lönnhager1-3/+3
This also fixes the issue of not handling closed sockets gracefully
2024-02-28Tweak migrations template fn versions_matchesJoakim Hulthe1-2/+1
Make it not take a mut ref to the json value
2024-02-28Fix migrations/v6.rs docsJoakim Hulthe1-6/+3
2024-02-28Migrate settings to v9Joakim Hulthe2-0/+304
- Change `selected_obfuscation` default to `auto`. - Migrate `selected_obfuscation` from `off` to `auto` for existing users.
2024-02-27Replace err_derive with thiserrorJoakim Hulthe17-229/+218
`err_derive` is unmaintained and will probably stop working with rust edition 2024. `thiserror` is almost a drop-in replacement. This commit simply replaces all occurences of `derive(err_derive::Error)` with `derive(thiserror::Error)` and fixes the attributes, but the Error and Display impls should be identical.
2024-02-22Do daemon uniqueness check before rotating logsJoakim Hulthe1-9/+11
2024-02-20Move `relay_updater` to `mullvad-daemon`Markus Pettersson3-6/+213
Move `mullvad-relay-selector::relay_updater` to the `mullvad-daemon`. The implications of this is that `mullvad-relay-selector` can drop the dependency on both `mullvad-api` and `tokio`, which brings down the total amount of dependencies when running a simple `Cargo check` from 250+ down to a mere 75. :-)
2024-02-20Get rid of unnecessary settings updatesMarkus Pettersson1-4/+0
Listeners will be notified about the settings changing through `mullvad_daemon::settings::SettingsPersister::update`.
2024-02-20Get rid of unnecessary relay selector updatesMarkus Pettersson1-11/+2
The relay selector will be notified about settings changes already, so there is no need to apply the changes twice.
2024-02-19Fix redundant importsDavid Lönnhager4-8/+1
2024-02-19Fix build error due to missing importMarkus Pettersson1-1/+1
2024-02-19Move responsibility of updating the API IP from REST handle to the daemonDavid Lönnhager2-1/+63
2024-02-16Refactor API access methodsDavid Lönnhager3-245/+201
2024-02-15Add `force_direct` flag to API overrideMarkus Pettersson1-6/+3
2024-02-15Swap out `talpid-core` for `talpid-future`Markus Pettersson3-8/+7
2024-02-15Fix off-by-one error when choosing access method candidatesMarkus Pettersson3-39/+36
2024-02-14Add MullvadApi to MullvadVPNUITetstsEmīls1-2/+2
2024-02-09Detect available IP versionsMarkus Pettersson1-7/+17
Try to detect available IP versions by looking at the available routes on the host. On Linux, we check if there exists IPv4 and/or IPv6 routes to some public IP addresses. On macOS and Windows, we check if there exists default routes for IPv4 and/or IPv6. On Android, we check if there is any connectivity at all. The intention is to be able to generate better default constraints for tunnel endpoints. If we can detect "working" IPv4 and/or IPv6 and forward this information to a `TunnelParametersGenerator`, we may choose to connect to a Wireguard relay using IPv6 as part of our retry-strategy. This has not been possible before.
2024-02-05Test whether the default settings use the correct versionDavid Lönnhager1-15/+47
2024-01-31Adapt Electron frontend to new access method settings formatMarkus Pettersson1-8/+0
2024-01-31If the current access method is disabled or removed, select the next availableMarkus Pettersson3-151/+98
If the current access method is disabled, select the next available access method from the daemon settings.
2024-01-31If the last access method is removed, re-enable DirectMarkus Pettersson1-24/+24
2024-01-31Change API access methods settings formatMarkus Pettersson1-27/+286
Change API access methods settings format to encode that built-in access methods always exist by making them distinct values of the `AccessMethod` settings. This change was also propagated to the corresponding protobuf definition, such that any client may make use of this fact as well. The appropriate settings migration was added.
2024-01-31Allow fallible settings update functionsMarkus Pettersson1-6/+73
Implement `SettingsPersister.try_update`, which allow the caller to signal a failed settings update, hindering a bad settings update from being applied.
2024-01-22Add `TestCustomApiAccessMethod` RPC callMarkus Pettersson4-54/+143
Add a new RPC call `TestCustomApiAccessMethod` for testing access methods on the fly, without having to save them to the daemon settings first. This only works for custom access methods.
2024-01-22Move logic of toggling disabled access methods on use to the daemonMarkus Pettersson2-31/+58
2024-01-18Update the tunnel state on lockdown mode change.Sebastian Holmin2-4/+3
The printing of lockdown mode by `mullvad status` does not reflect the current setting unless the tunnel state has also been updated.
2024-01-18Print if lockdown mode is enabled when disconnected for `mullvad status`Sebastian Holmin1-8/+18
Add `locked_down` field to disconnected tunnel state.
2024-01-12Validate SOCKS5 credentialsMarkus Pettersson1-4/+3
Validate SOCKS credentials by checking that both `username` and `password` both have a length between 1 and 255 bytes. Link to RFC detailing SOCKS5 username/password authentication: https://datatracker.ietf.org/doc/html/rfc1929
2024-01-11Synchronize `mullvad-api` and `mullvad-daemon` when the `api-override`Markus Pettersson2-88/+106
feature is enabled Move the logic for using overridden API endpoints for API calls from `mullvad-api::rest` to `mullvad_daemon::api`. This is in line with how the interaction between the two crates work for a normal release build, i.e. when the `api-override` feature is disabled. This commit also removes references to `force_direct_connection` in the Android code. The flag does not exist in the `mullvad-*` rust crates anymore, so it would be erroneous to try to serialize/deserialize the value from the Android client.
2024-01-10Link to patch spec in patch moduleDavid Lönnhager1-0/+3