github-pages-health-check 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 679ba9ffc25dcc84048349056269a107b8b06238593b546e4bc896fa30521d1d
4
- data.tar.gz: 4ecaddefc7f3d1451fa481faae3b088799077603dc8e3d8793400d7434002a72
3
+ metadata.gz: 1dc7e8e6ff875a82f7b7a63fb1c0f36887c4fb04a227216b6bd73219a1e5433e
4
+ data.tar.gz: 638976ceb500093ad1a9b1060eeced2206d7a7e368c0160efd6a63f9259de418
5
5
  SHA512:
6
- metadata.gz: 89c5a7975632bee55c646c48093d56c319a5bf7ca9503adc2b05526691d053a5c8ac883b1608d83032193bd3da454091c4edc8f6f5401d528dfca8fc7c49b2b6
7
- data.tar.gz: 0736ad8c4d6bb5ad484d90de791a66c806a79ac9cbeeda9c3923a7e3b7a417b144de200b7952dfe81eb0d609f2676a924cb94fb19edfebdc885e9d1f6745927d
6
+ metadata.gz: 72c2a0f8c3762c6fba32e9ff160dad0539bd039afd67c5d1de37f16f8ce03c54ad396b03a5af3a76b3436c0d7898c579ec767fc10cfebf8054d90bbd2afb070f
7
+ data.tar.gz: f18feaf2e003d54fd17d30d2585cd7840a2085e9174227bda7499aa5fdf3633d11b45a69b691836465e060570125703a8875a1eec4b2f73a181078ecb1f6ee4b
@@ -33,9 +33,8 @@ module GitHubPages
33
33
  end
34
34
 
35
35
  def records
36
- unicode_host = Addressable::IDNA.to_unicode(host)
37
36
  @records ||= begin
38
- get_caa_records(host) | get_caa_records(PublicSuffix.domain(unicode_host))
37
+ get_caa_records(host) | get_caa_records(host.split(".").drop(1).join("."))
39
38
  end
40
39
  end
41
40
 
@@ -63,28 +63,27 @@ module GitHubPages
63
63
  "43.249.72.133",
64
64
  "43.249.73.133",
65
65
  "43.249.74.133",
66
- "43.249.75.133"
66
+ "43.249.75.133",
67
+
68
+ # 2018 Move to GitHub assigned IP space
69
+ "192.30.252.153",
70
+ "192.30.252.154"
67
71
  ].freeze
68
72
 
69
- NEW_PRIMARY_IPS = %w(
73
+ CURRENT_IP_ADDRESSES = %w(
70
74
  185.199.108.153
71
75
  185.199.109.153
72
76
  185.199.110.153
73
77
  185.199.111.153
74
78
  ).freeze
75
79
 
76
- CURRENT_IP_ADDRESSES = [
77
- "192.30.252.153",
78
- "192.30.252.154",
79
- *NEW_PRIMARY_IPS
80
- ].freeze
81
-
82
80
  HASH_METHODS = %i[
83
81
  host uri nameservers dns_resolves? proxied? cloudflare_ip?
84
82
  fastly_ip? old_ip_address? a_record? cname_record?
85
83
  mx_records_present? valid_domain? apex_domain? should_be_a_record?
86
84
  cname_to_github_user_domain? cname_to_pages_dot_github_dot_com?
87
- cname_to_fastly? pointed_to_github_pages_ip? pages_domain?
85
+ cname_to_fastly? pointed_to_github_pages_ip?
86
+ non_github_pages_ip_present? pages_domain?
88
87
  served_by_pages? valid? reason valid_domain? https?
89
88
  enforces_https? https_error https_eligible? caa_error
90
89
  ].freeze
@@ -179,9 +178,14 @@ module GitHubPages
179
178
  a_record? && CURRENT_IP_ADDRESSES.include?(dns.first.address.to_s)
180
179
  end
181
180
 
182
- # Is the domain's first response an A record to the new primary IPs?
183
- def pointed_to_new_primary_ips?
184
- a_record? && NEW_PRIMARY_IPS.include?(dns.first.address.to_s)
181
+ # Are any of the domain's A records pointing elsewhere?
182
+ def non_github_pages_ip_present?
183
+ return unless dns?
184
+ a_records = dns.select { |answer| answer.type == Dnsruby::Types::A }
185
+
186
+ a_records.any? { |answer| !github_pages_ip?(answer.address.to_s) }
187
+
188
+ false
185
189
  end
186
190
 
187
191
  # Is the domain's first response a CNAME to a pages domain?
@@ -363,8 +367,9 @@ module GitHubPages
363
367
 
364
368
  # Can an HTTPS certificate be issued for this domain?
365
369
  def https_eligible?
366
- (cname_to_github_user_domain? || pointed_to_new_primary_ips?) &&
367
- !aaaa_record_present? && caa.lets_encrypt_allowed?
370
+ (cname_to_github_user_domain? || pointed_to_github_pages_ip?) &&
371
+ !aaaa_record_present? && !non_github_pages_ip_present? &&
372
+ caa.lets_encrypt_allowed?
368
373
  end
369
374
 
370
375
  # Any errors querying CAA records
@@ -457,6 +462,10 @@ module GitHubPages
457
462
  def legacy_ip?(ip_addr)
458
463
  LEGACY_IP_ADDRESSES.include?(ip_addr)
459
464
  end
465
+
466
+ def github_pages_ip?(ip_addr)
467
+ CURRENT_IP_ADDRESSES.include?(ip_addr)
468
+ end
460
469
  end
461
470
  end
462
471
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitHubPages
4
4
  module HealthCheck
5
- VERSION = "1.12.0".freeze
5
+ VERSION = "1.13.0".freeze
6
6
  end
7
7
  end
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.12.0
4
+ version: 1.13.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-06-20 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.7.7
237
+ rubygems_version: 2.7.6
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: Checks your GitHub Pages site for commons DNS configuration issues