github-pages-health-check 1.18.2 → 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/workflows/pages-gem.yml +27 -0
- data/.github/workflows/push-cibuild.yml +2 -2
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/github-pages-health-check.gemspec +2 -2
- data/lib/github-pages-health-check/domain.rb +21 -4
- data/lib/github-pages-health-check/version.rb +1 -1
- data/lib/github-pages-health-check.rb +1 -0
- data/script/cibuild-docker +1 -1
- metadata +12 -10
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
@@ -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,5 +1,7 @@
|
|
1
1
|
on: push
|
2
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"
|
@@ -8,8 +10,6 @@ jobs:
|
|
8
10
|
fail-fast: false
|
9
11
|
matrix:
|
10
12
|
ruby:
|
11
|
-
- '2.6'
|
12
|
-
- '2.7'
|
13
13
|
- '3.0'
|
14
14
|
- '3.1'
|
15
15
|
- '3.2'
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2
|
1
|
+
3.2
|
data/Gemfile
CHANGED
@@ -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", ">= 4", "<
|
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?
|
@@ -243,6 +243,16 @@ 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
|
#
|
@@ -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?
|
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
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '4'
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
50
|
+
version: '10'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '4'
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '10'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: public_suffix
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '3.0'
|
68
68
|
- - "<"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
70
|
+
version: '7.0'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: '3.0'
|
78
78
|
- - "<"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '7.0'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: typhoeus
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,9 @@ extensions: []
|
|
99
99
|
extra_rdoc_files: []
|
100
100
|
files:
|
101
101
|
- ".dockerignore"
|
102
|
+
- ".github/CODEOWNERS"
|
102
103
|
- ".github/dependabot.yml"
|
104
|
+
- ".github/workflows/pages-gem.yml"
|
103
105
|
- ".github/workflows/push-cibuild.yml"
|
104
106
|
- ".gitignore"
|
105
107
|
- ".rspec"
|
@@ -151,7 +153,7 @@ homepage: https://github.com/github/github-pages-health-check
|
|
151
153
|
licenses:
|
152
154
|
- MIT
|
153
155
|
metadata: {}
|
154
|
-
post_install_message:
|
156
|
+
post_install_message:
|
155
157
|
rdoc_options: []
|
156
158
|
require_paths:
|
157
159
|
- lib
|
@@ -166,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
168
|
- !ruby/object:Gem::Version
|
167
169
|
version: '0'
|
168
170
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
170
|
-
signing_key:
|
171
|
+
rubygems_version: 3.4.19
|
172
|
+
signing_key:
|
171
173
|
specification_version: 4
|
172
174
|
summary: Checks your GitHub Pages site for commons DNS configuration issues
|
173
175
|
test_files: []
|