summaryrefslogtreecommitdiffhomepage
path: root/mullvad-management-interface
AgeCommit message (Collapse)AuthorFilesLines
2024-04-18Limit the size of custom list names to 30 graphemesEmīls1-0/+1
2024-04-16Add DAITA Windows client and updated tuncfgDavid Lönnhager7-1/+60
2024-04-12Add ClearCustomLists RPC callJoakim Hulthe2-0/+10
2024-04-12Add ClearCustomApiAccessMethods rpc callJoakim Hulthe2-0/+10
2024-04-11Fix wireguard rotation testSebastian Holmin1-2/+2
The test was flaky because if a race condition which made the key rotation missable.
2024-03-27Refactor `mullvad-relay-selector`Markus Pettersson1-3/+2
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-20Test leaking TCP/UDP/ICMP packets in split tunnelJoakim Hulthe1-8/+0
2024-03-20Add split tunnel test for windowsJoakim Hulthe1-5/+4
2024-02-27Replace err_derive with thiserrorJoakim Hulthe3-38/+37
`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-06tonic_build::compile_protos() automatically prints rerun-if-changedAndrej Mihajlov1-3/+1
2024-01-31Change API access methods settings formatMarkus Pettersson4-29/+48
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-31Add tunnel creation error on WindowsDavid Lönnhager2-4/+30
2024-01-22Add `TestCustomApiAccessMethod` RPC callMarkus Pettersson3-30/+19
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-18Print if lockdown mode is enabled when disconnected for `mullvad status`Sebastian Holmin2-9/+16
Add `locked_down` field to disconnected tunnel state.
2024-01-16Add rust-version to all Cargo.tomlLinus Färnstrand1-0/+1
2024-01-12Validate SOCKS5 credentialsMarkus Pettersson2-118/+107
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-10Add patch export to the management interfaceDavid Lönnhager2-0/+7
2024-01-09Remove version and publish cargo metadataLinus Färnstrand1-2/+0
Since Rust 1.75.0 the `version` field is optional. The version defaults to "0.0.0" if it's not specified, and `publish` defaults to false if no version has been given. So by not specifying a version we get both `version = "0.0.0" and `publish = false` "for free"
2024-01-08Link to patch format in proto fileDavid Lönnhager1-0/+1
2024-01-08Add new internal daemon event `AccessMethodEvent`Markus Pettersson3-2/+15
Add a new `InternalDaemonEvent` for announcing when the current API access method changes.
2024-01-04Add workspace level lintsLinus Färnstrand1-0/+3
2024-01-03Allow app to use custom socks5 and shadwosocks proxiesJonathan4-220/+288
This PR has a couple of different purposes - Allow users to use socks5 local proxies with the CLI without having to be root nor use split-tunneling. This only works for OpenVPN. - Unify the types used by different proxy parts of the codebase, such as the Access Methods as well as some already existing OpenVPN proxy code. This PR changes the firewall on all desktop platforms as well as changes the routing table slightly on MacOS and Windows. On Linux the firewall code is modified to apply the appropriate firewall marks to all packages that go to a remote endpoint corresponding to the remote part of a local socks5 proxy. The firewall marks will allow the routing to be done without having to modify the routing table. On MacOS and Windows the routing table is modified to allow packages to go to that same endpoint to pass outside the VPN tunnel, it will additionally punch a hole in the firewall. The PR also migrates the settings file from version 7 to version 8 in order to properly and neatly unify Proxy related types. Finally it provides some slight extensions to the gRPC interface in order to allow for control over the custom proxy settings.
2023-12-29Fetch account ID from APIDavid Lönnhager2-1/+6
2023-12-21Remove `GetCurrentLocation`.Sebastian Holmin3-27/+15
Make the daemon send two tunnel state updates, one with out IP being empty, and another with it being filled when am.i.mullvad.net responds. Update CLI for this change. Other front ends are left out.
2023-12-04Perform testing of access methods asynchronouslyMarkus Pettersson2-4/+5
Perform testing of access methods asynchronously in a separate `tokio` task as to not block the daemon from handling other daemon events during the testing window
2023-12-04Move access method testing logic to `mullvad-daemon`Markus Pettersson3-31/+5
Move access method testing logic to `mullvad-daemon`, which means that the implementation details of how the test works is opaque to whatever frontend which wants to issue a test of some (configured) access method.
2023-11-22Obtain tunnel interface from management interface in testsDavid Lönnhager1-0/+4
2023-11-17Add support for applying JSON patches to management interfaceDavid Lönnhager2-0/+8
2023-11-13Add relay override commands to wrapper clientDavid Lönnhager1-1/+20
2023-11-13Add management interface for relay overrideDavid Lönnhager1-0/+2
2023-11-13Add proto message for relay overridesDavid Lönnhager3-0/+54
2023-11-07Add configurable transport protocol to local SOCKS5 access methodMarkus Pettersson2-10/+18
2023-11-06Remove `from_args` constructors for `access_methods` datatypesMarkus Pettersson1-23/+31
In particular, `access_methods::Socks5Local`, `access_methods::Socks5Remote` & `access_methods::Shadowsocks` have got new constructors which are all infallible.
2023-11-06Prefix remote `ip` and `port` with `remote_` in Socks5Local contextsMarkus Pettersson2-16/+21
2023-10-31Replace UpdateRelaySettings with SetRelaySettingsDavid Lönnhager3-200/+6
2023-10-20Relax relay constraints in `test_quantum_resistant_multihop_udp2tcp_tunnel`Markus Pettersson1-0/+6
Loosen up relay constraints in `test_quantum_resistant_multihop_udp2tcp_tunnel`, which makes the test more resilient to changes in the testing environment.
2023-10-13Use optional modifier for optional primitives in protobuf messagesDavid Lönnhager11-242/+130
2023-10-11Make `once_cell` a workspace dependencyMarkus Pettersson1-1/+1
2023-10-09Add `GetApiAddresses` now returns a list of API addressesMarkus Pettersson3-4/+33
2023-10-09Add authentication with username+password for SOCKS5 access methodMarkus Pettersson2-18/+54
Add the option to authenticate against remote SOCKS5 proxies with a username+password combination. It was an oversight that this was not added from the start.
2023-10-09Code cleanupMarkus Pettersson2-25/+7
- 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 Pettersson2-1/+13
- 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 Pettersson6-342/+302
- 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-28/+28
`ApiAccessMethod` was just an app-centric wrapper around `AccessMethod`.
2023-10-09Code cleanupMarkus Pettersson6-42/+40
- 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-93/+165
- 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-215/+160
- 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/+7
For quickly assessing whether an api access method can reach the API or not.
2023-10-09Add `mullvad proxy use`Markus Pettersson2-0/+20
Allow for settings a specific Access Method to use
2023-10-09Add naming custom access methodsMarkus Pettersson2-29/+43
Just a bookkeeping feature for the end user