dns-zonefile 1.1.9 → 1.1.10
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 +4 -4
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/ci.yml +31 -0
- data/README.md +21 -17
- data/lib/dns/zonefile/version.rb +1 -1
- data/lib/dns/zonefile.treetop +47 -13
- metadata +8 -8
- data/.travis.yml +0 -10
- data/circle.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e88aecfb00a572044b1e71d5c3bfc9f4fd4fa88d1ee7a2ae85d2127230d483d8
|
4
|
+
data.tar.gz: f121b1c044894597fd2c3b9d1e12892efa444179834ec307001060bf650bd302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 871370b42902039616ed6a2fd7d6fc3556f99abe54cb53fa17b3989ac47735c8e4be82a41ff9b2ba551da4352886607d686137018859a87be575407d4ebd1386
|
7
|
+
data.tar.gz: 8933e2220b5aa111d6b54e3870c1cbb67c02b213e78faaa328d05339aa367be3837c84e7054c70b7bd08f44c3b0b21a3efeb30edd22afda56968add0697cdb94
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types:
|
6
|
+
- opened
|
7
|
+
- reopened
|
8
|
+
- synchronize
|
9
|
+
- ready_for_review
|
10
|
+
push:
|
11
|
+
branches: [ main ]
|
12
|
+
|
13
|
+
concurrency:
|
14
|
+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
15
|
+
cancel-in-progress: true
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
test:
|
19
|
+
strategy:
|
20
|
+
fail-fast: false
|
21
|
+
matrix:
|
22
|
+
os: [ubuntu-20.04, ubuntu-latest]
|
23
|
+
ruby: ['2.7', '3.0', '3.1', head, jruby, truffleruby]
|
24
|
+
runs-on: ${{ matrix.os }}
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v3
|
27
|
+
- uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
31
|
+
- run: bundle exec rake
|
data/README.md
CHANGED
@@ -24,28 +24,32 @@ Okay, you're ready to move onto the examples now.
|
|
24
24
|
Using raw data from the parser. Note that "@" isn't translated in this mode.
|
25
25
|
Nor are inherited TTLs interpreted.
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
```ruby
|
28
|
+
zonefile = "/path/to/file.zone"
|
29
|
+
zone_string = File.read(zonefile)
|
30
|
+
zone = DNS::Zonefile.parse(zone_string)
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
puts zone.soa.origin.to_s
|
33
|
+
puts zone.soa.ns.to_s
|
34
|
+
puts zone.rr[0].to_s
|
35
|
+
```
|
34
36
|
|
35
37
|
Using more structure data. @, TTLs, and empty hostname inheritance are all
|
36
38
|
handled in this mode.
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
```ruby
|
41
|
+
zonefile = "/path/to/file.zone"
|
42
|
+
zone_string = File.read(zonefile)
|
43
|
+
zone = DNS::Zonefile.load(zone_string)
|
44
|
+
# or, if no $origin is in the zone file
|
45
|
+
zone = DNS::Zonefile.load(zone_string, 'example.com.')
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
puts zone.soa.origin
|
48
|
+
puts zone.soa.nameserver
|
49
|
+
puts zone.records[1]
|
50
|
+
# get all MX records
|
51
|
+
puts zone.records_of(DNS::Zonefile::MX)
|
52
|
+
```
|
49
53
|
|
50
54
|
Open the examples in the `./examples` directory to see more examples.
|
51
55
|
|
@@ -65,4 +69,4 @@ Craig R Webster <http://barkingiguana.com/>
|
|
65
69
|
|
66
70
|
See the TODO. Read CONTRIBUTING.md for more details on how to contribute to this project.
|
67
71
|
|
68
|
-
[](http://travis-ci.org/craigw/dns-zonefile)
|
data/lib/dns/zonefile/version.rb
CHANGED
data/lib/dns/zonefile.treetop
CHANGED
@@ -43,7 +43,10 @@ grammar Zonefile
|
|
43
43
|
end
|
44
44
|
|
45
45
|
rule soa
|
46
|
-
|
46
|
+
(
|
47
|
+
origin space ttl klass "SOA" space ns space rp space "("? multiline_comment* space_or_break* serial multiline_comment* space_or_break refresh multiline_comment* space_or_break reretry multiline_comment* space_or_break expiry multiline_comment* space_or_break nxttl multiline_comment* space_or_break* ")"? /
|
48
|
+
origin space klass ttl "SOA" space ns space rp space "("? multiline_comment* space_or_break* serial multiline_comment* space_or_break refresh multiline_comment* space_or_break reretry multiline_comment* space_or_break expiry multiline_comment* space_or_break nxttl multiline_comment* space_or_break* ")"?
|
49
|
+
) {
|
47
50
|
def to_s
|
48
51
|
"#{origin} #{ttl} #{klass} SOA #{ns} #{rp} (#{serial} #{refresh} #{reretry} #{expiry} #{nxttl})"
|
49
52
|
end
|
@@ -89,7 +92,10 @@ grammar Zonefile
|
|
89
92
|
end
|
90
93
|
|
91
94
|
rule a_record
|
92
|
-
|
95
|
+
(
|
96
|
+
host space ms_age ttl klass "A" space ip_address /
|
97
|
+
host space ms_age klass ttl "A" space ip_address
|
98
|
+
) {
|
93
99
|
def to_s
|
94
100
|
"#{host} #{ms_age} #{ttl} #{klass} A #{ip_address}"
|
95
101
|
end
|
@@ -109,7 +115,10 @@ grammar Zonefile
|
|
109
115
|
end
|
110
116
|
|
111
117
|
rule aaaa_record
|
112
|
-
|
118
|
+
(
|
119
|
+
host space ms_age ttl klass "AAAA" space ip_address:ip6_address /
|
120
|
+
host space ms_age klass ttl "AAAA" space ip_address:ip6_address
|
121
|
+
) {
|
113
122
|
def to_s
|
114
123
|
"#{host} #{ttl} #{klass} AAAA #{ip_address}"
|
115
124
|
end
|
@@ -130,7 +139,8 @@ grammar Zonefile
|
|
130
139
|
|
131
140
|
rule caa_record
|
132
141
|
(
|
133
|
-
host space ms_age ttl klass "CAA" space flags:integer space tag:unquoted_string space value:caa_value
|
142
|
+
host space ms_age ttl klass "CAA" space flags:integer space tag:unquoted_string space value:caa_value /
|
143
|
+
host space ms_age klass ttl "CAA" space flags:integer space tag:unquoted_string space value:caa_value
|
134
144
|
) {
|
135
145
|
def to_s
|
136
146
|
"#{host} #{ttl} #{klass} CAA #{flags} #{tag} #{value}"
|
@@ -168,7 +178,10 @@ grammar Zonefile
|
|
168
178
|
end
|
169
179
|
|
170
180
|
rule mx_record
|
171
|
-
|
181
|
+
(
|
182
|
+
host space ttl klass "MX" space priority:integer space exchanger:host /
|
183
|
+
host space klass ttl "MX" space priority:integer space exchanger:host
|
184
|
+
) {
|
172
185
|
def to_s
|
173
186
|
"#{host} #{ttl} #{klass} MX #{priority} #{exchanger}"
|
174
187
|
end
|
@@ -180,7 +193,10 @@ grammar Zonefile
|
|
180
193
|
end
|
181
194
|
|
182
195
|
rule naptr_record
|
183
|
-
|
196
|
+
(
|
197
|
+
host space ms_age ttl klass "NAPTR" space data /
|
198
|
+
host space ms_age klass ttl "NAPTR" space data
|
199
|
+
) {
|
184
200
|
def to_s
|
185
201
|
"#{host} #{ttl} #{klass} NAPTR #{data}"
|
186
202
|
end
|
@@ -192,7 +208,10 @@ grammar Zonefile
|
|
192
208
|
end
|
193
209
|
|
194
210
|
rule ns_record
|
195
|
-
|
211
|
+
(
|
212
|
+
host space ms_age ttl klass "NS" space nameserver:host /
|
213
|
+
host space ms_age klass ttl "NS" space nameserver:host
|
214
|
+
) {
|
196
215
|
def to_s
|
197
216
|
"#{host} #{ttl} #{klass} NS #{nameserver}"
|
198
217
|
end
|
@@ -204,7 +223,10 @@ grammar Zonefile
|
|
204
223
|
end
|
205
224
|
|
206
225
|
rule ptr_record
|
207
|
-
|
226
|
+
(
|
227
|
+
host space ms_age ttl klass "PTR" space target:host /
|
228
|
+
host space ms_age klass ttl "PTR" space target:host
|
229
|
+
) {
|
208
230
|
def to_s
|
209
231
|
"#{host} #{ttl} #{klass} PTR #{target}"
|
210
232
|
end
|
@@ -216,7 +238,10 @@ grammar Zonefile
|
|
216
238
|
end
|
217
239
|
|
218
240
|
rule soa_record
|
219
|
-
|
241
|
+
(
|
242
|
+
origin space ms_age ttl klass "SOA" space ns space rp space data /
|
243
|
+
origin space ms_age klass ttl "SOA" space ns space rp space data
|
244
|
+
) {
|
220
245
|
def to_s
|
221
246
|
"#{origin} #{ttl} #{klass} SOA #{ns} #{rp} (#{space})"
|
222
247
|
end
|
@@ -245,7 +270,10 @@ grammar Zonefile
|
|
245
270
|
end
|
246
271
|
|
247
272
|
rule spf_record
|
248
|
-
|
273
|
+
(
|
274
|
+
host space ms_age ttl klass "SPF" space data:txt_data /
|
275
|
+
host space ms_age klass ttl "SPF" space data:txt_data
|
276
|
+
) {
|
249
277
|
def to_s
|
250
278
|
"#{host} #{ttl} #{klass} SPF #{data}"
|
251
279
|
end
|
@@ -257,7 +285,10 @@ grammar Zonefile
|
|
257
285
|
end
|
258
286
|
|
259
287
|
rule sshfp_record
|
260
|
-
|
288
|
+
(
|
289
|
+
host space ms_age ttl klass "SSHFP" space alg:integer space fptype:integer space fp:fingerprint /
|
290
|
+
host space ms_age klass ttl "SSHFP" space alg:integer space fptype:integer space fp:fingerprint
|
291
|
+
) {
|
261
292
|
def to_s
|
262
293
|
"#{host} #{ttl} #{klass} SSHFP #{alg} #{fptype} #{fp}"
|
263
294
|
end
|
@@ -269,7 +300,10 @@ grammar Zonefile
|
|
269
300
|
end
|
270
301
|
|
271
302
|
rule txt_record
|
272
|
-
|
303
|
+
(
|
304
|
+
host space ms_age ttl klass "TXT" space data:ms_txt_data /
|
305
|
+
host space ms_age klass ttl "TXT" space data:ms_txt_data
|
306
|
+
) {
|
273
307
|
def to_s
|
274
308
|
"#{host} #{ttl} #{klass} TXT #{data}"
|
275
309
|
end
|
@@ -527,7 +561,7 @@ grammar Zonefile
|
|
527
561
|
end
|
528
562
|
|
529
563
|
rule unquoted_string
|
530
|
-
[a-zA-Z0-9=_]+ {
|
564
|
+
'[a-zA-Z0-9=_\.\-\@\:]+'r {
|
531
565
|
def to_s
|
532
566
|
text_value
|
533
567
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-zonefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
8
8
|
- Anthony Eden
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: treetop
|
@@ -96,9 +96,10 @@ executables: []
|
|
96
96
|
extensions: []
|
97
97
|
extra_rdoc_files: []
|
98
98
|
files:
|
99
|
+
- ".github/dependabot.yml"
|
100
|
+
- ".github/workflows/ci.yml"
|
99
101
|
- ".gitignore"
|
100
102
|
- ".rspec"
|
101
|
-
- ".travis.yml"
|
102
103
|
- CONTRIBUTING.md
|
103
104
|
- Dockerfile
|
104
105
|
- Gemfile
|
@@ -108,7 +109,6 @@ files:
|
|
108
109
|
- TODO
|
109
110
|
- bin/console
|
110
111
|
- bin/setup
|
111
|
-
- circle.yml
|
112
112
|
- dns-zonefile.gemspec
|
113
113
|
- doc/example.com.zone
|
114
114
|
- doc/example2.com.zone
|
@@ -126,7 +126,7 @@ homepage: https://github.com/craigw/dns-zonefile
|
|
126
126
|
licenses: []
|
127
127
|
metadata:
|
128
128
|
allowed_push_host: https://rubygems.org
|
129
|
-
post_install_message:
|
129
|
+
post_install_message:
|
130
130
|
rdoc_options: []
|
131
131
|
require_paths:
|
132
132
|
- lib
|
@@ -141,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
145
|
-
signing_key:
|
144
|
+
rubygems_version: 3.3.7
|
145
|
+
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)
|
148
148
|
test_files: []
|
data/.travis.yml
DELETED