diff options
| author | Linus Färnstrand <faern@faern.net> | 2021-12-03 16:48:56 +0100 |
|---|---|---|
| committer | Linus Färnstrand <faern@faern.net> | 2021-12-03 16:48:56 +0100 |
| commit | b345cd98c77b2e47b97165df58068609887336c4 (patch) | |
| tree | 97aca1a2527b6f857662bb93197872e9f2ad6a6c | |
| parent | 742525eaf3b7e7eed33ebe642bc27ccdbadf6bdd (diff) | |
| download | mullvadvpn-b345cd98c77b2e47b97165df58068609887336c4.tar.xz mullvadvpn-b345cd98c77b2e47b97165df58068609887336c4.zip | |
Rename MULLVAD_API_ADDRESS to MULLVAD_API_ADDR
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | mullvad-rpc/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-rpc/src/lib.rs | 14 |
3 files changed, 9 insertions, 9 deletions
@@ -459,7 +459,7 @@ echo "org.gradle.jvmargs=-Xmx4608M" >> ~/.gradle/gradle.properties * `MULLVAD_API_HOST` - Set the hostname to use in API requests. E.g. `api.mullvad.net`. -* `MULLVAD_API_ADDRESS` - Set the IP address and port to use in API requests. E.g. `10.10.1.2:443`. +* `MULLVAD_API_ADDR` - Set the IP address and port to use in API requests. E.g. `10.10.1.2:443`. #### Setting environment variable - On Windows, one can use `setx` from an elevated shell, like so diff --git a/mullvad-rpc/Cargo.toml b/mullvad-rpc/Cargo.toml index 614fd7763c..75f80cde88 100644 --- a/mullvad-rpc/Cargo.toml +++ b/mullvad-rpc/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" publish = false [features] -# Allow the API server to use to be configured via MULLVAD_API_HOST and MULLVAD_API_ADDRESS. +# Allow the API server to use to be configured via MULLVAD_API_HOST and MULLVAD_API_ADDR. api-override = [] [dependencies] diff --git a/mullvad-rpc/src/lib.rs b/mullvad-rpc/src/lib.rs index d35cc44ec0..3acc4af50b 100644 --- a/mullvad-rpc/src/lib.rs +++ b/mullvad-rpc/src/lib.rs @@ -63,8 +63,8 @@ impl ApiEndpoint { /// /// # Panics /// - /// Panics if `MULLVAD_API_ADDRESS` has invalid contents or if only one of - /// `MULLVAD_API_ADDRESS` or `MULLVAD_API_HOST` has been set but not the other. + /// Panics if `MULLVAD_API_ADDR` has invalid contents or if only one of + /// `MULLVAD_API_ADDR` or `MULLVAD_API_HOST` has been set but not the other. fn get() -> ApiEndpoint { const API_HOST_DEFAULT: &str = "api.mullvad.net"; const API_IP_DEFAULT: IpAddr = IpAddr::V4(Ipv4Addr::new(193, 138, 218, 78)); @@ -80,7 +80,7 @@ impl ApiEndpoint { } let host_var = read_var("MULLVAD_API_HOST"); - let address_var = read_var("MULLVAD_API_ADDRESS"); + let address_var = read_var("MULLVAD_API_ADDR"); let mut api = ApiEndpoint { host: API_HOST_DEFAULT.to_owned(), @@ -91,13 +91,13 @@ impl ApiEndpoint { if cfg!(feature = "api-override") { match (host_var, address_var) { (None, None) => (), - (Some(_), None) => panic!("MULLVAD_API_HOST is set, but not MULLVAD_API_ADDRESS"), - (None, Some(_)) => panic!("MULLVAD_API_ADDRESS is set, but not MULLVAD_API_HOST"), + (Some(_), None) => panic!("MULLVAD_API_HOST is set, but not MULLVAD_API_ADDR"), + (None, Some(_)) => panic!("MULLVAD_API_ADDR is set, but not MULLVAD_API_HOST"), (Some(user_host), Some(user_addr)) => { api.host = user_host; api.addr = user_addr .parse() - .expect("MULLVAD_API_ADDRESS is not a valid socketaddr"); + .expect("MULLVAD_API_ADDR is not a valid socketaddr"); api.disable_address_rotation = true; log::debug!("Overriding API. Using {} at {}", api.host, api.addr); } @@ -105,7 +105,7 @@ impl ApiEndpoint { } else { if host_var.is_some() || address_var.is_some() { log::warn!( - "MULLVAD_API_HOST and MULLVAD_API_ADDRESS are ignored in production builds" + "MULLVAD_API_HOST and MULLVAD_API_ADDR are ignored in production builds" ); } } |
