Skip to content

Support checking whether a domain points at a GitHub Pages IP address #14

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 7 commits into from
Apr 15, 2015

Conversation

jdennes
Copy link
Member

@jdennes jdennes commented Apr 14, 2015

Adds the ability to check whether or not a domain is pointed at a GitHub Pages IP address.

› script/console
+ bundle exec pry -r ./lib/github-pages-health-check
[1] pry(main)> check = GitHubPages::HealthCheck.new("getbootstrap.com")
=> #<GitHubPages::HealthCheck @domain="getbootstrap.com" valid?=true>
[2] pry(main)> check.pointed_to_github_pages_ip?
=> true
[3] pry(main)> check = GitHubPages::HealthCheck.new("example.com")
=> #<GitHubPages::HealthCheck @domain="example.com" valid?=false>
[4] pry(main)> check.pointed_to_github_pages_ip?
=> false

Based on:

› dig getbootstrap.com
;getbootstrap.com.      IN  A
getbootstrap.com.   60  IN  A   192.30.252.153

› dig example.com
;example.com.           IN  A
example.com.        60  IN  A   93.184.216.34

Would be grateful for any feedback/suggestions.

/cc @benbalter @spraints @tekkub

@benbalter
Copy link
Contributor

👍. I could have sworn we exposed pages IPs through the meta API, but I guess not.

@tekkub
Copy link

tekkub commented Apr 15, 2015

@benbalter nope, but I don't think we want to rely on that here anyway. If we change IPs around again in the future, we'll need to be able to tell people when they have their DNS set for the old IPs (this is why LEGACY_IP_ADDRESSES exists and is hard-coded). I think it makes sense to hard-code the current IPs in as well, if we make a change in the future it will be a very deliberate action. It's not something I think we'd be doing frequently anyway.

@spraints
Copy link
Member

👍

jdennes added a commit that referenced this pull request Apr 15, 2015
Support checking whether a domain points at a GitHub Pages IP address
@jdennes jdennes merged commit bdf472c into master Apr 15, 2015
@jdennes jdennes deleted the jdennes-add-check-pages-ip branch April 15, 2015 12:59
@jdennes
Copy link
Member Author

jdennes commented Apr 15, 2015

@benbalter Would you like to cut a new release?

@jdennes
Copy link
Member Author

jdennes commented Apr 15, 2015

Would you like to cut a new release?

Actually, we should wait for #15.

@spraints
Copy link
Member

Would you like to cut a new release?

Actually, we should wait for #15.

#15 is merged, so I think we're ready for a new release?

@benbalter
Copy link
Contributor

@tekkub makes total sense. Thanks for walking through it with me.

Cutting a new release now.

@benbalter
Copy link
Contributor

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.

4 participants