Allow creation of OpenVPN provider module (#755)
Behind paywall as per #712 Fixes #712
This commit is contained in:
parent
bf3c50c348
commit
5fcb710d5e
|
@ -41,7 +41,7 @@
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
|
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "a0cb540f739c58d04756d15b9a7bb21fae52c95f"
|
"revision" : "4fffdbde18ddaa5ab0fdfa9ee417a0f5015f59c6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ let package = Package(
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.9.0"),
|
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.9.0"),
|
||||||
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "a0cb540f739c58d04756d15b9a7bb21fae52c95f"),
|
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "4fffdbde18ddaa5ab0fdfa9ee417a0f5015f59c6"),
|
||||||
// .package(path: "../../../passepartoutkit-source"),
|
// .package(path: "../../../passepartoutkit-source"),
|
||||||
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.9.1"),
|
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.9.1"),
|
||||||
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),
|
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),
|
||||||
|
|
|
@ -115,7 +115,6 @@ private extension AppContext {
|
||||||
try await tunnel.disconnect()
|
try await tunnel.disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// FIXME: #379, reconnect in some scenarios, e.g. changing provider server
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,8 @@ extension ProfileEditor {
|
||||||
.allCases
|
.allCases
|
||||||
.filter {
|
.filter {
|
||||||
// TODO: #657, hide manual OpenVPN/WireGuard until editable
|
// TODO: #657, hide manual OpenVPN/WireGuard until editable
|
||||||
$0 != .openVPN && $0 != .wireGuard
|
// $0 != .openVPN && $0 != .wireGuard
|
||||||
|
$0 != .wireGuard
|
||||||
}
|
}
|
||||||
.filter {
|
.filter {
|
||||||
!moduleTypes.contains($0)
|
!moduleTypes.contains($0)
|
||||||
|
|
|
@ -69,7 +69,7 @@ private extension OpenVPNView {
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
var contentView: some View {
|
var contentView: some View {
|
||||||
if isServerPushed {
|
if isServerPushed || draft.wrappedValue.configurationBuilder != nil {
|
||||||
manualView
|
manualView
|
||||||
} else {
|
} else {
|
||||||
manualView
|
manualView
|
||||||
|
@ -81,7 +81,7 @@ private extension OpenVPNView {
|
||||||
VPNProviderContentModifier(
|
VPNProviderContentModifier(
|
||||||
providerId: providerId,
|
providerId: providerId,
|
||||||
selectedEntity: providerEntity,
|
selectedEntity: providerEntity,
|
||||||
isRequired: draft.wrappedValue.configurationBuilder == nil,
|
isRequired: true,
|
||||||
entityDestination: Subroute.providerServer,
|
entityDestination: Subroute.providerServer,
|
||||||
providerRows: {
|
providerRows: {
|
||||||
moduleGroup(for: providerAccountRows)
|
moduleGroup(for: providerAccountRows)
|
||||||
|
|
|
@ -112,7 +112,10 @@ private extension ProfileCoordinator {
|
||||||
case .ip:
|
case .ip:
|
||||||
paywallReason = iapManager.paywallReason(forFeature: .routing)
|
paywallReason = iapManager.paywallReason(forFeature: .routing)
|
||||||
|
|
||||||
case .onDemand, .openVPN, .wireGuard:
|
case .openVPN, .wireGuard:
|
||||||
|
paywallReason = iapManager.paywallReason(forFeature: .providers)
|
||||||
|
|
||||||
|
case .onDemand:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
guard paywallReason == nil else {
|
guard paywallReason == nil else {
|
||||||
|
|
|
@ -78,8 +78,10 @@ extension ProfileEditorTests {
|
||||||
XCTAssertFalse(moduleTypes.contains(.ip))
|
XCTAssertFalse(moduleTypes.contains(.ip))
|
||||||
XCTAssertTrue(moduleTypes.contains(.onDemand))
|
XCTAssertTrue(moduleTypes.contains(.onDemand))
|
||||||
|
|
||||||
|
// provider only
|
||||||
|
XCTAssertTrue(moduleTypes.contains(.openVPN))
|
||||||
|
|
||||||
// until editable
|
// until editable
|
||||||
XCTAssertFalse(moduleTypes.contains(.openVPN))
|
|
||||||
XCTAssertFalse(moduleTypes.contains(.wireGuard))
|
XCTAssertFalse(moduleTypes.contains(.wireGuard))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue