summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src/management_interface.rs
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2025-03-13 09:34:44 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2025-04-04 16:17:49 +0200
commitf2a77bab45ebfdbd1122a2195f9ccd8368babb47 (patch)
tree59fd54f54482541a89e175040c9e5fb868a734e4 /mullvad-daemon/src/management_interface.rs
parentf8f47dcb7543193a7b03fd0528a3540dcb5eed01 (diff)
downloadmullvadvpn-f2a77bab45ebfdbd1122a2195f9ccd8368babb47.tar.xz
mullvadvpn-f2a77bab45ebfdbd1122a2195f9ccd8368babb47.zip
Implement new debug commands: `relay disable` and `relay enable`
Add two new `mullvad debug` subcommands: - mullvad debug relay enable <country|city|hostname|openvpn|wireguard> - mullvad debug relay disable <country|city|hostname|openvpn|wireguard> These commands are used to update the state of relays the current relay list. This is useful to mock relays going offline or coming online from an offline state. These new debug commands were conceived during the development of the feature for adding warnings for the upcoming OpenVPN deprecation, as there wasn't a convenient way of mocking this.
Diffstat (limited to 'mullvad-daemon/src/management_interface.rs')
-rw-r--r--mullvad-daemon/src/management_interface.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/mullvad-daemon/src/management_interface.rs b/mullvad-daemon/src/management_interface.rs
index 8249aea968..3efe41e288 100644
--- a/mullvad-daemon/src/management_interface.rs
+++ b/mullvad-daemon/src/management_interface.rs
@@ -1095,6 +1095,26 @@ impl ManagementService for ManagementServiceImpl {
Ok(Response::new(feature_indicators))
}
+
+ // Debug features
+
+ async fn disable_relay(&self, relay: Request<String>) -> ServiceResult<()> {
+ log::debug!("disable_relay");
+ let (tx, rx) = oneshot::channel();
+ let relay = relay.into_inner();
+ self.send_command_to_daemon(DaemonCommand::DisableRelay { relay, tx })?;
+ self.wait_for_result(rx).await?;
+ Ok(Response::new(()))
+ }
+
+ async fn enable_relay(&self, relay: Request<String>) -> ServiceResult<()> {
+ log::debug!("enable_relay");
+ let (tx, rx) = oneshot::channel();
+ let relay = relay.into_inner();
+ self.send_command_to_daemon(DaemonCommand::EnableRelay { relay, tx })?;
+ self.wait_for_result(rx).await?;
+ Ok(Response::new(()))
+ }
}
impl ManagementServiceImpl {