summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2024-05-30 10:53:00 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-06-10 08:16:27 +0200
commitd1dab61e4a0baab405537e58deb3d9cd882218c7 (patch)
tree86dc994d833b3886c74e9e6e28d440eb942cb14d
parent8a7bc6ab42b627c99cac79905391f0a267bc64cf (diff)
downloadmullvadvpn-d1dab61e4a0baab405537e58deb3d9cd882218c7.tar.xz
mullvadvpn-d1dab61e4a0baab405537e58deb3d9cd882218c7.zip
Fix conncheck to work on staging environment
-rw-r--r--ios/Configurations/Api.xcconfig.template13
-rw-r--r--ios/MullvadVPN/GeneralAPIs/OutgoingConnectionProxy.swift2
-rw-r--r--ios/MullvadVPN/Supporting Files/Info.plist2
-rw-r--r--ios/PacketTunnel/Info.plist2
-rw-r--r--ios/Shared/ApplicationConfiguration.swift14
5 files changed, 24 insertions, 9 deletions
diff --git a/ios/Configurations/Api.xcconfig.template b/ios/Configurations/Api.xcconfig.template
index 99d1fc1fc1..cddd4f815a 100644
--- a/ios/Configurations/Api.xcconfig.template
+++ b/ios/Configurations/Api.xcconfig.template
@@ -1,7 +1,12 @@
-API_HOST_NAME[config=Debug] = api.mullvad.net
-API_HOST_NAME[config=Release] = api.mullvad.net
-API_HOST_NAME[config=MockRelease] = api.mullvad.net
-API_HOST_NAME[config=Staging] = api.stagemole.eu
+HOST_NAME[config=Debug] = mullvad.net
+HOST_NAME[config=Release] = mullvad.net
+HOST_NAME[config=MockRelease] = mullvad.net
+HOST_NAME[config=Staging] = stagemole.eu
+
+API_HOST_NAME[config=Debug] = api.$(HOST_NAME)
+API_HOST_NAME[config=Release] = api.$(HOST_NAME)
+API_HOST_NAME[config=MockRelease] = api.$(HOST_NAME)
+API_HOST_NAME[config=Staging] = api.$(HOST_NAME)
API_ENDPOINT[config=Debug] = 45.83.223.196:443
API_ENDPOINT[config=Release] = 45.83.223.196:443
diff --git a/ios/MullvadVPN/GeneralAPIs/OutgoingConnectionProxy.swift b/ios/MullvadVPN/GeneralAPIs/OutgoingConnectionProxy.swift
index 233bd4d763..9b23a4cf58 100644
--- a/ios/MullvadVPN/GeneralAPIs/OutgoingConnectionProxy.swift
+++ b/ios/MullvadVPN/GeneralAPIs/OutgoingConnectionProxy.swift
@@ -21,7 +21,7 @@ final class OutgoingConnectionProxy: OutgoingConnectionHandling {
case v4 = "ipv4", v6 = "ipv6"
var host: String {
- "\(rawValue).am.i.mullvad.net"
+ "\(rawValue).am.i.\(ApplicationConfiguration.hostName)"
}
}
diff --git a/ios/MullvadVPN/Supporting Files/Info.plist b/ios/MullvadVPN/Supporting Files/Info.plist
index b6b1ffa003..64cc53a997 100644
--- a/ios/MullvadVPN/Supporting Files/Info.plist
+++ b/ios/MullvadVPN/Supporting Files/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>HostName</key>
+ <string>$(HOST_NAME)</string>
<key>NSLocalNetworkUsageDescription</key>
<string>The app needs this to connect and test a new method.</string>
<key>ApplicationSecurityGroupIdentifier</key>
diff --git a/ios/PacketTunnel/Info.plist b/ios/PacketTunnel/Info.plist
index f6e4c63b45..35b671be8f 100644
--- a/ios/PacketTunnel/Info.plist
+++ b/ios/PacketTunnel/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>HostName</key>
+ <string>$(HOST_NAME)</string>
<key>ApplicationSecurityGroupIdentifier</key>
<string>$(SECURITY_GROUP_IDENTIFIER)</string>
<key>MainApplicationIdentifier</key>
diff --git a/ios/Shared/ApplicationConfiguration.swift b/ios/Shared/ApplicationConfiguration.swift
index 403c6ff7fa..cec93c0b3c 100644
--- a/ios/Shared/ApplicationConfiguration.swift
+++ b/ios/Shared/ApplicationConfiguration.swift
@@ -9,10 +9,14 @@
import Foundation
import Network
+// swiftlint:disable force_cast
enum ApplicationConfiguration {
+ static var hostName: String {
+ Bundle.main.object(forInfoDictionaryKey: "HostName") as! String
+ }
+
/// Shared container security group identifier.
static var securityGroupIdentifier: String {
- // swiftlint:disable:next force_cast
Bundle.main.object(forInfoDictionaryKey: "ApplicationSecurityGroupIdentifier") as! String
}
@@ -59,14 +63,16 @@ enum ApplicationConfiguration {
static let logMaximumFileSize: UInt64 = 131_072 // 128 kB.
/// Privacy policy URL.
- static let privacyPolicyURL = URL(string: "https://mullvad.net/help/privacy-policy/")!
+ static let privacyPolicyURL = URL(string: "https://\(Self.hostName)/help/privacy-policy/")!
/// Make a start regarding policy URL.
- static let privacyGuidesURL = URL(string: "https://mullvad.net/help/first-steps-towards-online-privacy/")!
+ static let privacyGuidesURL = URL(string: "https://\(Self.hostName)/help/first-steps-towards-online-privacy/")!
/// FAQ & Guides URL.
- static let faqAndGuidesURL = URL(string: "https://mullvad.net/help/tag/mullvad-app/")!
+ static let faqAndGuidesURL = URL(string: "https://\(Self.hostName)/help/tag/mullvad-app/")!
/// Maximum number of devices per account.
static let maxAllowedDevices = 5
}
+
+// swiftlint:enable force_cast