openvpn_configurator 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/lib/openvpn_configurator/route_gatherer.rb +16 -8
- data/lib/openvpn_configurator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c073a1db1e11279b2e6680209b50073208acb115ec7b43de8a3ea1fd0c85eea0
|
4
|
+
data.tar.gz: 02d6751e13f0aea73b77ddf980a7664a0ea80077e8871a7632d50806da41aec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdc38e52cc7d0b04297972b2cd408fc0e765c778de8910f651ed17c3a1d437f9f1dabe1743b531d64ba75b5a9840837fb866a599015b2ebfb69004df9fe89536
|
7
|
+
data.tar.gz: 6781c969fe4866a5688a3dbed5af5fd306a5afb1230ffec5c96afd9cab514e134dbf05218dc1fadc3272ffefcc49604c7e538ef8bd499bfa77d7a6a8ec06dc7e
|
data/CHANGELOG.md
CHANGED
@@ -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 =
|
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
|
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 '
|
179
|
+
format '%sroute%s%s%s', prefix, directive_indent, route.extended, postfix
|
172
180
|
when NetAddr::IPv6Net
|
173
|
-
format '
|
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 <<
|
187
|
+
result << directive
|
180
188
|
end
|
181
189
|
result << ''
|
182
190
|
end
|