nslookupot 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 271d90fc88e6c918c776d151ca571e81077d454f3a4a18b59f27b30ca403d4c6
4
- data.tar.gz: 2be09b1568c8772969faff0eef9507a980aac2e874a2637408948e5bb2cb005d
3
+ metadata.gz: 9b350d62a884591ff76da9f24fe07750ad72ad276f651a409ae68dea527e9807
4
+ data.tar.gz: e4596168dc1a0ef224124897be48025baff86f93a01446ca96507050dbb9483d
5
5
  SHA512:
6
- metadata.gz: 2c8a0e6f1eda9ec6f7ffc18f3f4f71e54ceab74a06374588fc421bc8ca953a2157db0484c7079eb355e760865974a7385031ffd86d51cc6bbf89505146565dbe
7
- data.tar.gz: 835a1c0aa9ee5226078a967214384e21e5c349b5bb92c941e752177e00c79aee1e5f1ffc8ee33cf612e96c8c04d7ad8e2d38795dc1439f192e4e080ed16f8635
6
+ metadata.gz: 62b8389a2695f7455032d7141b78ab8664c3d8cc82fc2c912bf798666da179345202c81992e7c97c2a92a9da2d356d037389dc55c2a979082a6e0929eac95aba
7
+ data.tar.gz: a8c46812459f07ba4942746239a73d780d3846fa43ba8752e2d7e565de402bf751442637b0880591c8ac83bbb257766ad7318eaa21b986574c958af3e9c22046
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - '*'
10
+
11
+ jobs:
12
+ ci:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.6.x', '2.7.x']
17
+ steps:
18
+ - name: Set up Ruby
19
+ uses: actions/setup-ruby@v1
20
+ - uses: actions/checkout@v1
21
+ - name: Install dependencies
22
+ run: |
23
+ gem --version
24
+ gem install bundler
25
+ bundle --version
26
+ bundle install
27
+ - name: Run test
28
+ run: |
29
+ bundle exec rake
data/Gemfile CHANGED
@@ -7,8 +7,7 @@ gem 'openssl'
7
7
  gem 'rake'
8
8
 
9
9
  group :test do
10
- gem 'pry'
11
- gem 'pry-byebug'
10
+ gem 'byebug'
12
11
  gem 'rspec', '3.8.0'
13
12
  gem 'rubocop', '0.78.0'
14
13
  end
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # nslookupot
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nslookupot.svg)](https://badge.fury.io/rb/nslookupot)
4
- [![Build Status](https://travis-ci.org/thekuwayama/nslookupot.svg?branch=master)](https://travis-ci.org/thekuwayama/nslookupot)
4
+ [![CI](https://github.com/thekuwayama/nslookupot/workflows/CI/badge.svg)](https://github.com/thekuwayama/nslookupot/actions?workflow=CI)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/5df9157757f5a0bf1623/maintainability)](https://codeclimate.com/github/thekuwayama/nslookupot/maintainability)
6
6
 
7
7
  nslookupot is CLI that is `nslookup` over TLS (version 1.2).
@@ -24,6 +24,7 @@ Usage: nslookupot [options] name
24
24
  -s, --server VALUE the name server IP address (default 1.1.1.1)
25
25
  -p, --port VALUE the name server port number (default 853)
26
26
  -h, --hostname VALUE the name server hostname (default cloudflare-dns.com)
27
+ -n, --no-check-sni no check SNI (default false)
27
28
  -t, --type VALUE the type of the information query (default A)
28
29
  ```
29
30
 
@@ -12,7 +12,8 @@ module Nslookupot
12
12
  opts = {
13
13
  server: '1.1.1.1',
14
14
  port: 853,
15
- hostname: 'cloudflare-dns.com'
15
+ hostname: 'cloudflare-dns.com',
16
+ check_sni: true
16
17
  }
17
18
  type = 'A'
18
19
 
@@ -40,6 +41,14 @@ module Nslookupot
40
41
  opts[:hostname] = v
41
42
  end
42
43
 
44
+ op.on(
45
+ '-n',
46
+ '--no-check-sni',
47
+ "no check SNI (default #{!opts[:check_sni]})"
48
+ ) do
49
+ opts[:check_sni] = false
50
+ end
51
+
43
52
  op.on(
44
53
  '-t',
45
54
  '--type VALUE',
@@ -5,11 +5,17 @@ module Nslookupot
5
5
  # @param server [String]
6
6
  # @param port [Integer]
7
7
  # @param hostname [String]
8
- def initialize(server: '1.1.1.1', port: 853,
9
- hostname: 'cloudflare-dns.com')
8
+ # @param check_sni [bool]
9
+ def initialize(
10
+ server: '1.1.1.1',
11
+ port: 853,
12
+ hostname: 'cloudflare-dns.com',
13
+ check_sni: true
14
+ )
10
15
  @server = server
11
16
  @port = port
12
17
  @hostname = hostname # for SNI
18
+ @check_sni = check_sni
13
19
  end
14
20
 
15
21
  # @param name [String]
@@ -72,8 +78,13 @@ module Nslookupot
72
78
  ctx = OpenSSL::SSL::SSLContext.new('TLSv1_2')
73
79
  sock = OpenSSL::SSL::SSLSocket.new(ts, ctx)
74
80
  sock.sync_close = true
75
- sock.connect
76
- sock.post_connection_check(@hostname)
81
+ if @check_sni
82
+ sock.hostname = @hostname
83
+ sock.connect
84
+ sock.post_connection_check(@hostname)
85
+ else
86
+ sock.connect
87
+ end
77
88
 
78
89
  sock
79
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nslookupot
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nslookupot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2020-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,9 +60,9 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".github/workflows/ci.yml"
63
64
  - ".gitignore"
64
65
  - ".rubocop.yml"
65
- - ".travis.yml"
66
66
  - Gemfile
67
67
  - LICENSE.txt
68
68
  - README.md
@@ -80,7 +80,7 @@ homepage: https://github.com/thekuwayama/nslookupot
80
80
  licenses:
81
81
  - MIT
82
82
  metadata: {}
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubygems_version: 3.1.2
99
- signing_key:
99
+ signing_key:
100
100
  specification_version: 4
101
101
  summary: nslookup over TLS
102
102
  test_files:
@@ -1,16 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.6
5
- - 2.7
6
- - ruby-head
7
-
8
- matrix:
9
- allow_failures:
10
- - rvm: ruby-head
11
-
12
- before_install:
13
- - gem install bundler
14
- - bundle install
15
-
16
- script: bundle exec rake