summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2022-01-17 15:43:59 +0100
committerLinus Färnstrand <linus@mullvad.net>2022-01-17 16:54:36 +0100
commitc44936e00f1836adb075642da926a99ba81a66d1 (patch)
treee3d2546664439fa20f63dba293daed2c9b6da20d
parentfd9de27227064fa73d9d0d1544ad2332e4633f41 (diff)
downloadmullvadvpn-c44936e00f1836adb075642da926a99ba81a66d1.tar.xz
mullvadvpn-c44936e00f1836adb075642da926a99ba81a66d1.zip
Add description of v5 settings format migration
-rw-r--r--mullvad-daemon/src/migrations/v5.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/mullvad-daemon/src/migrations/v5.rs b/mullvad-daemon/src/migrations/v5.rs
index c03717684b..0fcaca4e08 100644
--- a/mullvad-daemon/src/migrations/v5.rs
+++ b/mullvad-daemon/src/migrations/v5.rs
@@ -13,6 +13,19 @@ use mullvad_types::settings::SettingsVersion;
///
/// When further migrations are needed, add them here and if they are not backwards
/// compatible then create v6 and "close" this migration for further modification.
+///
+/// # Changes to the format
+///
+/// The ability to disable WireGuard multihop while preserving the entry location was added.
+/// So a new field, `use_multihop` is introduced. We want this to default to `true` iff:
+/// * `use_mulithop` was not present in the settings
+/// * A multihop entry location had been previously specified.
+///
+/// This change is backwards compatible since older daemons will just ignore `use_multihop` if
+/// present.
+///
+/// It is also no longer valid to have `entry_location` set to null. So remove the field if it
+/// is null in order to make it default back to the default location.
pub fn migrate(settings: &mut serde_json::Value) -> Result<()> {
if !version_matches(settings) {
return Ok(());