From cf52aaca006d5d925a131db4ed54b0845004c0f4 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 27 Sep 2018 13:48:30 +0300 Subject: [PATCH] Add VPN profile template and corresponding target file --- OpenVPNAdapter.xcodeproj/project.pbxproj | 8 ++++++++ Scripts/vpn_profile_template.erb | 18 ++++++++++++++++++ Tests/VPNProfile.swift | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Scripts/vpn_profile_template.erb create mode 100644 Tests/VPNProfile.swift diff --git a/OpenVPNAdapter.xcodeproj/project.pbxproj b/OpenVPNAdapter.xcodeproj/project.pbxproj index 4665f07..5832e64 100644 --- a/OpenVPNAdapter.xcodeproj/project.pbxproj +++ b/OpenVPNAdapter.xcodeproj/project.pbxproj @@ -35,6 +35,8 @@ C915F2231F61B0E700B3DF23 /* keyfile-decrypted.3des in Resources */ = {isa = PBXBuildFile; fileRef = C915F2211F61B0E700B3DF23 /* keyfile-decrypted.3des */; }; C915F2251F61B22300B3DF23 /* test-ca.crt in Resources */ = {isa = PBXBuildFile; fileRef = C915F2241F61B22300B3DF23 /* test-ca.crt */; }; C915F2261F61B22300B3DF23 /* test-ca.crt in Resources */ = {isa = PBXBuildFile; fileRef = C915F2241F61B22300B3DF23 /* test-ca.crt */; }; + C924E19E215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */; }; + C924E19F215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */; }; C9310BBE20FF63A400838910 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9310BBD20FF63A400838910 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; C9310BC120FF6E9700838910 /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9310BC020FF6E9700838910 /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9310BC220FF6E9700838910 /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9310BC020FF6E9700838910 /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -193,6 +195,8 @@ C915F21E1F6199E300B3DF23 /* keyfile-encrypted.3des */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "keyfile-encrypted.3des"; sourceTree = ""; }; C915F2211F61B0E700B3DF23 /* keyfile-decrypted.3des */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "keyfile-decrypted.3des"; sourceTree = ""; }; C915F2241F61B22300B3DF23 /* test-ca.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "test-ca.crt"; sourceTree = ""; }; + C924E19C215CE9BC00AEDEB5 /* vpn_profile_template.erb */ = {isa = PBXFileReference; lastKnownFileType = text; path = vpn_profile_template.erb; sourceTree = ""; }; + C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNProfile.swift; sourceTree = ""; }; C9310BBD20FF63A400838910 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; C9310BC020FF6E9700838910 /* Umbrella-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Umbrella-Header.h"; path = "OpenVPNAdapter/Umbrella-Header.h"; sourceTree = ""; }; C9354F431F1E49A500F4C935 /* OpenVPNReachabilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenVPNReachabilityTests.swift; sourceTree = ""; }; @@ -398,6 +402,7 @@ C924E19B215CE76600AEDEB5 /* Scripts */ = { isa = PBXGroup; children = ( + C924E19C215CE9BC00AEDEB5 /* vpn_profile_template.erb */, ); path = Scripts; sourceTree = ""; @@ -541,6 +546,7 @@ isa = PBXGroup; children = ( C9C1E4131FA475B7006ECA7D /* CustomFlow.swift */, + C924E19D215CEBFC00AEDEB5 /* VPNProfile.swift */, ); name = Helpers; sourceTree = ""; @@ -897,6 +903,7 @@ buildActionMask = 2147483647; files = ( C9C1E4141FA475B7006ECA7D /* CustomFlow.swift in Sources */, + C924E19E215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */, C94605E91EAA656B00971516 /* OpenVPNConfigurationTests.swift in Sources */, C9BB47911E71821A00F3F98C /* OpenVPNAdapterTests.swift in Sources */, C915F1F91F615BB400B3DF23 /* OpenVPNPrivateKeyTests.swift in Sources */, @@ -936,6 +943,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + C924E19F215CEBFC00AEDEB5 /* VPNProfile.swift in Sources */, C94605EA1EAA65F200971516 /* OpenVPNConfigurationTests.swift in Sources */, C9D2ABF61EA212A3007EDF9D /* OpenVPNAdapterTests.swift in Sources */, C9CA4DE21F603A5300C4F184 /* OpenVPNCertificateTests.swift in Sources */, diff --git a/Scripts/vpn_profile_template.erb b/Scripts/vpn_profile_template.erb new file mode 100644 index 0000000..7d9b346 --- /dev/null +++ b/Scripts/vpn_profile_template.erb @@ -0,0 +1,18 @@ +// +// VPNProfile.swift +// OpenVPNAdapter +// +// Created by Sergey Abramchuk on 27/09/2018. +// +// Do not commit changes of this file to the repo! + +import Foundation + +struct VPNProfile { + static let username = "<%= OPENVPN_USERNAME %>" + static let password = "<%= OPENVPN_PASSWORD %>" + + static let configuration = """ + <%= OPENVPN_CONFIGURATION %> + """ +} diff --git a/Tests/VPNProfile.swift b/Tests/VPNProfile.swift new file mode 100644 index 0000000..19f5be6 --- /dev/null +++ b/Tests/VPNProfile.swift @@ -0,0 +1,18 @@ +// +// VPNProfile.swift +// OpenVPNAdapter +// +// Created by Sergey Abramchuk on 27/09/2018. +// +// Do not commit changes of this file to the repo! + +import Foundation + +struct VPNProfile { + static let username = "<%= OPENVPN_USERNAME %>" + static let password = "<%= OPENVPN_PASSWORD %>" + + static let configuration = """ + <%= OPENVPN_CONFIGURATION %> + """ +}