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

Sync is broke for Mullvad and Mozilla #243

Open
mcexit opened this issue Dec 17, 2023 · 5 comments
Open

Sync is broke for Mullvad and Mozilla #243

mcexit opened this issue Dec 17, 2023 · 5 comments

Comments

@mcexit
Copy link

mcexit commented Dec 17, 2023

I don't know if it is permanent, but the URL used to sync WireGuard connections for Mullvad and Mozilla has been causing sync to fail for a couple days. This appears to be primarily because one of the servers in the JSON result is returning null for the socks_name. I tried modifying the code a bit to use Option<String> for socks_name and got further, but then got an error regarding auth_token. I'm not versed in Rust—so the error could have been due to my change—but it is possible the API itself has changed.

I figured out how to use the downloaded zip from my Mullvad account, but the server naming convention is a bit different than before. If you're up for it, then it would be helpful to add some instructions to the user guide or an option to sync "offline" using a zip file or local JSON. I'm happy to submit a PR with instructions for using the zip provided by Mullvad, but I'm not sure if my method exposes any flaws that your method prevents.

@jamesmcm
Copy link
Owner

Thanks, for the heads-up. Unfortunately it seems Mullvad have deprecrated the APIs for working with the Wireguard keys, etc. - https://api.mullvad.net/app/documentation/

(I think we can actually remove socks_name btw, I don't think it's used anywhere internally in the end).

Yeah, if there's no way to deal with the API then it seems that will be the only approach (a bit like what we do with ProtonVPN). It's mainly a pain for having to create and upload your own wireguard key, etc. manually though.

FWIW I think OpenVPN sync should still be doable though as it just uses the relay lists.

For the zip file are you referring to OpenVPN or Wireguard configs btw?

jamesmcm added a commit that referenced this issue Dec 17, 2023
Mullvad has unfortunately deprecated the API for handling Wireguard keys
See issue 243 - #243

This change removes that code and relies on the user uploading their
Wireguard public key and recording the return IPv4 and IPv6 ranges
directly.
sid-code pushed a commit to sid-code/vopono that referenced this issue Dec 30, 2023
Mullvad has unfortunately deprecated the API for handling Wireguard keys
See issue 243 - jamesmcm#243

This change removes that code and relies on the user uploading their
Wireguard public key and recording the return IPv4 and IPv6 ranges
directly.
sid-code pushed a commit to sid-code/vopono that referenced this issue Dec 30, 2023
Mullvad has unfortunately deprecated the API for handling Wireguard keys
See issue 243 - jamesmcm#243

This change removes that code and relies on the user uploading their
Wireguard public key and recording the return IPv4 and IPv6 ranges
directly.
@cg9999
Copy link

cg9999 commented Jan 11, 2024

Would https://api.mullvad.net/accounts/v1/#operation/createDevice work as a replacement?

@jamesmcm
Copy link
Owner

Thanks, it looks good, I just need to look in to how you get the access token.

@jamesmcm
Copy link
Owner

Cool looking at their code, it seems it is:

$ curl https://api.mullvad.net/auth/v1/token -H "Content-Type: application/json" --request POST --data '{"account_number": "$ACCOUNT_NUMBER"}'

Then it's more or less the same logic as before, just all of the calls need to be updated for the new versions and passing the token differently.

@jamesmcm
Copy link
Owner

Fixed for Mullvad in #246 , unfortunately I couldn't find Mozilla's API docs online and I don't have an account right now to try it.

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

No branches or pull requests

3 participants