openvpn_configurator 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5c1f39eb5fb9575fbd0cf3f65c293b2c85ba65773c840f6cf19a0c3a54c9f79
4
- data.tar.gz: 88f0572ff291a1b5ec27d8bb66654a6671b4d54b2974ffdfc9d5d8f6265bf0cf
3
+ metadata.gz: c073a1db1e11279b2e6680209b50073208acb115ec7b43de8a3ea1fd0c85eea0
4
+ data.tar.gz: 02d6751e13f0aea73b77ddf980a7664a0ea80077e8871a7632d50806da41aec6
5
5
  SHA512:
6
- metadata.gz: 14e4908a7f2b7f5d497e341fb429267cc5d33363514cf89c4ffde4411871864c37b4895006d514fb375a76f0c07352476b4d0f8284c05b92d1971c946bb72724
7
- data.tar.gz: fc5de4cd52c552cdf919f0804d832004a0ff9d291efcacc1fa3a1c497e3be92388d84d5dd33dbd2f62c98648e271b7f5f4e3656767f0f32877691f532b6bf633
6
+ metadata.gz: bdc38e52cc7d0b04297972b2cd408fc0e765c778de8910f651ed17c3a1d437f9f1dabe1743b531d64ba75b5a9840837fb866a599015b2ebfb69004df9fe89536
7
+ data.tar.gz: 6781c969fe4866a5688a3dbed5af5fd306a5afb1230ffec5c96afd9cab514e134dbf05218dc1fadc3272ffefcc49604c7e538ef8bd499bfa77d7a6a8ec06dc7e
@@ -4,10 +4,17 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.1.1] - 2020-10-12
8
+ ## Added
9
+ - Push group name onto pruned route comments.
10
+
11
+ ## Fixed
12
+ - Improperly embed comments inside "push" directives in server mode.
13
+
7
14
  ## [1.1.0] - 2020-10-12
8
15
  ### Added
9
- - Support for `--client` option
10
- - Automatic pruning of overlapping/duplicate routes
16
+ - Support for `--client` option.
17
+ - Automatic pruning of overlapping/duplicate routes.
11
18
 
12
19
  ## [1.0.0] - 2020-04-28
13
20
 
@@ -99,8 +99,8 @@ module OpenVPNConfigurator
99
99
 
100
100
  # @return [Hash<String, Array<NetAddr::IPv4Net, NetAddr::IPv6Net>]
101
101
  def reduce_routes(routes)
102
- seen_v4 = []
103
- seen_v6 = []
102
+ seen_v4 = {}
103
+ seen_v6 = {}
104
104
  reduction = false
105
105
  result = {}
106
106
  routes.each_pair do |name, entries|
@@ -115,12 +115,20 @@ module OpenVPNConfigurator
115
115
  nil
116
116
  end
117
117
  if seen
118
- covered = seen.find { |s| [1, 0].include? s.rel(entry) }
118
+ covered = nil
119
+ seen.each_pair do |seen_name, seen_entries|
120
+ found_entry = seen_entries.find { |s| [1, 0].include? s.rel(entry) }
121
+ if found_entry
122
+ covered = [seen_name, found_entry]
123
+ break
124
+ end
125
+ end
119
126
  if covered
120
127
  reduction = true
121
- result[name].push Comment.new("Route #{entry} already covered by route #{covered}")
128
+ result[name].push Comment.new("Route #{entry} already covered by route #{covered[1]} (#{covered[0]})")
122
129
  else
123
- seen.push entry
130
+ seen[name] ||= []
131
+ seen[name].push entry
124
132
  result[name].push entry
125
133
  end
126
134
  else
@@ -168,15 +176,15 @@ module OpenVPNConfigurator
168
176
  routes[source].sort_by(&:to_s).each do |route|
169
177
  directive = case route
170
178
  when NetAddr::IPv4Net
171
- format 'route%s%s', directive_indent, route.extended
179
+ format '%sroute%s%s%s', prefix, directive_indent, route.extended, postfix
172
180
  when NetAddr::IPv6Net
173
- format 'route-ipv6%s%s', directive_indent, route.to_s
181
+ format '%sroute-ipv6%s%s%s', prefix, directive_indent, route.to_s, postfix
174
182
  when Comment
175
183
  format '# %s', route.to_s
176
184
  else
177
185
  raise "Only supporting IPv4 and IPv6 networks presently, got #{route.inspect} instead"
178
186
  end
179
- result << format("%s%s%s", prefix, directive, postfix)
187
+ result << directive
180
188
  end
181
189
  result << ''
182
190
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenVPNConfigurator
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openvpn_configurator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Ten Clay