summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli
AgeCommit message (Collapse)AuthorFilesLines
2023-10-20`remote_port` is no longer optionalMarkus Pettersson1-3/+2
This allow us to move the `remote_port` argument next to the `remote_ip` argument.
2023-10-20Do not set default password for custom `shadowsocks` access methodMarkus Pettersson1-3/+2
2023-10-09UX improvements for `mullvad api-access`Markus Pettersson2-56/+138
- 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-09Add authentication with username+password for SOCKS5 access methodMarkus Pettersson1-14/+61
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 Pettersson1-17/+14
- 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 Pettersson1-0/+12
- 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-09Allow the user to specify if a new access method should be disabled when addedMarkus Pettersson1-2/+23
Adds the `-d | --disabled` flag to `mullvad api-access add <access-method>` command. If the `-d | --disable` is set, the access method is *not* enabled from the start. Note that it may still be tested using the `mullvad api-access test` command, even if it is principally marked as `disabled`.
2023-10-09Split up `mullvad api-access add` command for SOCKS5-proxyMarkus Pettersson1-50/+62
Split up `mullvad api-access add` command for SOCKS5-proxy into "local" and "remote".
2023-10-09Code cleanupMarkus Pettersson1-131/+106
- 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 Pettersson1-18/+22
`ApiAccessMethod` was just an app-centric wrapper around `AccessMethod`.
2023-10-09Code cleanupMarkus Pettersson1-15/+13
- 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-09Refrain from using the word `proxy` where it does not make senseMarkus Pettersson2-14/+14
Do not use the word "proxy" in the context of API access methods, but only in the context where we are actually refering to a proxy (such as `SOCKS5` or `Shadowsocks` proxies).
2023-10-09Refactor protobuf `ApiAccessMethod` definitionsMarkus Pettersson1-55/+42
- 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-210/+165
- 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 Pettersson1-0/+34
For quickly assessing whether an api access method can reach the API or not.
2023-10-09Add `mullvad proxy use`Markus Pettersson1-4/+31
Allow for settings a specific Access Method to use
2023-10-09Pretty print custom access methodsMarkus Pettersson1-7/+77
`mullvad proxy list` will now pretty print all configured access methods in a human-readable way
2023-10-09Add naming custom access methodsMarkus Pettersson1-4/+24
Just a bookkeeping feature for the end user
2023-10-09Add `mullvad api-access enable/disable`Markus Pettersson1-7/+72
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-09Code cleanupMarkus Pettersson1-43/+41
- 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 Pettersson1-6/+100
Allow a user to edit an existing custom api proxy method
2023-10-09Add `mullvad proxy api remove` commandMarkus Pettersson1-5/+37
Allow the user to manually remove a custom api proxy.
2023-10-09Add `mullvad proxy add` commandMarkus Pettersson1-21/+105
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-09Add `mullvad proxy` commandMarkus Pettersson4-0/+104
The `proxy` subcommand will allow for adding/deleting/editing/showing different API access methods using the mullvad CLI.
2023-09-27Refactor custom list implementationDavid Lönnhager5-18/+51
2023-09-20Add social media blocklists to daemon+CLILinus Färnstrand1-0/+12
When infra has deployed these block lists to the relays, this setting will allow blocking social media domains directly with the app
2023-09-11Make env_logger a workspace dependencyDavid Lönnhager1-1/+1
2023-09-05Remove forwarded port from devices in Rust codeLinus Färnstrand1-6/+0
2023-08-30Fix clippy lintsEmīls1-3/+2
2023-08-21Add servers to a custom list by hostnameMarkus Pettersson1-2/+7
2023-08-21Decouple `get_filtered_relays` from `mullvad_cli::relay::Relay`Markus Pettersson1-31/+32
To be able to more easily re-use `get_filtered_relays` from other modules, such as `custom_lists`, the function was to the module level.
2023-08-21Pretty print country/city names instead of just their codesMarkus Pettersson1-6/+77
Create meta type for pretty printing `GeographicLocationConstraint` which is used for adding long country/city names to the output of the `custom-list` cli command.
2023-08-21Do not print redundant custom list nameMarkus Pettersson1-3/+7
If the user wants to print a single list using `mullvad custom-list list <name>`, the name of the list does not need to be part of the pretty print.
2023-08-21Re-arrange `mullvad custom-list` subcommandsMarkus Pettersson1-14/+38
Re-arrange most of the subcommands of `mullvad custom-list` to decrease clutter. This includes both re-ordering the different subcommands as well as moving some subcommands to a new umbrella subcommand `mullvad custom-list edit`. The subcommands under `mullvad custom-list edit` operate on a single custom list, i.e. appending to/renaming/deleting from a custom list. The other subcommands under `mullvad custom-list` operate on the global set of lists instead.
2023-08-21Unify `mullvad custom-list` subcommands `get` and `list`Markus Pettersson1-7/+12
`mullvad custom-list list` now optionally takes an argument: A name of a custom list to retrieve.
2023-08-21Rename cli command `mullvad custom-lists` to `mullvad custom-list`Markus Pettersson1-2/+2
The `custom-list` subcommand is now in singular form, rather than plural.
2023-08-21Add macro for indenting options in the CLIDavid Lönnhager3-57/+49
2023-08-21Implement formatter for constraintsDavid Lönnhager1-6/+10
2023-08-21Improve presentation of relay settings in the CLIDavid Lönnhager1-6/+84
2023-08-07Make clap a workspace dependency and activate features used by allLinus Färnstrand1-1/+1
Both mullvad-setup and mullvad-problem-report had not specified the "derive" feature. Moving it to workspace dependency is probably nicer.
2023-08-02Remove unused deps from mullvad-cliLinus Färnstrand1-3/+0
2023-08-02Make chrono a workspace dependency and fix featuresLinus Färnstrand1-1/+1
2023-08-01Move windows-sys to a workspace dependencyLinus Färnstrand1-1/+1
2023-08-01Disable chrono features to get rid of time dependencyLinus Färnstrand1-1/+1
2023-07-14Move tokio dependency to be a workspace dependencyLinus Färnstrand1-1/+1
2023-07-14Set package fields in workspace and inherit in packagesLinus Färnstrand1-5/+7
2023-06-29Add settings migration code, refactor and cleanupJonathan3-5/+5
Bump the settings version. Add code for migrating settings to new version since it is now not backwards compatible. Refactor LocationConstraint and related types to be more lean. Cleanup issues and fix formatting. Refactor LocationConstraint and add migration code
2023-06-29Cleanup review comments, CI issues and android supportJonathan4-31/+33
Add necessary android support to allow it to not crash due to interface changes. Format the code, remove redundant async functions, fix android issues related to not having to use a Vec to store the custom lists and a string as an id. Fix unit tests.
2023-06-29Add basic features for custom list and file persistenceJonathan6-36/+215
Create the basic features outside of rename for custom lists and route these to the daemon. Persist custom lists in settings. Has basic custom list features done, adds errors. Adds reconnect in the case where a selected custom list is modified.
2023-06-27Upgrade `chrono` to `0.4.26`Markus Pettersson1-1/+1
Fix time zone being ignored on Android, incorrectly outputting UTC timestamps. This more recent version of `chrono` extracts timezone info from a tzdata file on Android. This issue is recognized in `chrono`'s issue tracker: https://github.com/chronotope/chrono/issues/922