summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-09-29 14:53:33 +0200
committerTobias Järvelöv <tobias.jarvelov@mullvad.net>2025-09-29 15:57:12 +0200
commit3759d47cb98751ef2e095caea9bb6f70811e9167 (patch)
treefbd97f20f85abe25acc75683e8b4cef47cbca503
parent020cafd263f85d7143000de2ba3ee03a13ae6445 (diff)
downloadmullvadvpn-v11-settings-migration-snapshot-settings-migrations.tar.xz
mullvadvpn-v11-settings-migration-snapshot-settings-migrations.zip
-rw-r--r--mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_migrated_settings.snap124
-rw-r--r--mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_v11_settings.snap124
-rw-r--r--mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__v11_to_v12_migration.snap124
-rw-r--r--mullvad-daemon/src/migrations/snapshots/v11.json120
-rw-r--r--mullvad-daemon/src/migrations/v11.rs20
5 files changed, 512 insertions, 0 deletions
diff --git a/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_migrated_settings.snap b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_migrated_settings.snap
new file mode 100644
index 0000000000..d3bf077479
--- /dev/null
+++ b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_migrated_settings.snap
@@ -0,0 +1,124 @@
+---
+source: mullvad-daemon/src/migrations/v11.rs
+expression: settings
+---
+{
+ "allow_lan": false,
+ "api_access_methods": {
+ "custom": [],
+ "direct": {
+ "access_method": {
+ "built_in": "direct"
+ },
+ "enabled": true,
+ "id": "140123fa-a11c-4054-ba5d-591d8cbaa219",
+ "name": "Direct"
+ },
+ "encrypted_dns_proxy": {
+ "access_method": {
+ "built_in": "encrypted_dns_proxy"
+ },
+ "enabled": true,
+ "id": "ba10d242-3af8-4185-87cb-ab3b50c868a6",
+ "name": "Encrypted DNS proxy"
+ },
+ "mullvad_bridges": {
+ "access_method": {
+ "built_in": "bridge"
+ },
+ "enabled": true,
+ "id": "e3936387-494a-4277-b98a-688d94a862fd",
+ "name": "Mullvad Bridges"
+ }
+ },
+ "auto_connect": false,
+ "bridge_settings": {
+ "bridge_type": "normal",
+ "custom": null,
+ "normal": {
+ "location": "any",
+ "ownership": "any",
+ "providers": "any"
+ }
+ },
+ "bridge_state": "auto",
+ "custom_lists": {
+ "custom_lists": []
+ },
+ "lockdown_mode": false,
+ "obfuscation_settings": {
+ "selected_obfuscation": "auto",
+ "shadowsocks": {
+ "port": "any"
+ },
+ "udp2tcp": {
+ "port": "any"
+ }
+ },
+ "recents": [],
+ "relay_overrides": [],
+ "relay_settings": {
+ "normal": {
+ "location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "openvpn_constraints": {
+ "port": "any"
+ },
+ "ownership": "any",
+ "providers": "any",
+ "tunnel_protocol": "wireguard",
+ "wireguard_constraints": {
+ "allowed_ips": "any",
+ "entry_location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "ip_version": "any",
+ "port": "any",
+ "use_multihop": false
+ }
+ }
+ },
+ "settings_version": 12,
+ "show_beta_releases": false,
+ "tunnel_options": {
+ "dns_options": {
+ "custom_options": {
+ "addresses": []
+ },
+ "default_options": {
+ "block_ads": false,
+ "block_adult_content": false,
+ "block_gambling": false,
+ "block_malware": false,
+ "block_social_media": false,
+ "block_trackers": false
+ },
+ "state": "default"
+ },
+ "generic": {
+ "enable_ipv6": false
+ },
+ "openvpn": {
+ "mssfix": null
+ },
+ "wireguard": {
+ "daita": {
+ "enabled": false,
+ "use_multihop_if_necessary": true
+ },
+ "mtu": null,
+ "quantum_resistant": "auto",
+ "rotation_interval": null
+ }
+ },
+ "update_default_location": false
+}
diff --git a/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_v11_settings.snap b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_v11_settings.snap
new file mode 100644
index 0000000000..25abcd0641
--- /dev/null
+++ b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__snapshot_v11_settings.snap
@@ -0,0 +1,124 @@
+---
+source: mullvad-daemon/src/migrations/v11.rs
+expression: v11
+---
+{
+ "allow_lan": false,
+ "api_access_methods": {
+ "custom": [],
+ "direct": {
+ "access_method": {
+ "built_in": "direct"
+ },
+ "enabled": true,
+ "id": "140123fa-a11c-4054-ba5d-591d8cbaa219",
+ "name": "Direct"
+ },
+ "encrypted_dns_proxy": {
+ "access_method": {
+ "built_in": "encrypted_dns_proxy"
+ },
+ "enabled": true,
+ "id": "ba10d242-3af8-4185-87cb-ab3b50c868a6",
+ "name": "Encrypted DNS proxy"
+ },
+ "mullvad_bridges": {
+ "access_method": {
+ "built_in": "bridge"
+ },
+ "enabled": true,
+ "id": "e3936387-494a-4277-b98a-688d94a862fd",
+ "name": "Mullvad Bridges"
+ }
+ },
+ "auto_connect": false,
+ "block_when_disconnected": false,
+ "bridge_settings": {
+ "bridge_type": "normal",
+ "custom": null,
+ "normal": {
+ "location": "any",
+ "ownership": "any",
+ "providers": "any"
+ }
+ },
+ "bridge_state": "auto",
+ "custom_lists": {
+ "custom_lists": []
+ },
+ "obfuscation_settings": {
+ "selected_obfuscation": "auto",
+ "shadowsocks": {
+ "port": "any"
+ },
+ "udp2tcp": {
+ "port": "any"
+ }
+ },
+ "recents": [],
+ "relay_overrides": [],
+ "relay_settings": {
+ "normal": {
+ "location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "openvpn_constraints": {
+ "port": "any"
+ },
+ "ownership": "any",
+ "providers": "any",
+ "tunnel_protocol": "wireguard",
+ "wireguard_constraints": {
+ "allowed_ips": "any",
+ "entry_location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "ip_version": "any",
+ "port": "any",
+ "use_multihop": false
+ }
+ }
+ },
+ "settings_version": 12,
+ "show_beta_releases": false,
+ "tunnel_options": {
+ "dns_options": {
+ "custom_options": {
+ "addresses": []
+ },
+ "default_options": {
+ "block_ads": false,
+ "block_adult_content": false,
+ "block_gambling": false,
+ "block_malware": false,
+ "block_social_media": false,
+ "block_trackers": false
+ },
+ "state": "default"
+ },
+ "generic": {
+ "enable_ipv6": false
+ },
+ "openvpn": {
+ "mssfix": null
+ },
+ "wireguard": {
+ "daita": {
+ "enabled": false,
+ "use_multihop_if_necessary": true
+ },
+ "mtu": null,
+ "quantum_resistant": "auto",
+ "rotation_interval": null
+ }
+ },
+ "update_default_location": false
+}
diff --git a/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__v11_to_v12_migration.snap b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__v11_to_v12_migration.snap
new file mode 100644
index 0000000000..d45a73cb13
--- /dev/null
+++ b/mullvad-daemon/src/migrations/snapshots/mullvad_daemon__migrations__v11__test__v11_to_v12_migration.snap
@@ -0,0 +1,124 @@
+---
+source: mullvad-daemon/src/migrations/v11.rs
+expression: v12
+---
+{
+ "allow_lan": false,
+ "api_access_methods": {
+ "custom": [],
+ "direct": {
+ "access_method": {
+ "built_in": "direct"
+ },
+ "enabled": true,
+ "id": "140123fa-a11c-4054-ba5d-591d8cbaa219",
+ "name": "Direct"
+ },
+ "encrypted_dns_proxy": {
+ "access_method": {
+ "built_in": "encrypted_dns_proxy"
+ },
+ "enabled": true,
+ "id": "ba10d242-3af8-4185-87cb-ab3b50c868a6",
+ "name": "Encrypted DNS proxy"
+ },
+ "mullvad_bridges": {
+ "access_method": {
+ "built_in": "bridge"
+ },
+ "enabled": true,
+ "id": "e3936387-494a-4277-b98a-688d94a862fd",
+ "name": "Mullvad Bridges"
+ }
+ },
+ "auto_connect": false,
+ "bridge_settings": {
+ "bridge_type": "normal",
+ "custom": null,
+ "normal": {
+ "location": "any",
+ "ownership": "any",
+ "providers": "any"
+ }
+ },
+ "bridge_state": "auto",
+ "custom_lists": {
+ "custom_lists": []
+ },
+ "lockdown_mode": false,
+ "obfuscation_settings": {
+ "selected_obfuscation": "auto",
+ "shadowsocks": {
+ "port": "any"
+ },
+ "udp2tcp": {
+ "port": "any"
+ }
+ },
+ "recents": [],
+ "relay_overrides": [],
+ "relay_settings": {
+ "normal": {
+ "location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "openvpn_constraints": {
+ "port": "any"
+ },
+ "ownership": "any",
+ "providers": "any",
+ "tunnel_protocol": "wireguard",
+ "wireguard_constraints": {
+ "allowed_ips": "any",
+ "entry_location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "ip_version": "any",
+ "port": "any",
+ "use_multihop": false
+ }
+ }
+ },
+ "settings_version": 12,
+ "show_beta_releases": false,
+ "tunnel_options": {
+ "dns_options": {
+ "custom_options": {
+ "addresses": []
+ },
+ "default_options": {
+ "block_ads": false,
+ "block_adult_content": false,
+ "block_gambling": false,
+ "block_malware": false,
+ "block_social_media": false,
+ "block_trackers": false
+ },
+ "state": "default"
+ },
+ "generic": {
+ "enable_ipv6": false
+ },
+ "openvpn": {
+ "mssfix": null
+ },
+ "wireguard": {
+ "daita": {
+ "enabled": false,
+ "use_multihop_if_necessary": true
+ },
+ "mtu": null,
+ "quantum_resistant": "auto",
+ "rotation_interval": null
+ }
+ },
+ "update_default_location": false
+}
diff --git a/mullvad-daemon/src/migrations/snapshots/v11.json b/mullvad-daemon/src/migrations/snapshots/v11.json
new file mode 100644
index 0000000000..f028e80c04
--- /dev/null
+++ b/mullvad-daemon/src/migrations/snapshots/v11.json
@@ -0,0 +1,120 @@
+{
+ "allow_lan": false,
+ "api_access_methods": {
+ "custom": [],
+ "direct": {
+ "access_method": {
+ "built_in": "direct"
+ },
+ "enabled": true,
+ "id": "140123fa-a11c-4054-ba5d-591d8cbaa219",
+ "name": "Direct"
+ },
+ "encrypted_dns_proxy": {
+ "access_method": {
+ "built_in": "encrypted_dns_proxy"
+ },
+ "enabled": true,
+ "id": "ba10d242-3af8-4185-87cb-ab3b50c868a6",
+ "name": "Encrypted DNS proxy"
+ },
+ "mullvad_bridges": {
+ "access_method": {
+ "built_in": "bridge"
+ },
+ "enabled": true,
+ "id": "e3936387-494a-4277-b98a-688d94a862fd",
+ "name": "Mullvad Bridges"
+ }
+ },
+ "auto_connect": false,
+ "bridge_settings": {
+ "bridge_type": "normal",
+ "custom": null,
+ "normal": {
+ "location": "any",
+ "ownership": "any",
+ "providers": "any"
+ }
+ },
+ "bridge_state": "auto",
+ "custom_lists": {
+ "custom_lists": []
+ },
+ "block_when_disconnected": false,
+ "obfuscation_settings": {
+ "selected_obfuscation": "auto",
+ "shadowsocks": {
+ "port": "any"
+ },
+ "udp2tcp": {
+ "port": "any"
+ }
+ },
+ "recents": [],
+ "relay_overrides": [],
+ "relay_settings": {
+ "normal": {
+ "location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "openvpn_constraints": {
+ "port": "any"
+ },
+ "ownership": "any",
+ "providers": "any",
+ "tunnel_protocol": "wireguard",
+ "wireguard_constraints": {
+ "allowed_ips": "any",
+ "entry_location": {
+ "only": {
+ "location": {
+ "country": "se"
+ }
+ }
+ },
+ "ip_version": "any",
+ "port": "any",
+ "use_multihop": false
+ }
+ }
+ },
+ "settings_version": 11,
+ "show_beta_releases": false,
+ "tunnel_options": {
+ "dns_options": {
+ "custom_options": {
+ "addresses": []
+ },
+ "default_options": {
+ "block_ads": false,
+ "block_adult_content": false,
+ "block_gambling": false,
+ "block_malware": false,
+ "block_social_media": false,
+ "block_trackers": false
+ },
+ "state": "default"
+ },
+ "generic": {
+ "enable_ipv6": false
+ },
+ "openvpn": {
+ "mssfix": null
+ },
+ "wireguard": {
+ "daita": {
+ "enabled": false,
+ "use_multihop_if_necessary": true
+ },
+ "mtu": null,
+ "quantum_resistant": "auto",
+ "rotation_interval": null
+ }
+ },
+ "update_default_location": false
+}
diff --git a/mullvad-daemon/src/migrations/v11.rs b/mullvad-daemon/src/migrations/v11.rs
index 905361bad6..18e6a36d1f 100644
--- a/mullvad-daemon/src/migrations/v11.rs
+++ b/mullvad-daemon/src/migrations/v11.rs
@@ -157,9 +157,29 @@ fn migrate_duplicated_api_access_method_names(settings: &mut serde_json::Value)
mod test {
use serde_json::json;
+ use crate::migrations::load_seed;
+ use crate::migrations::v11::migrate;
use crate::migrations::v11::migrate_block_when_disconnected;
use crate::migrations::v11::migrate_duplicated_api_access_method_names;
+ fn v11_settings() -> serde_json::Value {
+ load_seed("v11.json")
+ }
+
+ #[test]
+ fn snapshot_v11_settings() {
+ let v11 = serde_json::to_string_pretty(&v11_settings()).unwrap();
+ insta::assert_snapshot!(v11);
+ }
+
+ #[test]
+ fn test_v11_to_v12_migration() {
+ let mut v11 = v11_settings();
+ migrate(&mut v11).unwrap();
+ let v12 = serde_json::to_string_pretty(&v11).unwrap();
+ insta::assert_snapshot!(v12);
+ }
+
/// "block_when_disconnected" is renamed to "lockdown_mode"
#[test]
fn test_v11_to_v12_migration_block_when_disconnected_disabled() {