From aff379ba21f4e085bd34923e9a909ef26d6293b5 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Fri, 6 Mar 2020 11:02:46 +0300 Subject: [PATCH] Delete excess ruby scripts --- Scripts/environment.rb.example | 64 -------------------------------- Scripts/fill_vpn_profile.rb | 35 ----------------- Scripts/vpn_profile_template.erb | 25 ------------- 3 files changed, 124 deletions(-) delete mode 100644 Scripts/environment.rb.example delete mode 100644 Scripts/fill_vpn_profile.rb delete mode 100644 Scripts/vpn_profile_template.erb diff --git a/Scripts/environment.rb.example b/Scripts/environment.rb.example deleted file mode 100644 index 86f6e62..0000000 --- a/Scripts/environment.rb.example +++ /dev/null @@ -1,64 +0,0 @@ -# Your OpenVPN username -if ENV["OPENVPN_USERNAME"].nil? - ENV["OPENVPN_USERNAME"] = "Username" -end - -# Your OpenVPN password -if ENV["OPENVPN_PASSWORD"].nil? - ENV["OPENVPN_PASSWORD"] = "Password" -end - -# Your OpenVPN configuration -if ENV["OPENVPN_CONFIGURATION"].nil? - ENV["OPENVPN_CONFIGURATION"] = <<~END - client - dev tun - proto udp - - remote X.X.X.X 1194 - - remote-random - resolv-retry infinite - nobind - cipher AES-256-CBC - auth SHA512 - comp-lzo no - verb 3 - - tun-mtu 1500 - tun-mtu-extra 32 - mssfix 1450 - persist-key - persist-tun - - reneg-sec 0 - - remote-cert-tls server - auth-user-pass - pull - fast-io - - - -----BEGIN CERTIFICATE----- - ... - -----END CERTIFICATE----- - - - key-direction 1 - - - # 2048 bit OpenVPN static key - -----BEGIN OpenVPN Static key V1----- - ... - -----END OpenVPN Static key V1----- - - END -end - -if ENV["OPENVPN_REMOTE_HOST"].nil? - ENV["OPENVPN_REMOTE_HOST"] = "Remote Host Address" -end - -if ENV["OPENVPN_REMOTE_PORT"].nil? - ENV["OPENVPN_REMOTE_PORT"] = "Remote Host Port" -end diff --git a/Scripts/fill_vpn_profile.rb b/Scripts/fill_vpn_profile.rb deleted file mode 100644 index 9259968..0000000 --- a/Scripts/fill_vpn_profile.rb +++ /dev/null @@ -1,35 +0,0 @@ -environment_file = File.join(ENV["SRCROOT"], "Scripts", "environment.rb") -if File.exist?(environment_file) - require "#{environment_file}" -end - -require "erb" - -if ENV["OPENVPN_USERNAME"].nil? || ENV["OPENVPN_PASSWORD"].nil? || ENV["OPENVPN_CONFIGURATION"].nil? - puts "warning: VPN profile data is missing, you need to fill VPNProfile.swift manually." - exit(true) -end - -template_file = File.join(ENV["SRCROOT"], "Scripts", "vpn_profile_template.erb") -unless File.exist?(template_file) - puts "error: Template file does not exist." - exit(false) -end - -output_file = File.join(ENV["SRCROOT"], "Tests", "VPNProfile.swift") -unless File.exist?(output_file) - puts "error: Output file does not exist." - exit(false) -end - -OPENVPN_USERNAME = ENV["OPENVPN_USERNAME"] -OPENVPN_PASSWORD = ENV["OPENVPN_PASSWORD"] -OPENVPN_CONFIGURATION = ENV["OPENVPN_CONFIGURATION"] -OPENVPN_REMOTE_HOST = ENV["OPENVPN_REMOTE_HOST"] -OPENVPN_REMOTE_PORT = ENV["OPENVPN_REMOTE_PORT"] - -template_content = File.read(template_file) -erb_template = ERB.new(template_content, nil, ">") - -result = erb_template.result -File.write(output_file, result) diff --git a/Scripts/vpn_profile_template.erb b/Scripts/vpn_profile_template.erb deleted file mode 100644 index 4aa7336..0000000 --- a/Scripts/vpn_profile_template.erb +++ /dev/null @@ -1,25 +0,0 @@ -// -// 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: String = "<%= OPENVPN_USERNAME %>" - static let password: String = "<%= OPENVPN_PASSWORD %>" - - static let configuration: String = """ -<% OPENVPN_CONFIGURATION.each_line do |line| %> - <%= line %> -<% end %> - """ - - static let remoteHost: String = "<%= OPENVPN_REMOTE_HOST %>" - static let remotePort: Int = <%= OPENVPN_REMOTE_PORT %> - -}