summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src
AgeCommit message (Collapse)AuthorFilesLines
2023-11-22Default to the direct access method if all methods are disabled in the settingsMarkus Pettersson3-27/+77
Make sure that access method settings can never be empty, as `ConnectionModesIterator` should never work with an empty collection
2023-11-17Add support for applying JSON patches to management interfaceDavid Lönnhager4-84/+94
2023-11-17Add settings patcher to mullvad-daemonDavid Lönnhager2-0/+465
2023-11-13Remove unnecessary `mut`Sebastian Holmin6-7/+7
2023-11-13Add observers to SettingsPersisterDavid Lönnhager2-87/+63
2023-11-13Add management interface for relay overrideDavid Lönnhager2-2/+89
2023-11-13Patch in-ips in relay selectorDavid Lönnhager1-0/+1
2023-11-07Configure firewall rules to allow proxy clientsMarkus Pettersson1-17/+20
The default setting will (always) be to only allow processes with root-privilege to send/receive traffic from an allowed endpoint. This change is only supposed to be used with the local SOCKS5 api access method.
2023-11-07Add configurable transport protocol to local SOCKS5 access methodMarkus Pettersson2-9/+9
2023-10-31Replace UpdateRelaySettings with SetRelaySettingsDavid Lönnhager2-14/+14
2023-10-30Rename REST request factory timeoutDavid Lönnhager1-1/+1
2023-10-30Newtype REST ResponseDavid Lönnhager1-2/+1
2023-10-30Rename RestRequest to RequestDavid Lönnhager1-1/+1
2023-10-24Remove 'ResponseFailure' device error variantDavid Lönnhager2-44/+26
2023-10-23Improve error handling for API requests that failed to due being offlineDavid Lönnhager1-20/+4
2023-10-20Add process module to talpid-windowsDavid Lönnhager1-90/+6
2023-10-19Fold all access token requests into a single requestDavid Lönnhager3-8/+9
2023-10-16Add android conditional compilation for google payJonathan4-109/+141
Add conditional compilation for google pay API access for only android. Also allow new error type to be parsed. Additionally fix review comments, formatting and warnings.
2023-10-16Add play purchasing modelsJonatan Rhodin1-8/+4
2023-10-16Add piping for google play payment API requestsJonathan4-4/+267
This commit adds all of the basic piping in order to let Android use the JNI interface in order to make requests to our API pertaining to google play payment initialization and status.
2023-10-09Add `GetApiAddresses` now returns a list of API addressesMarkus Pettersson1-2/+2
2023-10-09UX improvements for `mullvad api-access`Markus Pettersson2-31/+113
- Re-phrase help texts for a lot of `mullvad api-access` commands - Add to help texts for some `mullvad api-access` commands - Compact the output of `mullvad api-access test` - `mullvad api-access status` is changed to `mullvad api-access get` to align with other `mullvad` commands. - `mullvad api-access get` does not print the enabled/disabled status of the shown access method - Rotate access method if the currently active one is updated or removed - Fix reset access method after `mullvad api-access test` After running `mullvad api-access test`, the previously used access method should be used, which was not the case previously. - Fix `mullvad api-access use` API connectivity check - `mullvad api-access use` now runs a test-routine to check that the new access method will function before comitting to it. If this check fails, the previously used access method will be used instead - guarantee that `set_api_access_method` has finished upon returning. Make `mullvad_api::rest::next_api_endpoint` `async` and send a message upon completion. This is propagated to the caller of `next_api_endpoint` which can `await` the result
2023-10-09Code cleanupMarkus Pettersson3-48/+42
- Get rid of extraneous calls to `clone` - Address nit: combine similar match arms into a single match arm - Fix `clippy` lint "unused `async` for function with no await statements" - Fix protobuf field numbers should start from 1 - This was not the case for `Socks5Local` & `Shadowsocks` - Refactor code for opening proxy connections - Cut down on duplicated code for setting up a proxied connection in `mullvad-api`. The difference between different connection modes is how they wrap the underlying `TCP` stream. - Remove `enable_access_method` & `disable_access_method` from RPC-client
2023-10-09Add `GetCurrentApiAccessMethod` to show the current API access methodMarkus Pettersson4-72/+136
- Add a new RPC message: `GetCurrentApiAccessMethod`. This message may be used to retrieve the access method which is currently in use by the daemon for connecting to the Mullvad API. - Add `mullvad api-access status` for showing the API access method in use
2023-10-09Code cleanupMarkus Pettersson4-54/+72
- Rename `mullvad_types::api_access.rs` -> `mullvad_types::access_method.rs` - Rename `ApiAccessMethodId` to simply `Id` Prefer to prefix with module name `access_method` to disambiguate use of `Id` instead, like `access_method::Id` - Remove dead code - Remove `AccessMethodSettingsUpdate` - Remove the `retry_attempt` struct field from `ApiConnectionModeProvider`, as it is no longer used for anything. - Fix typos - `GetApiAddressess` is now correctly spelled `GetApiAddresses` (a single trailing "s") - Deprecate the name `ApiAccessMethod` in favor of `AccessMethodSetting` - To decrease the confusion between `AccessMethod` & `ApiAccessMethod`. `AccessMethodSetting` adds some app-specific settings details on top of an `AccessMethod`, which is not too far fetched with the new naming convention. - Refactor proto file - Rename protobuf message `AccessMethodSettingAdd` to `NewAccessMethodSetting` - `AccessMethod` is now its own message - `AccessMethods` is removed - Add `ApiAccessMethodAdd` protobuf message - The `ApiAccessMethodAdd` returns a `UUID` for the . One important change is that new `AccessMethodSetting`s are created in the daemon, rather than in the CLI/other clients. This means that the daemon now has full control over generating new `AccessMethodSetting`s from `AccessMethod`s. - Clean up conversion code to/from `AccessMethod` protobuf types - Simplify `UpdateApiAccessMethod` RPC - Remove the extranous `ApiAccessMethodUpdate` data type - get rid of `ApiAccessMethodUpdate` protobuf message. Use `UUID` of `ApiAccessMethod` to identify which struct to edit. - get rid of `ApiAccessMethodUpdate` struct
2023-10-09Rename `ApiAccessMethod` to `AccessMethodSetting`Markus Pettersson3-7/+10
`ApiAccessMethod` was just an app-centric wrapper around `AccessMethod`.
2023-10-09`AccessMethod`s are now filtered by the daemon rather than ↵Markus Pettersson3-17/+11
`ConnectionModesIterator` Move the duty of filtering active `AccessMethod`s from `ConnectionModesIterator` to the daemon. This provides more flexibility in the iterator as it does not need to know about `AccessMethod` at all.
2023-10-09Code cleanupMarkus Pettersson4-32/+26
- Refactor `RemoveApiAccessMethod` to be based on UUID - Remove debug-prints in `mullvad api-access list` et al - Get rid of `GetApiAccessMethods` RPC - Use the more generic RPC `GetSettings` to get hold of all API access methods instead - Rename `mullvad_types::access_method` to `mullvad_types::api_access` - Remove (unjustified) `#[inline(always)]` attributes
2023-10-09Refactor protobuf `ApiAccessMethod` definitionsMarkus Pettersson4-114/+56
- Replace rpcs `ReplaceApiAccessMethod` and `ToggleApiAccessMethod` in favor of a commmon `UpdateApiAccessMethod` (which resembles `ReplaceApiAccessMethod` in a lot of ways). - `UpdateApiAccessMethod` works with unique identifiers instead of array indices to pinpoint which API access method to update. - Toggling an API access method to be enabled/disabled now happens via `UpdateApiAccessMethod` - Add the useful `UUID` protobuf type definition, which conveys more information that a raw string. - Refactor `SetApiAccessMethod` to use API access method ID - Update `ApiAcessMethod` messages to use `UUID` type for uuid values - Use unique id for removing custom `ApiAccessMethods`
2023-10-09CleanupMarkus Pettersson4-135/+204
- General code cleanup - Fix some typos - Add some doc comments - Address several `TODO` comments - Fix `clippy` warnings - Removed unused dependency `mullvad-api` from `mullvad-cli` - Removed unused dependency `rand` from `mullvad-daemon` - Rename `mullvad proxy` to `mullvad api-access` - Rename `mullvad_types::api_access_method` -> `mullvad_types::access_method` - Remove unused `mullvad api-access edit` arguments - Fix `Display` for `ProxyConfig` printing arguments in the wrong order - Re-phrase `mullvad api-access test` - If the API call failed, point out which tested access method that did not work. - Fix missing `socket_bypass_tx` value for Android - Refactor `ApiAccessMethod` proto definition - Simplify protobuf definitions of `SOCKS5` api access methods - Remove the `Socks5` enum in favor of implementing `Socks5Local` and `Socks5Remote` directly. - Move `enabled` and `name` out of the individual messages and put them next to the `oneof access_method` in `ApiAccessMethod` proto definition - Use derived `PartialEq` and `Hash` from `AccessMethod` - Instead of hand-rolling `Hash` and implementing an ad-hoc version of half of `PartialEq`, these can now be derived and used as one would imaging due to the refactoring wherer `name` and `enabled` was moved out of `AccessMethod` into `ApiAccessMethod`.
2023-10-09Add `mullvad proxy test`Markus Pettersson2-0/+21
For quickly assessing whether an api access method can reach the API or not.
2023-10-09Add `mullvad proxy use`Markus Pettersson4-26/+118
Allow for settings a specific Access Method to use
2023-10-09Add naming custom access methodsMarkus Pettersson1-1/+2
Just a bookkeeping feature for the end user
2023-10-09Minor code cleanupMarkus Pettersson2-9/+7
- Fix removal of API access methods from daemon settings When removing an API access method, we now compare the ID (hash) of the "access method-to-remove" with the access methods stored in the daemon settings. This is because using the `==`/`!=` operator on two similiar `AccessMethod`s only differing in the `enabled` field will be different from hashing the objects and comparing those instead. The hash does not consider the `enabled` field in its calculation.
2023-10-09Add `mullvad api-access enable/disable`Markus Pettersson4-4/+63
Add `mullvad api-access enable/disable`, which allows for toggling API access methods On/Off. Make `ApiConnectionModeProvider` consider status of access method. `ApiConnectionModeProvider` will only be able to return access methods which are enabled, as it will disregard those which are disabled. Add logic to guarantee the invariant that at least one API access method is available for selection by the `ApiConnectionModeProvider`
2023-10-09Allowing traffic to and from a SOCKS5-proxy running on localhost.Markus Pettersson1-29/+57
The daemon has to add a rule to allow traffix to/from the remote server which the locally running SOCKS5-proxy communicates with.
2023-10-09Update used access methods on a daemon settings changeMarkus Pettersson1-0/+11
2023-10-09Code cleanupMarkus Pettersson3-53/+72
- Add a new datastructures for distinguishing between built-in & custom api access methods - Implement `TryFrom` instead of `From` for fallible conversions - Do not panic if a protobuf-message is ill-formatted - Do not allow removal of built-in api access methods - Refactor notification logic in `access_methods.rs` - Rename `mullvad proxy api` to simply `mullvad proxy` - Since there are no other kinds of proxies at the moment, the subcommand `proxy api` does not make much sense. - Remove left-over comments
2023-10-09Add `mullvad proxy api edit` commandMarkus Pettersson2-2/+41
Allow a user to edit an existing custom api proxy method
2023-10-09Add `mullvad proxy api remove` commandMarkus Pettersson2-0/+35
Allow the user to manually remove a custom api proxy.
2023-10-09Add `mullvad proxy add` commandMarkus Pettersson2-0/+61
Add daemon logic for storing custom access methods & allow a user to add a custom socks5 or shadowsocks proxy. Add all the necessary information for establishing Socks5 connections (both using a local Socks-proxy as well as the normal, remote-proxy, use case) and Shadowsocks connections. Add `api_access_settings` to `mullvad-daemon` Naturally, the Protobuf types has to be mirrored on the Rust/daemon side and lots of boilerplate code had to be written to convert between the two.
2023-10-05Log if Same IP is being used or notLinus Färnstrand1-5/+29
2023-09-27Refactor custom list implementationDavid Lönnhager4-486/+229
2023-09-20Add social media blocklists to daemon+CLILinus Färnstrand2-0/+7
When infra has deployed these block lists to the relays, this setting will allow blocking social media domains directly with the app
2023-09-19Simplify immediate retry strategyDavid Lönnhager2-40/+27
2023-09-19Define retry strategy constantsDavid Lönnhager1-29/+12
2023-09-11Remove TODO about adding features we don't needDavid Lönnhager1-2/+0
2023-09-11Use mutex instead of rwlock in management interfaceDavid Lönnhager1-8/+6
2023-09-05Remove forwarded port from devices in Rust codeLinus Färnstrand1-6/+1
2023-08-31Remove wireguard-nt switchDavid Lönnhager2-56/+0