firespring_dev_commands 2.2.7 → 2.2.8.pre.alpha.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5dee68fee762c895021357261186dbf043c9719c2304c3d79893d943f83b10b
|
4
|
+
data.tar.gz: 9df30efd116a01d8688d1cfa5f61a12c3a8b871d797bd028da51f38c05c6e044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8140c7df5ccc1b41e74959476d71708687175c5797dcfe4117934e7dbcce55edbaa98c957685209309c5c2582a1a858fe1b0d90e6898d08287b680b12c46b706
|
7
|
+
data.tar.gz: 3003314d63a53c06e6509c45b9e35eb2135a5b7b8a7ea8bc14039c86b062cb9f31a8ee27f22db216c5a117a6c2a39046a381695e821d469bd7b2d9a4090407fc
|
@@ -67,18 +67,56 @@ module Dev
|
|
67
67
|
[response.hosted_zone, response.delegation_set]
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
70
|
+
def json_details
|
71
|
+
zone_count = 0
|
71
72
|
zones do |zone|
|
72
|
-
puts
|
73
73
|
zone_details, delegation_set = details(zone.id)
|
74
74
|
dns_resource = Dev::Dns::Resource.new(zone_details.name)
|
75
|
+
zone_count += 1
|
76
|
+
apex_record = dns_resource.recursive_a_lookup
|
77
|
+
nameserver_names = dns_resource.recursive_nameserver_lookup
|
78
|
+
nameserver_ips = nameserver_names.sort.map { |it| dns_resource.recursive_a_lookup(it) }
|
79
|
+
# Check if the site is dead, no a record or any AWS ips in the lists.
|
80
|
+
# if apex_record.empty? && (!zone_details.name.chomp('.').include? 'firespring') && (!nameserver_ips.join(', ').include? '205.251')
|
81
|
+
if !dns_resource.recursive_a_lookup.empty? && (dns_resource.recursive_nameserver_lookup.include? 'ns1.firespring.com')
|
82
|
+
out_data = {
|
83
|
+
'count' => zone_count,
|
84
|
+
'dns_name' => zone_details.name.chomp('.'),
|
85
|
+
'hosted_zone_id' => zone_details.id,
|
86
|
+
'delegation_set_id' => delegation_set.id,
|
87
|
+
# 'registrar_servers' => dns_resource.registrar_lookup.join(','), # This function is fickle, add with care.
|
88
|
+
'reported_nameservers' => nameserver_names.sort.join(', '),
|
89
|
+
'reported_ns_ips' => nameserver_ips.join(', '),
|
90
|
+
'a_record_ip' => apex_record.sort.join(', ')
|
91
|
+
}
|
92
|
+
# Display contents
|
93
|
+
puts JSON.pretty_generate(out_data)
|
94
|
+
end
|
95
|
+
rescue ::Aws::Route53::Errors::Throttling
|
96
|
+
sleep(1)
|
97
|
+
retry
|
98
|
+
end
|
99
|
+
puts
|
100
|
+
end
|
75
101
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
102
|
+
def command_line_details
|
103
|
+
zone_count = 0
|
104
|
+
zones do |zone|
|
105
|
+
zone_details, delegation_set = details(zone.id)
|
106
|
+
dns_resource = Dev::Dns::Resource.new(zone_details.name)
|
107
|
+
zone_count += 1
|
108
|
+
if !dns_resource.recursive_a_lookup.empty? && (dns_resource.recursive_nameserver_lookup.include? 'ns1.firespring.com')
|
109
|
+
puts
|
110
|
+
puts "#{zone_count} - #{zone_details.name.chomp('.')} (#{zone_details.id}):"
|
111
|
+
puts format(' %-50s %s', 'Delegation Set:', delegation_set.id)
|
112
|
+
puts format(' %-50s %s', 'Delegation Defined Nameservers:', delegation_set.name_servers.sort.join(', '))
|
113
|
+
puts format(' %-50s %s', 'WHOIS Reported server:', dns_resource.registrar_lookup.join(','))
|
114
|
+
puts format(' %-50s %s', 'DNS Reported Nameservers:', dns_resource.recursive_nameserver_lookup.sort.join(', '))
|
115
|
+
puts format(' %-50s %s', 'DNS Reported Nameserver IPs:', dns_resource.recursive_nameserver_lookup.sort.map do |it|
|
116
|
+
dns_resource.recursive_a_lookup(it)
|
117
|
+
end.join(', '))
|
118
|
+
puts format(' %-50s %s', 'Domain Apex IP Resolution:', dns_resource.recursive_a_lookup.sort.join(', '))
|
119
|
+
end
|
82
120
|
rescue ::Aws::Route53::Errors::Throttling
|
83
121
|
sleep(1)
|
84
122
|
retry
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'whois'
|
2
|
+
|
1
3
|
module Dev
|
2
4
|
class Dns
|
3
5
|
class Resource
|
@@ -22,6 +24,14 @@ module Dev
|
|
22
24
|
value.match?(Resolv::IPv6::Regex)
|
23
25
|
end
|
24
26
|
|
27
|
+
# Determines the registrar(s) of the given name. Not perfect and can be rate limited.
|
28
|
+
def registrar_lookup(name = domain)
|
29
|
+
Whois.whois(name.chomp('.')).parts.map(&:host)
|
30
|
+
rescue Whois::Error
|
31
|
+
sleep(0.75)
|
32
|
+
retry
|
33
|
+
end
|
34
|
+
|
25
35
|
# Recursively determine the correct nameservers for the given domain.
|
26
36
|
# If nameservers are not found, strip subdomains off until we've reached the TLD
|
27
37
|
def recursive_nameserver_lookup(name = domain)
|
@@ -6,7 +6,7 @@ module Dev
|
|
6
6
|
module Services
|
7
7
|
# Class contains rake templates for managing your AWS settings and logging in
|
8
8
|
class Route53 < Dev::Template::BaseInterface
|
9
|
-
def
|
9
|
+
def create_pretty_list_zone_details_task!
|
10
10
|
# Have to set a local variable to be accessible inside of the instance_eval block
|
11
11
|
exclude = @exclude
|
12
12
|
|
@@ -18,7 +18,26 @@ module Dev
|
|
18
18
|
desc 'print details for all hosted zones'
|
19
19
|
task list_details: %w(ensure_aws_credentials) do
|
20
20
|
route53 = Dev::Aws::Route53.new(ENV['DOMAINS'].to_s.strip.split(','))
|
21
|
-
route53.
|
21
|
+
route53.command_line_details
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_json_list_zone_details_task!
|
29
|
+
# Have to set a local variable to be accessible inside of the instance_eval block
|
30
|
+
exclude = @exclude
|
31
|
+
|
32
|
+
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
33
|
+
return if exclude.include?(:json_details)
|
34
|
+
|
35
|
+
namespace :aws do
|
36
|
+
namespace :hosted_zone do
|
37
|
+
desc 'print details for all hosted zones'
|
38
|
+
task json_details: %w(ensure_aws_credentials) do
|
39
|
+
route53 = Dev::Aws::Route53.new(ENV['DOMAINS'].to_s.strip.split(','))
|
40
|
+
route53.json_details
|
22
41
|
end
|
23
42
|
end
|
24
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.8.pre.alpha.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -360,6 +360,20 @@ dependencies:
|
|
360
360
|
- - "~>"
|
361
361
|
- !ruby/object:Gem::Version
|
362
362
|
version: 2.2.0
|
363
|
+
- !ruby/object:Gem::Dependency
|
364
|
+
name: whois
|
365
|
+
requirement: !ruby/object:Gem::Requirement
|
366
|
+
requirements:
|
367
|
+
- - "~>"
|
368
|
+
- !ruby/object:Gem::Version
|
369
|
+
version: '6.0'
|
370
|
+
type: :runtime
|
371
|
+
prerelease: false
|
372
|
+
version_requirements: !ruby/object:Gem::Requirement
|
373
|
+
requirements:
|
374
|
+
- - "~>"
|
375
|
+
- !ruby/object:Gem::Version
|
376
|
+
version: '6.0'
|
363
377
|
description: Ruby library for creating/maintaining your development environment
|
364
378
|
email: opensource@firespring.com
|
365
379
|
executables: []
|
@@ -475,9 +489,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
475
489
|
version: '3.1'
|
476
490
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
477
491
|
requirements:
|
478
|
-
- - "
|
492
|
+
- - ">"
|
479
493
|
- !ruby/object:Gem::Version
|
480
|
-
version:
|
494
|
+
version: 1.3.1
|
481
495
|
requirements: []
|
482
496
|
rubygems_version: 3.4.10
|
483
497
|
signing_key:
|