Update TunnelKit

- Set explicit tunnel log path

- OpenSSL 1.1.1o
This commit is contained in:
Davide De Rosa 2022-06-17 08:27:56 +02:00
parent bb1a35acea
commit 02a9db057f
10 changed files with 31 additions and 6 deletions

View File

@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/passepartoutvpn/openssl-apple",
"state": {
"branch": null,
"revision": "cbbff97a99384a5415bb47c072c376066b78f65f",
"version": "1.1.11300"
"revision": "1c03f4d3fc1d90a0a525af68f06eada56e5e8bb1",
"version": "1.1.11500"
}
},
{
@ -51,7 +51,7 @@
"repositoryURL": "https://github.com/passepartoutvpn/tunnelkit",
"state": {
"branch": null,
"revision": "6e0471a55b8277ff0b21e4dd3dfcfcc8da5f0355",
"revision": "36ed23ccc4e6083d671b6b823f50787b018f2844",
"version": null
}
},

View File

@ -157,8 +157,14 @@ extension Constants {
.appendingPathComponent(filename)
}
private static func containerLogPath(filename: String) -> String {
"\(parentPath)/\(filename)"
}
static let appLogURL = containerLogURL(filename: "App.log")
static let tunnelLogPath = containerLogPath(filename: "Tunnel.log")
static let logLevel: SwiftyBeaver.Level = {
guard let levelString = ProcessInfo.processInfo.environment["LOG_LEVEL"], let levelNum = Int(levelString) else {
return .info

View File

@ -112,6 +112,7 @@ class CoreContext {
private func configureObjects() {
providerManager.rateLimitMilliseconds = Constants.RateLimit.providerManager
vpnManager.tunnelLogPath = Constants.Log.tunnelLogPath
vpnManager.tunnelLogFormat = Constants.Log.tunnelLogFormat
profileManager.observeUpdates()

View File

@ -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: "4.1.0"),
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("6e0471a55b8277ff0b21e4dd3dfcfcc8da5f0355")),
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", .revision("36ed23ccc4e6083d671b6b823f50787b018f2844")),
// .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")

View File

@ -56,6 +56,7 @@ extension Profile.OpenVPNSettings: VPNConfigurationProviding {
configuration: customConfiguration
)
cfg.shouldDebug = true
cfg.debugLogPath = parameters.preferences.tunnelLogPath
cfg.debugLogFormat = parameters.preferences.tunnelLogFormat
cfg.masksPrivateData = parameters.preferences.masksPrivateData
cfg.username = parameters.username

View File

@ -47,6 +47,7 @@ extension Profile.WireGuardSettings: VPNConfigurationProviding {
configuration: customConfiguration
)
cfg.shouldDebug = true
cfg.debugLogPath = parameters.preferences.tunnelLogPath
cfg.debugLogFormat = parameters.preferences.tunnelLogFormat
var extra = NetworkExtensionExtra()

View File

@ -28,6 +28,7 @@ import Foundation
extension VPNManager {
private var vpnPreferences: VPNPreferences {
DefaultVPNPreferences(
tunnelLogPath: tunnelLogPath,
tunnelLogFormat: tunnelLogFormat,
masksPrivateData: masksPrivateData
)

View File

@ -259,6 +259,15 @@ extension VPNManager {
// MARK: KeyValueStore
extension VPNManager {
public var tunnelLogPath: String? {
get {
store.value(forLocation: StoreKey.tunnelLogPath)
}
set {
store.setValue(newValue, forLocation: StoreKey.tunnelLogPath)
}
}
public var tunnelLogFormat: String? {
get {
store.value(forLocation: StoreKey.tunnelLogFormat)
@ -282,6 +291,8 @@ extension VPNManager {
private extension VPNManager {
private enum StoreKey: String, KeyStoreDomainLocation {
case tunnelLogPath
case tunnelLogFormat
case masksPrivateData

View File

@ -281,10 +281,10 @@ extension VPNManager {
public func debugLogURL(forProtocol vpnProtocol: VPNProtocolType) -> URL? {
switch vpnProtocol {
case .openVPN:
return FileManager.default.openVPNURLForDebugLog(appGroup: appGroup)
return defaults.openVPNURLForDebugLog(appGroup: appGroup)
default:
return FileManager.default.wireGuardURLForDebugLog(appGroup: appGroup)
return defaults.wireGuardURLForDebugLog(appGroup: appGroup)
}
}

View File

@ -26,12 +26,16 @@
import Foundation
public protocol VPNPreferences {
var tunnelLogPath: String? { get }
var tunnelLogFormat: String? { get }
var masksPrivateData: Bool { get }
}
struct DefaultVPNPreferences: VPNPreferences {
let tunnelLogPath: String?
let tunnelLogFormat: String?
let masksPrivateData: Bool