Skip to content

Add a check for AAAA records #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2018
Merged

Add a check for AAAA records #93

merged 1 commit into from
May 8, 2018

Conversation

seveas
Copy link
Member

@seveas seveas commented May 8, 2018

GitHub pages only supports ipv4 at this time. Having AAAA records for a
pages domain is wrong and will lead to certificate enrollment failures,
as Let's Encrypt would connect to the wrong host.

Copy link
Contributor

@parkr parkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ This looks excellent, thank you @seveas!

def message
<<-MSG
Your site's DNS settings are using a custom subdomain, #{domain.host},
that's set up with an AAAA record. GitHub pages currently does not support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Pages

<<-MSG
Your site's DNS settings are using a custom subdomain, #{domain.host},
that's set up with an AAAA record. GitHub pages currently does not support
ipv6 and this AAAA record will interfere with https certificate creation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPv6, and HTTPS

Not sure if we should say anything about HTTPS directly (though it applies!) because having IPv6 records could actually cause issues serving for clients that lookup IPv6 first before IPv4. So it could be a bigger issue.

expect(subject).to be_an_a_record
expect(subject).to be_a_valid_domain
expect(subject.invalid_aaaa_record?).to be_truthy
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a test to ensure it raises the correct error?

it "raises InvalidAAAARecordError" do 
  expect(-> { subject.check! }).to raise_error(Errors::InvalidAAARecordError)
end

This ensures that the checking will surface this error in the right order in the check! method.

@@ -286,6 +293,11 @@ def a_record?
dns.first.type == Dnsruby::Types::A
end

def aaaa_record?
return unless dns?
dns.index { |r| r.type == Dnsruby::Types::AAAA }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would dns.any? make better sense here? It returns a boolean value which is what I think you want here.

@parkr parkr requested a review from benbalter May 8, 2018 18:41
@seveas
Copy link
Member Author

seveas commented May 8, 2018

Thanks @parkr, I force-pushed an update that addresses your feedback (and renames aaaa_record? to aaaa_record_present? to be consistent with mx_record_present?)

GitHub pages only supports ipv4 at this time. Having AAAA records for a
pages domain is wrong and will lead to certificate enrollment failures,
as Let's Encrypt would connect to the wrong host.
@seveas
Copy link
Member Author

seveas commented May 8, 2018

Y'know what would be useful: running the tests after saving the file in your editor 🤦‍♂️

And that actually found a couple of bugs.

@parkr parkr merged commit 756e6aa into github:master May 8, 2018
@parkr
Copy link
Contributor

parkr commented May 8, 2018

Do you any further changes? If not, I'll push a 1.9.0 😄

@seveas
Copy link
Member Author

seveas commented May 8, 2018

Not sure, depends on what other issues come up while looking at support tickets.

@parkr
Copy link
Contributor

parkr commented May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants