Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mullvad debug relay enable|disable commands #7817

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarkusPettersson98
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 commented Mar 13, 2025

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.


This change is Reviewable

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.
Copy link
Contributor

@hulthe hulthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions


mullvad-cli/src/cmds/debug.rs line 22 at r1 (raw file):

    Disable { relay: String },
    /// (Re)Activate this relay
    Enable { relay: String },

⛏️ Maybe mention that relay can be city/country/hostname/protocol? I would never guess that last one heh


mullvad-cli/src/cmds/debug.rs line 58 at r1 (raw file):

                let mut rpc = MullvadProxyClient::new().await?;
                rpc.disable_relay(relay.clone()).await?;
                println!("Disabled relay {relay}");

⛏️ "Disabled relay se" or "Disabled relay wireguard" sounds a little weird, but w/e. It's just for debugging.


mullvad-daemon/src/lib.rs line 3096 at r1 (raw file):

    // Debug features

    /// Mark [relay] as inactive in the daemon's relay list.

should probably say "active or inactive" or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants