summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src/migrations
AgeCommit message (Collapse)AuthorFilesLines
2024-11-28Fix clippy warningsMarkus Pettersson1-1/+1
2024-10-01Rename account "token" to account "number"Joakim Hulthe3-22/+22
2024-09-02Run `cargo +nightly clippy --fix`Markus Pettersson1-4/+2
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager1-3/+2
2024-06-24Run `cargo +nightly fmt`Sebastian Holmin2-13/+17
2024-06-03Fix v9 migration testDavid Lönnhager1-236/+1
2024-05-29Migrate to gRPCDavid Göransson2-3/+698
Co-authored-by: Jonatan Rhodin <jonatan.rhodin@mullvad.net> Co-authored-by: Markus Pettersson <markus.pettersson@mullvad.net> Co-authored-by: David Lönnhager <david.l@mullvad.net>
2024-04-25Update windows-sysJoakim Hulthe1-3/+2
2024-04-22Fix broken lints in rustdocsSebastian Holmin1-1/+1
I ran `cargo doc` and fixed as many broken links as I could find.
2024-03-27Refactor `mullvad-relay-selector`Markus Pettersson4-4/+4
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-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 Hulthe1-30/+28
`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-05Test whether the default settings use the correct versionDavid Lönnhager1-15/+47
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-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-05Run `cargo +nightly fmt`Sebastian Holmin1-2/+2
2024-01-05Run `cargo clippy --all-targets --fix`Sebastian Holmin1-2/+0
These lints where missed because the problems were inside tests. Note that "targets" does not refer to OS/architectures. ``` > cargo build --help ... Target Selection: --lib Build only this package's library --bins Build all binaries --bin [<NAME>] Build only the specified binary --examples Build all examples --example [<NAME>] Build only the specified example --tests Build all test targets --test [<NAME>] Build only the specified test target --benches Build all bench targets --bench [<NAME>] Build only the specified bench target --all-targets Build all targets ```
2024-01-03Allow app to use custom socks5 and shadwosocks proxiesJonathan2-0/+997
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.
2024-01-02Fix clippy lintsDavid Lönnhager2-6/+6
2023-11-13Remove unnecessary `mut`Sebastian Holmin6-7/+7
2023-09-11Remove TODO about adding features we don't needDavid Lönnhager1-2/+0
2023-08-30Fix clippy lintsEmīls6-6/+6
2023-08-07Get rid of "extern crate serde" and import derive macros explicitlyLinus Färnstrand5-0/+5
2023-08-04Replace all use of `lazy_static` with `once_cell`Markus Pettersson1-3/+2
To align more with the upcoming standardizations within the Rust ecosystem which started with the release of `1.70.0` and the inevitable deprecation of `lazy_static`.
2023-08-01Replace unmaintained dirs-next with maintained dirsLinus Färnstrand1-1/+1
Gets rid of one usage of winapi in our dependency tree
2023-06-29Add settings migration code, refactor and cleanupJonathan1-8/+295
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-04-26Fix remaining clippy warningsDavid Lönnhager2-5/+4
2023-04-21Fix remaining clippy --fix auto fixes with modificationsLinus Färnstrand1-1/+0
2023-04-21Apply clippy --fix fixesLinus Färnstrand1-1/+1
This commit does not contain everything that `cargo clippy --fix` changed on Windows. But the least controversial and simplest subset. The remaining fixes I felt could use some manual cleanup also.
2023-03-23Add settings migration for udp2tcp port constraintLinus Färnstrand1-1/+22
2023-02-21Make quantum-resistant tunnel optional in mullvad layerDavid Lönnhager3-7/+314
2023-02-13Rename settings error variantsDavid Lönnhager5-23/+28
2023-02-10Relax permissions on settings.jsonDavid Lönnhager1-6/+1
2023-02-08Make async fns without awaits into regular fnsLinus Färnstrand2-4/+4
2022-09-01Replace winapi with windows-sys for all remaining cratesDavid Lönnhager1-13/+12
2022-07-05Use derive attribute for default enum variantsDavid Lönnhager1-7/+2
2022-06-21Fix the large majority of clippy warningsJonathan6-28/+27
This commit fixes most of the remaining clippy warnings in the codebase. These warnings were the more semantically difficult ones to fix. There are some warnings that remain from the rebase that will be fixed in the upcoming PR.
2022-06-13Perform a clippy --fixjonathan6-6/+0
This is a giant commit which performs only a clippy --fix. Auditing can happen in two ways, either by reading every line or by running a `cargo clippy --fix` on the previous commit and make sure that the result is the same.
2022-05-12Enter revoked state if migration fails due to a non-existent WireGuard keyDavid Lönnhager1-2/+2
2022-05-05Hide private device type in `mullvad-daemon`David Lönnhager1-41/+42
2022-05-05Do not store pubkey in device.jsonDavid Lönnhager1-2/+6
2022-04-26Spawn API client after settings migrationDavid Lönnhager1-20/+23
2022-04-05Add RPC that checks whether the app is performing "post-upgrade work", i.e. ↵David Lönnhager2-14/+57
fetching a device from the API
2022-04-04Add unit test for empty account historyDavid Lönnhager1-3/+19
2022-04-04Distinguish between empty history and parsing errors when reading the old ↵David Lönnhager1-32/+36
account history format
2022-03-24Add migration logic for WireGuard port constraintOdd Stranne2-39/+125
2022-03-23Fix pointless copyingDavid Lönnhager1-6/+7
2022-03-23Move imports out of v5 moduleDavid Lönnhager3-106/+128