docheck 1.1.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.rdoc +38 -15
- data/data/rdap_dns.json +5354 -0
- data/exe/docheck +6 -0
- data/lib/docheck/application.rb +22 -63
- data/lib/docheck/bootstrap.rb +44 -0
- data/lib/docheck/checker.rb +53 -0
- data/lib/docheck/cli.rb +70 -0
- data/lib/docheck/errors.rb +12 -0
- data/lib/docheck/http_client.rb +77 -0
- data/lib/docheck/name.rb +20 -0
- data/lib/docheck/result.rb +23 -0
- data/lib/docheck/version.rb +3 -1
- data/lib/docheck.rb +17 -5
- metadata +25 -50
- data/.gitignore +0 -5
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -39
- data/Rakefile +0 -2
- data/bin/docheck +0 -3
- data/docheck.gemspec +0 -29
- data/lib/docheck/command.rb +0 -31
- data/test/docheck_test.rb +0 -66
- data/test/helper.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c34fd2f75f10db6e9de801f8054aedc6b548fa38088b241c20ba7c500cbc99b9
|
|
4
|
+
data.tar.gz: c385a234aa9d58ea84ec21cfd5bbda42be9adc7c464ba81719e7654479531b4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50861c23841c8595b5294611d5fbba7dd400297c09fa533b96102c0c4b32ed2fb1ec3b7a52e96049e32048092c9e2c1751538f443d914987ac11008d5db54de7
|
|
7
|
+
data.tar.gz: d91bd42c3182dd4cc35d743f3e448be4fc0d7d83eeee24422589a98564df83ba09e3360edd55514cc4604e3b9d62c107bad4ce056f7abbd1cc100d4809d05ad2
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0 - Unreleased
|
|
4
|
+
|
|
5
|
+
### Breaking changes
|
|
6
|
+
|
|
7
|
+
- Require Ruby 3.2 or later. Tested on Ruby 3.2 to 4.0.
|
|
8
|
+
- Look up domains with RDAP instead of WHOIS. The `whois` dependency is gone.
|
|
9
|
+
- Drop `edu`, `gov`, `int`, and `mil` from the default TLDs. Only institutions can register them.
|
|
10
|
+
- Raise `Docheck::InvalidNameError` for a name that is not a single DNS label.
|
|
11
|
+
- The `docheck` command prints errors to stderr and exits with status 64 on a usage error. It also lists domains whose lookup failed or whose TLD has no RDAP server.
|
|
12
|
+
- `Docheck::Application#print` no longer prints the "Docheck Result" header.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `Docheck.check` and `Docheck::Checker`, which return `Docheck::Result` objects with a status of `:available`, `:registered`, `:unknown`, or `:unsupported`.
|
|
17
|
+
- Parallel lookups with an overall deadline.
|
|
18
|
+
- `rake rdap:update` to refresh the bundled IANA RDAP bootstrap file.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Calling `Docheck::Application#fetch` twice no longer duplicates results.
|
|
23
|
+
- A failed lookup no longer uses up the retry budget of the TLDs after it.
|
data/README.rdoc
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
= Docheck
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Domain name availability checker. Docheck checks a name against generic TLDs
|
|
4
|
+
and reports which domains are available and which are registered.
|
|
5
|
+
|
|
6
|
+
Docheck uses RDAP (RFC 9082/9083), the protocol that replaced WHOIS for gTLDs.
|
|
7
|
+
It sends one HTTPS request per TLD to the registry's RDAP server, all in
|
|
8
|
+
parallel. It has no runtime dependencies.
|
|
3
9
|
|
|
4
10
|
== Requirements
|
|
5
|
-
Ruby >=
|
|
11
|
+
Ruby >= 3.2
|
|
6
12
|
|
|
7
13
|
== Installation
|
|
8
14
|
|
|
@@ -11,25 +17,42 @@ Ruby >= 1.9.2
|
|
|
11
17
|
== Usage
|
|
12
18
|
From the command line:
|
|
13
19
|
|
|
14
|
-
docheck -n google
|
|
20
|
+
$ docheck -n google
|
|
21
|
+
|
|
22
|
+
The command exits with status 0 on success and 64 on a usage error or an
|
|
23
|
+
invalid name.
|
|
24
|
+
|
|
25
|
+
From Ruby:
|
|
26
|
+
|
|
27
|
+
require "docheck"
|
|
28
|
+
|
|
29
|
+
results = Docheck.check("github")
|
|
30
|
+
results.first # => #<data Docheck::Result domain="github.com", status=:registered>
|
|
31
|
+
results.select(&:available?).map(&:domain)
|
|
15
32
|
|
|
16
|
-
|
|
33
|
+
# Custom TLDs and deadline (seconds for the whole check)
|
|
34
|
+
checker = Docheck::Checker.new(tlds: %w[com net io], deadline: 5)
|
|
35
|
+
checker.check("github")
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
Each Docheck::Result has a +status+:
|
|
19
38
|
|
|
20
|
-
|
|
39
|
+
* +:available+ - the registry has no record of the domain
|
|
40
|
+
* +:registered+ - the registry has a record of the domain
|
|
41
|
+
* +:unknown+ - the lookup failed (timeout, rate limit, or server error)
|
|
42
|
+
* +:unsupported+ - the TLD has no RDAP server in the IANA bootstrap data
|
|
21
43
|
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
Docheck::Checker#check raises Docheck::InvalidNameError when the name is not a
|
|
45
|
+
single DNS label (1-63 letters, digits, or hyphens). Pass IDNs in punycode
|
|
46
|
+
(+xn--...+).
|
|
24
47
|
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
The 1.x API (Docheck::Application with +fetch+, +available_domains+,
|
|
49
|
+
+registered_domains+, and +print+) still works.
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
docheck.registered_domains
|
|
51
|
+
== Development
|
|
30
52
|
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
$ bundle install
|
|
54
|
+
$ bundle exec rake # tests and RuboCop
|
|
55
|
+
$ bundle exec rake rdap:update # refresh data/rdap_dns.json from IANA
|
|
33
56
|
|
|
34
57
|
== License
|
|
35
|
-
Copyright (c) 2010 -
|
|
58
|
+
Copyright (c) 2010 - 2026 Kunto Aji Kristianto, Docheck is released under the MIT license.
|