github-pages-health-check 1.18.1 → 1.18.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +2 -0
- data/.github/dependabot.yml +18 -13
- data/.github/workflows/pages-gem.yml +27 -0
- data/.github/workflows/push-cibuild.yml +7 -5
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/README.md +2 -1
- data/github-pages-health-check.gemspec +2 -2
- data/lib/github-pages-health-check/domain.rb +25 -8
- data/lib/github-pages-health-check/version.rb +1 -1
- data/lib/github-pages-health-check.rb +2 -1
- data/script/cibuild-docker +1 -1
- metadata +20 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e2a387d18201b5732790cea5c70f84c736eb04433cb66cf8715b7afd263bbb7
|
4
|
+
data.tar.gz: c9ccd398d02d8d6a2f4b372bf022cb75688178951cca0fc0f0616cf7078c4fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d385527764b7326b390244b38e44b2aa426748244d51e64feef83200111053efc3fe52a9cf55e0f523df27ddeaf2a24e1df15ae702a1948e2fcede15ba254d
|
7
|
+
data.tar.gz: 55bee6916048119777f9321cfe29a496317d855e6e428b185244c97b6ee1d77b23d16ca63be53e145a3467a94cf62858bace2c48ed0aade07c38d90000c1c274
|
data/.github/CODEOWNERS
ADDED
data/.github/dependabot.yml
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
version: 2
|
2
2
|
updates:
|
3
|
-
- package-ecosystem: bundler
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
time: "10:00"
|
8
|
+
timezone: Europe/Vienna
|
9
|
+
pull-request-branch-name:
|
10
|
+
separator: "-"
|
11
|
+
open-pull-requests-limit: 99
|
12
|
+
allow:
|
13
|
+
- dependency-type: direct
|
14
|
+
- dependency-type: indirect
|
15
|
+
rebase-strategy: disabled
|
16
|
+
|
17
|
+
- package-ecosystem: "github-actions"
|
18
|
+
directory: "/"
|
19
|
+
schedule:
|
20
|
+
interval: weekly
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Publish Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
release:
|
5
|
+
types: [released]
|
6
|
+
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
release:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: Checkout
|
15
|
+
uses: actions/checkout@v4
|
16
|
+
- name: Setup Ruby
|
17
|
+
uses: ruby/setup-ruby@52753b7da854d5c07df37391a986c76ab4615999 # v1.191.0
|
18
|
+
with:
|
19
|
+
ruby-version: '3.2'
|
20
|
+
- name: Build gem
|
21
|
+
run: |
|
22
|
+
gem build github-pages-health-check.gemspec
|
23
|
+
- name: Publish gem
|
24
|
+
env:
|
25
|
+
GEM_HOST_API_KEY: ${{ secrets.PAGES_GEM_PUBLISHING }}
|
26
|
+
run: |
|
27
|
+
gem push github-pages-health-check-*.gem
|
@@ -1,16 +1,18 @@
|
|
1
1
|
on: push
|
2
|
-
name:
|
2
|
+
name: "GitHub Pages Health Check Tests"
|
3
|
+
permissions:
|
4
|
+
contents: read
|
3
5
|
jobs:
|
4
6
|
build:
|
5
7
|
name: "GitHub Pages Health Check Tests"
|
6
8
|
runs-on: ubuntu-latest
|
7
9
|
strategy:
|
10
|
+
fail-fast: false
|
8
11
|
matrix:
|
9
12
|
ruby:
|
10
|
-
-
|
11
|
-
-
|
12
|
-
- 2
|
13
|
-
- 3.0
|
13
|
+
- '3.0'
|
14
|
+
- '3.1'
|
15
|
+
- '3.2'
|
14
16
|
steps:
|
15
17
|
- uses: actions/checkout@master
|
16
18
|
- name: script/cibuild-docker
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
*Checks your GitHub Pages site for common DNS configuration issues*
|
4
4
|
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://github.com/github/pages-health-check/actions/workflows/push-cibuild.yml/badge.svg)](https://github.com/github/pages-health-check/actions/workflows/push-cibuild.yml)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/github-pages-health-check.svg)](http://badge.fury.io/rb/github-pages-health-check)
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_dependency("addressable", "~> 2.3")
|
20
20
|
s.add_dependency("dnsruby", "~> 1.60")
|
21
|
-
s.add_dependency("octokit", "
|
22
|
-
s.add_dependency("public_suffix", ">= 3.0", "<
|
21
|
+
s.add_dependency("octokit", ">= 4", "< 10")
|
22
|
+
s.add_dependency("public_suffix", ">= 3.0", "< 7.0")
|
23
23
|
s.add_dependency("typhoeus", "~> 1.3")
|
24
24
|
end
|
@@ -91,7 +91,7 @@ module GitHubPages
|
|
91
91
|
host uri nameservers dns_resolves? proxied? cloudflare_ip?
|
92
92
|
fastly_ip? old_ip_address? a_record? aaaa_record? a_record_present? aaaa_record_present?
|
93
93
|
cname_record? mx_records_present? valid_domain? apex_domain?
|
94
|
-
should_be_a_record? cname_to_github_user_domain?
|
94
|
+
should_be_a_record? cname_to_github_user_domain? cname_to_domain_to_pages?
|
95
95
|
cname_to_pages_dot_github_dot_com? cname_to_fastly?
|
96
96
|
pointed_to_github_pages_ip? non_github_pages_ip_present? pages_domain?
|
97
97
|
served_by_pages? valid? reason valid_domain? https?
|
@@ -160,7 +160,7 @@ module GitHubPages
|
|
160
160
|
end
|
161
161
|
|
162
162
|
# Is this a valid domain that PublicSuffix recognizes?
|
163
|
-
# Used as an escape hatch to prevent false positives on DNS
|
163
|
+
# Used as an escape hatch to prevent false positives on DNS checks
|
164
164
|
def valid_domain?
|
165
165
|
return @valid if defined? @valid
|
166
166
|
|
@@ -170,7 +170,7 @@ module GitHubPages
|
|
170
170
|
:ignore_private => true)
|
171
171
|
end
|
172
172
|
|
173
|
-
# Is this domain an apex domain, meaning a CNAME would be
|
173
|
+
# Is this domain an apex domain, meaning a CNAME would be inappropriate
|
174
174
|
def apex_domain?
|
175
175
|
return @apex_domain if defined?(@apex_domain)
|
176
176
|
|
@@ -202,7 +202,7 @@ module GitHubPages
|
|
202
202
|
end
|
203
203
|
|
204
204
|
#
|
205
|
-
# Does the domain have
|
205
|
+
# Does the domain have associated NS records?
|
206
206
|
#
|
207
207
|
def dns_zone_ns?
|
208
208
|
return @ns_records if defined?(@ns_records)
|
@@ -243,10 +243,20 @@ module GitHubPages
|
|
243
243
|
cname? && !cname_to_pages_dot_github_dot_com? && cname.pages_domain?
|
244
244
|
end
|
245
245
|
|
246
|
+
# Check if the CNAME points to a Domain that points to pages
|
247
|
+
# e.g. CNAME -> Domain -> Pages
|
248
|
+
def cname_to_domain_to_pages?
|
249
|
+
a_record_to_pages = dns.select { |d| d.type == Dnsruby::Types::A && d.name.to_s == host }.first
|
250
|
+
|
251
|
+
return false unless a_record_to_pages && cname? && !cname_to_pages_dot_github_dot_com? && @www_cname
|
252
|
+
|
253
|
+
CURRENT_IP_ADDRESSES.include?(a_record_to_pages.address.to_s.downcase)
|
254
|
+
end
|
255
|
+
|
246
256
|
# Is the given domain a CNAME to pages.github.(io|com)
|
247
257
|
# instead of being CNAME'd to the user's subdomain?
|
248
258
|
#
|
249
|
-
# domain - the domain to check,
|
259
|
+
# domain - the domain to check, generally the target of a cname
|
250
260
|
def cname_to_pages_dot_github_dot_com?
|
251
261
|
cname? && cname.pages_dot_github_dot_com?
|
252
262
|
end
|
@@ -273,7 +283,7 @@ module GitHubPages
|
|
273
283
|
|
274
284
|
# Is this domain owned by GitHub?
|
275
285
|
def github_domain?
|
276
|
-
|
286
|
+
host.downcase.eql?("github.com") || host.downcase.end_with?(".github.com")
|
277
287
|
end
|
278
288
|
|
279
289
|
# Is the host our Fastly CNAME?
|
@@ -304,6 +314,7 @@ module GitHubPages
|
|
304
314
|
return true if cloudflare_ip?
|
305
315
|
return false if pointed_to_github_pages_ip?
|
306
316
|
return false if cname_to_github_user_domain?
|
317
|
+
return false if cname_to_domain_to_pages?
|
307
318
|
return false if cname_to_pages_dot_github_dot_com?
|
308
319
|
return false if cname_to_fastly? || fastly_ip?
|
309
320
|
|
@@ -399,9 +410,16 @@ module GitHubPages
|
|
399
410
|
cnames = dns.take_while { |answer| answer.type == Dnsruby::Types::CNAME }
|
400
411
|
return if cnames.empty?
|
401
412
|
|
413
|
+
www_cname(cnames.last)
|
402
414
|
@cname ||= Domain.new(cnames.last.cname.to_s)
|
403
415
|
end
|
404
416
|
|
417
|
+
# Check if we have a 'www.' CNAME that matches the domain
|
418
|
+
def www_cname(cname)
|
419
|
+
@www_cname ||= cname.name.to_s.start_with?("www.") &&
|
420
|
+
cname.name.to_s.end_with?(cname.domainname.to_s)
|
421
|
+
end
|
422
|
+
|
405
423
|
def mx_records_present?
|
406
424
|
return unless dns?
|
407
425
|
|
@@ -454,8 +472,7 @@ module GitHubPages
|
|
454
472
|
return false if host.include?("_")
|
455
473
|
|
456
474
|
# Must be a CNAME or point to our IPs.
|
457
|
-
|
458
|
-
return true if cname_to_github_user_domain?
|
475
|
+
return true if cname_to_github_user_domain? || cname_to_domain_to_pages?
|
459
476
|
|
460
477
|
# Check CAA records for the full domain and its parent domain.
|
461
478
|
pointed_to_github_pages_ip? && caa.lets_encrypt_allowed?
|
@@ -41,7 +41,7 @@ module GitHubPages
|
|
41
41
|
URL = "https://github.com/github/pages-health-check"
|
42
42
|
USER_AGENT = "Mozilla/5.0 (compatible; #{HUMAN_NAME}/#{VERSION}; +#{URL})"
|
43
43
|
|
44
|
-
#
|
44
|
+
# suppress warn-level feedback due to unsupported record types
|
45
45
|
def self.without_warnings(&block)
|
46
46
|
warn_level = $VERBOSE
|
47
47
|
$VERBOSE = nil
|
@@ -66,6 +66,7 @@ module GitHubPages
|
|
66
66
|
|
67
67
|
@typhoeus_options = {
|
68
68
|
:followlocation => true,
|
69
|
+
:redir_protocols => %i[http https], # don't allow non-http protocols on redirections
|
69
70
|
:timeout => TIMEOUT,
|
70
71
|
:accept_encoding => "gzip",
|
71
72
|
:method => :head,
|
data/script/cibuild-docker
CHANGED
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.18.
|
4
|
+
version: 1.18.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: octokit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4'
|
48
|
+
- - "<"
|
46
49
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
50
|
+
version: '10'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '4'
|
58
|
+
- - "<"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '10'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: public_suffix
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +67,7 @@ dependencies:
|
|
61
67
|
version: '3.0'
|
62
68
|
- - "<"
|
63
69
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
70
|
+
version: '7.0'
|
65
71
|
type: :runtime
|
66
72
|
prerelease: false
|
67
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,7 +77,7 @@ dependencies:
|
|
71
77
|
version: '3.0'
|
72
78
|
- - "<"
|
73
79
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
80
|
+
version: '7.0'
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: typhoeus
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +99,9 @@ extensions: []
|
|
93
99
|
extra_rdoc_files: []
|
94
100
|
files:
|
95
101
|
- ".dockerignore"
|
102
|
+
- ".github/CODEOWNERS"
|
96
103
|
- ".github/dependabot.yml"
|
104
|
+
- ".github/workflows/pages-gem.yml"
|
97
105
|
- ".github/workflows/push-cibuild.yml"
|
98
106
|
- ".gitignore"
|
99
107
|
- ".rspec"
|
@@ -145,7 +153,7 @@ homepage: https://github.com/github/github-pages-health-check
|
|
145
153
|
licenses:
|
146
154
|
- MIT
|
147
155
|
metadata: {}
|
148
|
-
post_install_message:
|
156
|
+
post_install_message:
|
149
157
|
rdoc_options: []
|
150
158
|
require_paths:
|
151
159
|
- lib
|
@@ -160,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
168
|
- !ruby/object:Gem::Version
|
161
169
|
version: '0'
|
162
170
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
164
|
-
signing_key:
|
171
|
+
rubygems_version: 3.4.19
|
172
|
+
signing_key:
|
165
173
|
specification_version: 4
|
166
174
|
summary: Checks your GitHub Pages site for commons DNS configuration issues
|
167
175
|
test_files: []
|