Skip to content

Commit 4e6e19b

Browse files
committed
Merge branch 'release/v0.7.0'
2 parents e0d1fd1 + e54e678 commit 4e6e19b

11 files changed

+352
-68
lines changed

.chglog/CHANGELOG.tpl.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{ if .Versions -}}
2+
<a name="unreleased"></a>
3+
## [Unreleased]
4+
5+
{{ if .Unreleased.CommitGroups -}}
6+
{{ range .Unreleased.CommitGroups -}}
7+
{{ range .Commits -}}
8+
- {{ .Header }}
9+
{{ end }}
10+
{{ end -}}
11+
{{ else }}
12+
{{ range .Unreleased.Commits -}}
13+
- {{ .Header }}
14+
{{ end }}
15+
{{ end -}}
16+
{{ end -}}
17+
18+
{{ range .Versions }}
19+
<a name="{{ .Tag.Name }}"></a>
20+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
21+
{{ if .CommitGroups -}}
22+
{{ range .CommitGroups -}}
23+
{{ range .Commits -}}
24+
- {{ .Header }}
25+
{{ end }}
26+
{{ end -}}
27+
{{ else }}
28+
{{ range .Commits -}}
29+
- {{ .Header }}
30+
{{ end }}
31+
{{ end -}}
32+
33+
{{- if .RevertCommits -}}
34+
### Reverts
35+
{{ range .RevertCommits -}}
36+
- {{ .Revert.Header }}
37+
{{ end }}
38+
{{ end -}}
39+
40+
{{- if .NoteGroups -}}
41+
{{ range .NoteGroups -}}
42+
### {{ .Title }}
43+
{{ range .Notes }}
44+
{{ .Body }}
45+
{{ end }}
46+
{{ end -}}
47+
{{ end -}}
48+
{{ end -}}
49+
50+
{{- if .Versions }}
51+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
52+
{{ range .Versions -}}
53+
{{ if .Tag.Previous -}}
54+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
55+
{{ end -}}
56+
{{ end -}}
57+
{{ end -}}

.chglog/config.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/iphoting/ovpnmcgen.rb
6+
options:
7+
commits:
8+
# filters:
9+
# Type:
10+
# - feat
11+
# - fix
12+
# - perf
13+
# - refactor
14+
commit_groups:
15+
# title_maps:
16+
# feat: Features
17+
# fix: Bug Fixes
18+
# perf: Performance Improvements
19+
# refactor: Code Refactoring
20+
header:
21+
pattern: "^(.*)$"
22+
pattern_maps:
23+
- Subject
24+
25+
merges:
26+
pattern: "^Merge branch '(\\w+)'$"
27+
pattern_maps:
28+
- Source
29+
30+
reverts:
31+
pattern: "^Revert \"([\\s\\S]*)\"$"
32+
pattern_maps:
33+
- Header
34+
notes:
35+
keywords:
36+
- BREAKING CHANGE

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: ruby
2-
#cache: bundler
32

43
before_install:
54
# https://github.com/travis-ci/travis-ci/issues/8978
@@ -8,10 +7,10 @@ before_install:
87
- bundle version
98

109
rvm:
11-
- 2.2
1210
- 2.3
1311
- 2.4
1412
- 2.5
13+
- 2.6
1514
- ruby-head
1615
- jruby-19mode
1716

@@ -29,5 +28,5 @@ deploy:
2928
on:
3029
tags: true
3130
repo: "iphoting/ovpnmcgen.rb"
32-
ruby: 2.4.0
31+
ruby: 2.4
3332
branch: master

ChangeLog

-46
This file was deleted.

ChangeLog.md

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# ChangeLog
2+
3+
<a name="unreleased"></a>
4+
## [Unreleased]
5+
6+
7+
8+
9+
<a name="v0.7.0"></a>
10+
## [v0.7.0] - 2019-08-31
11+
12+
- Improve url probe handling
13+
- Extract user and device information from p12
14+
- Add support for disconnect on idle timer
15+
- Add support for customizing the VPN profile name
16+
- Make profile uuid stable
17+
- Improve profile description with VPN config map
18+
- Make vpn uuid stable
19+
- Make cert uuid stable
20+
- Add support for TLS-Crypt
21+
- Add workaround for global config flag not being parsed
22+
23+
24+
<a name="v0.6.0"></a>
25+
## [v0.6.0] - 2018-01-27
26+
27+
- Fixed: Without `--p12file`, `AuthenticationMethod` must be set to `Password`.
28+
- Added support for `--cert` and `--key` for inline attachment of certificate and key, to workaround bug in OpenVPN Connect 1.2.5.
29+
- Added `--v12compat` switch for OpenVPN Connect 1.2.x compatibility for updated bundle identifier (VPNSubType) `net.openvpn.connect.app` (changed since OpenVPN Connect 1.2.x).
30+
- Added support for `vpn-on-demand: 0` key/value pair with `--no-vod` is set, so that OpenVPN Connect can control this profile..
31+
- Fixed: Domain VoD Actions should not be included without `--domains` flag.
32+
- Added support for `EvaluateConnection`, `Domains`, via `--domains`. It will include an `ActionParameters` dict containing `Domains`, and if `--domain-probe-url` is set, also contains `RequiredURLStringProbe`.
33+
34+
35+
<a name="v0.5.0"></a>
36+
## [v0.5.0] - 2015-02-22
37+
38+
- New feature: Specify multiple remotes with `--remotes "host2 1194 tcp","host3 1195 udp"` flag.
39+
40+
41+
<a name="v0.4.2"></a>
42+
## [v0.4.2] - 2014-07-05
43+
44+
- Bugfix: Default catch-all rule should be 'Ignore'.
45+
46+
47+
<a name="v0.4.1"></a>
48+
## [v0.4.1] - 2014-05-07
49+
50+
- Fixed: SSIDs specified as string in config now produces correct output.
51+
52+
53+
<a name="v0.4.0"></a>
54+
## [v0.4.0] - 2014-05-07
55+
56+
- Added support for configuration persistance, via ENV or `~/.ovpnmcgen.rb.yml` or `--config` flag.
57+
- Updated VoD rules in `--[un]trusted-ssids` to also use `InterfaceTypeMatch`.
58+
59+
60+
<a name="v0.3.0"></a>
61+
## [v0.3.0] - 2014-05-04
62+
63+
- Updated documentation for `URLStringProbe` and `--url-probe`.
64+
- Added URLStringProbe support via `--url-probe` flag.
65+
66+
67+
<a name="v0.2.1"></a>
68+
## [v0.2.1] - 2014-04-19
69+
70+
- Use a portable and native uuidgen implementation.
71+
- Minor fixes for bugs caught by tests.
72+
73+
74+
<a name="v0.2.0"></a>
75+
## [v0.2.0] - 2014-04-18
76+
77+
- TLS-Auth keyfile now optional.
78+
- Added support for security-levels.
79+
- Support custom UUID values.
80+
81+
82+
<a name="v0.1.0"></a>
83+
## [v0.1.0] - 2014-03-27
84+
85+
- Added support for --ovpnconfigfile.
86+
- Improved invalid arguments error message.
87+
- Shorter switches for --[un]trusted-ssids.
88+
- Support custom --port and --proto switches.
89+
90+
91+
<a name="v0.0.2"></a>
92+
## [v0.0.2] - 2014-03-26
93+
94+
- Require at least ruby v1.9.3.
95+
96+
97+
<a name="v0.0.1"></a>
98+
## v0.0.1 - 2014-03-26
99+
100+
- Initial release
101+
102+
103+
[Unreleased]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.7.0...HEAD
104+
[v0.7.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.6.0...v0.7.0
105+
[v0.6.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.5.0...v0.6.0
106+
[v0.5.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.5.0.pre...v0.5.0
107+
[v0.5.0.pre]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.4.2...v0.5.0.pre
108+
[v0.4.2]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.4.1...v0.4.2
109+
[v0.4.1]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.4.0...v0.4.1
110+
[v0.4.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.3.0...v0.4.0
111+
[v0.3.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.2.1...v0.3.0
112+
[v0.2.1]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.2.0...v0.2.1
113+
[v0.2.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.1.0...v0.2.0
114+
[v0.1.0]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.0.2...v0.1.0
115+
[v0.0.2]: https://github.com/iphoting/ovpnmcgen.rb/compare/v0.0.1...v0.0.2

bin/ovpnmcgen.rb

+32-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
program :help_formatter, Commander::HelpFormatter::Terminal
1111
default_command :help
1212
never_trace!
13-
global_option '-c', '--config FILE', 'Specify path to config file. [Default: .ovpnmcgen.rb.yml]'
14-
13+
global_option('-c', '--config FILE', 'Specify path to config file. [Default: .ovpnmcgen.rb.yml]') do |config|
14+
$config = config
15+
end
16+
1517
command :generate do |c|
1618
c.syntax = 'ovpnmcgen.rb generate [options] <user> <device>'
1719
c.summary = 'Generates iOS Configuration Profiles (.mobileconfig)'
@@ -23,6 +25,7 @@
2325
c.example 'Using OpenSSL to convert from PKCS#12 (.p12) to Key PEM file', 'openssl pkcs12 -in path/to/john-ipad.p12 -out path/to/john-ipad-key.pem -nodes -nocerts'
2426
c.option '--cafile FILE', 'Path to OpenVPN CA file. (Required)'
2527
c.option '--tafile FILE', 'Path to TLS-Auth Key file.'
28+
c.option '--tlscryptfile FILE', 'Path to TLS-Crypt Key file.'
2629
c.option '--cert FILE', 'Path to Cert file.'
2730
c.option '--key FILE', 'Path to Private Key file.'
2831
c.option '--host HOSTNAME', 'Hostname of OpenVPN server. (Required)'
@@ -34,27 +37,38 @@
3437
c.option '--v12compat', 'Enable OpenVPN Connect 1.2.x compatibility. When Enabled, use updated `VPNSubType: net.openvpn.connect.app` (changed since OpenVPN Connect 1.2.x). [Default: Disabled]'
3538
c.option '--security-level LEVEL', 'Security level of VPN-On-Demand Behaviour: paranoid, high, medium. [Default: high]'
3639
c.option '--vpn-uuid UUID', 'Override a VPN configuration payload UUID.'
40+
c.option '--vpn-name NAME', 'Override a VPN configuration payload name displayed under Settings.app > General > VPN.'
3741
c.option '--profile-uuid UUID', 'Override a Profile UUID.'
3842
c.option '--cert-uuid UUID', 'Override a Certificate payload UUID.'
3943
c.option '-t', '--trusted-ssids SSIDS', Array, 'List of comma-separated trusted SSIDs.'
4044
c.option '-u', '--untrusted-ssids SSIDS', Array, 'List of comma-separated untrusted SSIDs.'
4145
c.option '-d', '--domains DOMAINS', Array, 'List of comma-separated domain names requiring VPN service.'
4246
c.option '--domain-probe-url PROBE', String, 'An HTTP(S) URL to probe, using a GET request. If no HTTP response code is received from the server, a VPN connection is established in response.'
47+
c.option '--trusted-ssids-probe-url PROBE', String, 'An HTTP(S) URL to probe, using a GET request. If no HTTP response code is received from the server, a VPN connection may be established in response.'
4348
c.option '--url-probe URL', 'This URL must return HTTP status 200, without redirection, before the VPN service will try establishing.'
4449
c.option '--remotes REMOTES', Array, 'List of comma-separated alternate remotes: "<host> <port> <proto>".'
50+
c.option '--idle-timer TIME', Integer, 'Disconnect from VPN when idle for a certain period of time (in seconds) which is useful for VPN-On-Demand scenarios. Requires disabling "Reconnect On Wakeup" on OpenVPN.app.'
4551
c.option '--ovpnconfigfile FILE', 'Path to OpenVPN client config file.'
4652
c.option '-o', '--output FILE', 'Output to file. [Default: stdout]'
4753
c.action do |args, options|
48-
raise ArgumentError.new "Invalid arguments. Run '#{File.basename(__FILE__)} help generate' for guidance" if args.nil? or args.length < 2
49-
5054
# Set up configuration environment.
51-
if options.config
52-
Ovpnmcgen.configure(options.config)
55+
if $config
56+
Ovpnmcgen.configure($config)
5357
else
5458
Ovpnmcgen.configure
5559
end
5660
config = Ovpnmcgen.config
5761

62+
user, device = args
63+
if args.empty? and (options.p12file or config.p12file)
64+
filename = File.basename((options.p12file or config.p12file), '.p12')
65+
user, device = filename.split('-') if filename
66+
end
67+
68+
unless user and device
69+
raise ArgumentError.new "Invalid arguments. Run '#{File.basename(__FILE__)} help generate' for guidance"
70+
end
71+
5872
raise ArgumentError.new "Host is required" unless options.host or config.host
5973
raise ArgumentError.new "cafile is required" unless options.cafile or config.cafile
6074

@@ -63,6 +77,14 @@
6377
raise ArgumentError.new "PKCS#12 or cert & key file required"
6478
end
6579

80+
if (options.trusted_ssids_probe_url or config.trusted_ssids_probe_url) and not (options.trusted_ssids or config.trusted_ssids)
81+
raise ArgumentError.new "cannot set --trusted-ssids-probe-url without --trusted-ssids"
82+
end
83+
84+
if (config.tafile or options.tafile) and (config.tlscryptfile or options.tlscryptfile)
85+
raise ArgumentError.new "tafile and tlscryptfile cannot be both set"
86+
end
87+
6688
options.default :vod => case
6789
when config.vod == true || config.no_vod == false
6890
true
@@ -75,8 +97,6 @@
7597
:port => (config.port)? config.port : 1194,
7698
:security_level => (config.security_level)? config.security_level : 'high'
7799

78-
user, device = args
79-
80100
inputs = {
81101
:user => user,
82102
:device => device,
@@ -87,22 +107,26 @@
87107
:port => options.port,
88108
:enableVOD => options.vod,
89109
:trusted_ssids => options.trusted_ssids || config.trusted_ssids,
110+
:trusted_ssids_probe_url => options.trusted_ssids_probe_url || config.trusted_ssids_probe_url,
90111
:untrusted_ssids => options.untrusted_ssids || config.untrusted_ssids,
91112
:profile_uuid => options.profile_uuid || config.profile_uuid,
92113
:vpn_uuid => options.vpn_uuid || config.vpn_uuid,
114+
:vpn_name => options.vpn_name || config.vpn_name,
93115
:cert_uuid => options.cert_uuid || config.cert_uuid,
94116
:security_level => options.security_level
95117
}
96118
inputs[:ovpnconfigfile] = options.ovpnconfigfile || config.ovpnconfigfile if options.ovpnconfigfile or config.ovpnconfigfile
97119
inputs[:p12file] = options.p12file || config.p12file if options.p12file or config.p12file
98120
inputs[:tafile] = options.tafile || config.tafile if options.tafile or config.tafile
121+
inputs[:tlscryptfile] = options.tlscryptfile || config.tlscryptfile if options.tlscryptfile or config.tlscryptfile
99122
inputs[:cert] = options.cert || config.cert if options.cert or config.cert
100123
inputs[:key] = options.key || config.key if options.key or config.key
101124
inputs[:url_probe] = options.url_probe || config.url_probe if options.url_probe or config.url_probe
102125
inputs[:remotes] = options.remotes || config.remotes if options.remotes or config.remotes
103126
inputs[:domains] = options.domains || config.domains if options.domains or config.domains
104127
inputs[:domain_probe_url] = options.domain_probe_url || config.domain_probe_url if options.domain_probe_url or config.domain_probe_url
105128
inputs[:v12compat] = options.v12compat || config.v12compat if options.v12compat or config.v12compat
129+
inputs[:idle_timer] = options.idle_timer || config.idle_timer if options.idle_timer or config.idle_timer
106130

107131
unless options.output
108132
puts Ovpnmcgen.generate(inputs)

0 commit comments

Comments
 (0)