Restore DNS "Domain" setting (#260)
This commit is contained in:
parent
f06f097f27
commit
c85f3d894e
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Prompt for password interactively. [#3](https://github.com/passepartoutvpn/passepartout-apple/issues/3)
|
||||
- Ukranian translations (Dmitry Chirkin). [#243](https://github.com/passepartoutvpn/passepartout-apple/pull/243)
|
||||
- Restore DNS "Domain" setting. [#260](https://github.com/passepartoutvpn/passepartout-apple/pull/260)
|
||||
- OpenVPN: Full implementation of Tunnelblick XOR patch (tmthecoder). [#245](https://github.com/passepartoutvpn/passepartout-apple/pull/245), [tunnelkit#255][https://github.com/passepartoutvpn/tunnelkit/pull/255]
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
"repositoryURL": "https://github.com/passepartoutvpn/tunnelkit",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "47281cafc99dcfd0bdf60d41b3357cdbb33875fa",
|
||||
"revision": "e0c0cc137fbceea6970d226445afa79a7903881c",
|
||||
"version": null
|
||||
}
|
||||
},
|
||||
|
|
|
@ -143,7 +143,8 @@ extension NetworkSettingsView {
|
|||
}
|
||||
if !settings.isAutomaticDNS && settings.dns.configurationType != .disabled {
|
||||
dnsManualServers
|
||||
dnsManualDomains
|
||||
dnsManualDomainRow
|
||||
dnsManualSearchDomains
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +179,12 @@ extension NetworkSettingsView {
|
|||
}
|
||||
}
|
||||
|
||||
private var dnsManualDomains: some View {
|
||||
private var dnsManualDomainRow: some View {
|
||||
TextField(L10n.Global.Strings.domain, text: $settings.dns.dnsDomain ?? "")
|
||||
.themeValidDomainName(settings.dns.dnsDomain)
|
||||
}
|
||||
|
||||
private var dnsManualSearchDomains: some View {
|
||||
Section {
|
||||
EditableTextList(
|
||||
elements: $settings.dns.dnsSearchDomains ?? [],
|
||||
|
|
|
@ -24,7 +24,7 @@ let package = Package(
|
|||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
// .package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", from: "5.0.0"),
|
||||
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("47281cafc99dcfd0bdf60d41b3357cdbb33875fa")),
|
||||
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("e0c0cc137fbceea6970d226445afa79a7903881c")),
|
||||
// .package(name: "TunnelKit", path: "../../tunnelkit"),
|
||||
.package(url: "https://github.com/zoul/generic-json-swift", from: "2.0.0"),
|
||||
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver", from: "1.9.0")
|
||||
|
|
|
@ -54,6 +54,8 @@ public protocol DNSSettingsProviding {
|
|||
|
||||
var dnsServers: [String]? { get }
|
||||
|
||||
var dnsDomain: String? { get }
|
||||
|
||||
var dnsSearchDomains: [String]? { get }
|
||||
|
||||
var dnsHTTPSURL: URL? { get }
|
||||
|
@ -107,6 +109,8 @@ extension Network {
|
|||
|
||||
public var dnsServers: [String]?
|
||||
|
||||
public var dnsDomain: String?
|
||||
|
||||
public var dnsSearchDomains: [String]?
|
||||
|
||||
public var dnsHTTPSURL: URL?
|
||||
|
|
|
@ -53,7 +53,12 @@ extension Profile.OpenVPNSettings: DNSSettingsProviding {
|
|||
configuration.dnsServers
|
||||
}
|
||||
|
||||
// dhcp-option DOMAIN/DOMAIN-SEARCH
|
||||
// dhcp-option DOMAIN
|
||||
public var dnsDomain: String? {
|
||||
configuration.dnsDomain
|
||||
}
|
||||
|
||||
// dhcp-option DOMAIN-SEARCH
|
||||
public var dnsSearchDomains: [String]? {
|
||||
configuration.searchDomains
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@ extension Profile.WireGuardSettings: DNSSettingsProviding {
|
|||
configuration.dnsServers
|
||||
}
|
||||
|
||||
public var dnsDomain: String? {
|
||||
nil
|
||||
}
|
||||
|
||||
public var dnsSearchDomains: [String]? {
|
||||
configuration.dnsSearchDomains
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ extension OpenVPN.ConfigurationBuilder {
|
|||
|
||||
if isDNSEnabled {
|
||||
dnsServers = settings.dnsServers?.filter { !$0.isEmpty }
|
||||
dnsDomain = settings.dnsDomain
|
||||
searchDomains = settings.dnsSearchDomains
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,14 @@ extension WireGuard.ConfigurationBuilder {
|
|||
switch settings.configurationType {
|
||||
case .plain:
|
||||
dnsServers = settings.dnsServers ?? []
|
||||
dnsSearchDomains = settings.dnsSearchDomains?.filter { !$0.isEmpty } ?? []
|
||||
var allDomains: [String] = []
|
||||
if let domain = settings.dnsDomain {
|
||||
allDomains.insert(domain, at: 0)
|
||||
}
|
||||
if let searchDomains = settings.dnsSearchDomains {
|
||||
allDomains.append(contentsOf: searchDomains)
|
||||
}
|
||||
dnsSearchDomains = allDomains.filter { !$0.isEmpty }
|
||||
|
||||
case .disabled:
|
||||
dnsServers = []
|
||||
|
|
Loading…
Reference in New Issue