Implement --remote-random-hostname

- Update TunnelKit

- Show in UI
This commit is contained in:
Davide De Rosa 2022-10-16 14:19:36 +02:00
parent 0f3cc5888c
commit f6e0caaa73
7 changed files with 26 additions and 6 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- OpenVPN: Support for `--remote-random-hostname`. [tunnelkit#286](https://github.com/passepartoutvpn/tunnelkit/pull/286)
## 2.0.1 (2022-10-17) ## 2.0.1 (2022-10-17)
### Added ### Added

View File

@ -51,7 +51,7 @@
"repositoryURL": "https://github.com/passepartoutvpn/tunnelkit", "repositoryURL": "https://github.com/passepartoutvpn/tunnelkit",
"state": { "state": {
"branch": null, "branch": null,
"revision": "8df7e90c95dc1af66b27990b5f00ba21120e9f9d", "revision": "17c272d733a827bb694dd352890f8651d6ce6ec2",
"version": null "version": null
} }
}, },

View File

@ -288,10 +288,14 @@ extension EndpointAdvancedView.OpenVPNView {
Text(L10n.Endpoint.Advanced.Openvpn.Items.RenegotiationSeconds.caption) Text(L10n.Endpoint.Advanced.Openvpn.Items.RenegotiationSeconds.caption)
.withTrailingText($0.localizedDescriptionAsRenegotiatesAfter) .withTrailingText($0.localizedDescriptionAsRenegotiatesAfter)
} }
settings.randomize.map { settings.randomizeEndpoint.map {
Text(L10n.Endpoint.Advanced.Openvpn.Items.RandomEndpoint.caption) Text(L10n.Endpoint.Advanced.Openvpn.Items.RandomEndpoint.caption)
.withTrailingText($0.localizedDescriptionAsRandomizeEndpoint) .withTrailingText($0.localizedDescriptionAsRandomizeEndpoint)
} }
settings.randomizeHostnames.map {
Text(L10n.Endpoint.Advanced.Openvpn.Items.RandomHostname.caption)
.withTrailingText($0.localizedDescriptionAsRandomizeHostnames)
}
} header: { } header: {
Text(L10n.Endpoint.Advanced.Openvpn.Sections.Other.header) Text(L10n.Endpoint.Advanced.Openvpn.Sections.Other.header)
} }
@ -328,11 +332,11 @@ extension OpenVPN.Configuration {
return (httpsProxy ?? httpProxy, proxyAutoConfigurationURL, proxyBypassDomains ?? []) return (httpsProxy ?? httpProxy, proxyAutoConfigurationURL, proxyBypassDomains ?? [])
} }
var otherSettings: (keepAlive: TimeInterval?, reneg: TimeInterval?, randomize: Bool?)? { var otherSettings: (keepAlive: TimeInterval?, reneg: TimeInterval?, randomizeEndpoint: Bool?, randomizeHostnames: Bool?)? {
guard keepAliveInterval != nil || renegotiatesAfter != nil || randomizeEndpoint != nil else { guard keepAliveInterval != nil || renegotiatesAfter != nil || randomizeEndpoint != nil || randomizeHostnames != nil else {
return nil return nil
} }
return (keepAliveInterval, renegotiatesAfter, randomizeEndpoint) return (keepAliveInterval, renegotiatesAfter, randomizeEndpoint, randomizeHostnames)
} }
} }

View File

@ -334,6 +334,10 @@ internal enum L10n {
/// Randomize endpoint /// Randomize endpoint
internal static let caption = L10n.tr("Localizable", "endpoint.advanced.openvpn.items.random_endpoint.caption", fallback: "Randomize endpoint") internal static let caption = L10n.tr("Localizable", "endpoint.advanced.openvpn.items.random_endpoint.caption", fallback: "Randomize endpoint")
} }
internal enum RandomHostname {
/// Randomize hostnames
internal static let caption = L10n.tr("Localizable", "endpoint.advanced.openvpn.items.random_hostname.caption", fallback: "Randomize hostnames")
}
internal enum RenegotiationSeconds { internal enum RenegotiationSeconds {
/// Renegotiation /// Renegotiation
internal static let caption = L10n.tr("Localizable", "endpoint.advanced.openvpn.items.renegotiation_seconds.caption", fallback: "Renegotiation") internal static let caption = L10n.tr("Localizable", "endpoint.advanced.openvpn.items.renegotiation_seconds.caption", fallback: "Renegotiation")

View File

@ -119,6 +119,11 @@ extension Bool {
let V = L10n.Global.Strings.self let V = L10n.Global.Strings.self
return self ? V.enabled : V.disabled return self ? V.enabled : V.disabled
} }
var localizedDescriptionAsRandomizeHostnames: String {
let V = L10n.Global.Strings.self
return self ? V.enabled : V.disabled
}
} }
extension OpenVPN.PullMask { extension OpenVPN.PullMask {

View File

@ -227,6 +227,7 @@
"endpoint.advanced.openvpn.items.renegotiation_seconds.caption" = "Renegotiation"; "endpoint.advanced.openvpn.items.renegotiation_seconds.caption" = "Renegotiation";
"endpoint.advanced.openvpn.items.renegotiation_seconds.value.after" = "after %@"; "endpoint.advanced.openvpn.items.renegotiation_seconds.value.after" = "after %@";
"endpoint.advanced.openvpn.items.random_endpoint.caption" = "Randomize endpoint"; "endpoint.advanced.openvpn.items.random_endpoint.caption" = "Randomize endpoint";
"endpoint.advanced.openvpn.items.random_hostname.caption" = "Randomize hostnames";
/* MARK: ProfileView -> NetworkSettingsView */ /* MARK: ProfileView -> NetworkSettingsView */

View File

@ -24,7 +24,7 @@ let package = Package(
// Dependencies declare other packages that this package depends on. // Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"), // .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", from: "5.0.0"),
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("8df7e90c95dc1af66b27990b5f00ba21120e9f9d")), .package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("17c272d733a827bb694dd352890f8651d6ce6ec2")),
// .package(name: "TunnelKit", path: "../../tunnelkit"), // .package(name: "TunnelKit", path: "../../tunnelkit"),
.package(url: "https://github.com/zoul/generic-json-swift", from: "2.0.0"), .package(url: "https://github.com/zoul/generic-json-swift", from: "2.0.0"),
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver", from: "1.9.0") .package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver", from: "1.9.0")