github-pages-health-check 1.8.1 → 1.9.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 491f20abd7228f543a6f4682b74918a9f32265ca0f0f015d41ae40e5163462e6
|
4
|
+
data.tar.gz: 1dcb08e4d692030537e2d1334c09edbcac2e4179fb7ad05fe23cb412c6401270
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18bb1e7f1c7ece16a011ddd55c4f4238ab600be77013705857306cbbfd6d74e120b72f62ea853647c1b7d0a8affcc0dda222c7a22008645f4f66abe755c64634
|
7
|
+
data.tar.gz: b099817a6ebd5298f81a993f5c5c2b767bd291122f0262f81002bdb4a1fa315864f838698b9e192719f46fbbd4b7b0ceba59e92a3ad8fe10f94a3edf97aa5873
|
data/.rubocop.yml
CHANGED
@@ -128,16 +128,17 @@ Metrics/ClassLength:
|
|
128
128
|
- lib/github-pages-health-check/domain.rb
|
129
129
|
|
130
130
|
Metrics/CyclomaticComplexity:
|
131
|
-
Max:
|
131
|
+
Max: 9
|
132
132
|
Exclude:
|
133
133
|
- lib/github-pages-health-check/printer.rb
|
134
134
|
|
135
135
|
Metrics/PerceivedComplexity:
|
136
|
-
Max:
|
136
|
+
Max: 9
|
137
137
|
Exclude:
|
138
138
|
- lib/github-pages-health-check/printer.rb
|
139
139
|
|
140
140
|
Metrics/AbcSize:
|
141
|
+
Max: 17
|
141
142
|
Exclude:
|
142
143
|
- lib/github-pages-health-check/printer.rb
|
143
144
|
|
@@ -105,6 +105,7 @@ module GitHubPages
|
|
105
105
|
return true if proxied?
|
106
106
|
raise Errors::InvalidARecordError, :domain => self if invalid_a_record?
|
107
107
|
raise Errors::InvalidCNAMEError, :domain => self if invalid_cname?
|
108
|
+
raise Errors::InvalidAAAARecordError, :domain => self if invalid_aaaa_record?
|
108
109
|
raise Errors::NotServedByPagesError, :domain => self unless served_by_pages?
|
109
110
|
true
|
110
111
|
end
|
@@ -114,6 +115,12 @@ module GitHubPages
|
|
114
115
|
@deprecated_ip = (valid_domain? && a_record? && old_ip_address?)
|
115
116
|
end
|
116
117
|
|
118
|
+
def invalid_aaaa_record?
|
119
|
+
return @invalid_aaaa_record if defined? @invalid_aaaa_record
|
120
|
+
@invalid_aaaa_record = (valid_domain? && should_be_a_record? &&
|
121
|
+
aaaa_record_present?)
|
122
|
+
end
|
123
|
+
|
117
124
|
def invalid_a_record?
|
118
125
|
return @invalid_a_record if defined? @invalid_a_record
|
119
126
|
@invalid_a_record = (valid_domain? && a_record? && !should_be_a_record?)
|
@@ -241,6 +248,7 @@ module GitHubPages
|
|
241
248
|
|
242
249
|
REQUESTED_RECORD_TYPES = [
|
243
250
|
Dnsruby::Types::A,
|
251
|
+
Dnsruby::Types::AAAA,
|
244
252
|
Dnsruby::Types::CNAME,
|
245
253
|
Dnsruby::Types::MX
|
246
254
|
].freeze
|
@@ -286,6 +294,11 @@ module GitHubPages
|
|
286
294
|
dns.first.type == Dnsruby::Types::A
|
287
295
|
end
|
288
296
|
|
297
|
+
def aaaa_record_present?
|
298
|
+
return unless dns?
|
299
|
+
dns.any? { |answer| answer.type == Dnsruby::Types::AAAA }
|
300
|
+
end
|
301
|
+
|
289
302
|
# Is this domain's first response a CNAME record?
|
290
303
|
def cname_record?
|
291
304
|
return unless dns?
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GitHubPages
|
4
|
+
module HealthCheck
|
5
|
+
module Errors
|
6
|
+
class InvalidAAAARecordError < GitHubPages::HealthCheck::Error
|
7
|
+
DOCUMENTATION_PATH = "/articles/setting-up-a-custom-domain-with-github-pages/".freeze
|
8
|
+
|
9
|
+
def message
|
10
|
+
<<-MSG
|
11
|
+
Your site's DNS settings are using a custom subdomain, #{domain.host},
|
12
|
+
that's set up with an AAAA record. GitHub Pages currently does not support
|
13
|
+
IPv6.
|
14
|
+
MSG
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -27,7 +27,6 @@ module GitHubPages
|
|
27
27
|
@domain = domain
|
28
28
|
end
|
29
29
|
|
30
|
-
# rubocop:disable Metrics/AbcSize
|
31
30
|
def query(type)
|
32
31
|
if PREFERS_AUTHORITATIVE_ANSWER.include?(type)
|
33
32
|
answer = authoritative_resolver.query(domain, type).answer
|
@@ -38,7 +37,6 @@ module GitHubPages
|
|
38
37
|
rescue Dnsruby::ResolvTimeout, Dnsruby::ResolvError
|
39
38
|
self.class.default_resolver.query(domain, type).answer
|
40
39
|
end
|
41
|
-
# rubocop:enable Metrics/AbcSize
|
42
40
|
|
43
41
|
private
|
44
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-pages-health-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/github-pages-health-check/errors/build_error.rb
|
193
193
|
- lib/github-pages-health-check/errors/deprecated_ip_error.rb
|
194
194
|
- lib/github-pages-health-check/errors/invalid_a_record_error.rb
|
195
|
+
- lib/github-pages-health-check/errors/invalid_aaaa_record_error.rb
|
195
196
|
- lib/github-pages-health-check/errors/invalid_cname_error.rb
|
196
197
|
- lib/github-pages-health-check/errors/invalid_dns_error.rb
|
197
198
|
- lib/github-pages-health-check/errors/invalid_domain_error.rb
|