dns-sniper 0.0.1.pre6 → 0.0.1.pre7

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: f366147ef18ba1adc0449b75001bd217b18b27727fe81406980cb3dec815da82
4
- data.tar.gz: b7ecdce1690d770cfc6cbe69c4745465e45d70d1704fe955cd17786ff5cc6b14
3
+ metadata.gz: fdb713f65960730a1ac99906c65aeb79b30b69514eedab948ee20eb27bf30920
4
+ data.tar.gz: 28d04385a9759e9bada850e6c4dde26d7f3d983ddedd9d5782d31c6001cab19d
5
5
  SHA512:
6
- metadata.gz: b4ef85c2cbb26409ff3bd52097ff5c95c80ec1b8303c12ab0f871fe056a33fe7a5139272e0ea6e4fd9ea8cb2c459d528155250dee70b62174284a07baefba6b9
7
- data.tar.gz: 9f2c3aa82e0f604314a9de321e5960bef302906d5dec42ab4a7801b14bbd932f11b8dd1a05fed346a75e3a895aee72ac7506085766b25e45fe228eca55ef6360
6
+ metadata.gz: c02d1bb299780f04041d8899aeb72b7457ec8954184c95a0bae61731c1b36763f44055b41d4e8115c42bf0ccfdb68b407db3aef5ff71a3dc0e01d8dde0bcee99
7
+ data.tar.gz: fd3f08b34762d39e3610ad23810736a667e83f7b77459d8508e625f67007b0fa7adcd028091c65c4f05e28f39eacc6d805313e6733c9d8592f4657b5ade50e2b
data/Gemfile.lock CHANGED
@@ -1,26 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sniper (0.0.1)
4
+ dns-sniper (0.0.1.pre6)
5
+ down (~> 5.1)
6
+ hosts_file (~> 1.0)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
8
10
  specs:
9
11
  addressable (2.7.0)
10
12
  public_suffix (>= 2.0.2, < 5.0)
11
- down (5.1.1)
13
+ down (5.2.2)
12
14
  addressable (~> 2.5)
13
15
  hosts_file (1.0.3)
14
- public_suffix (4.0.5)
16
+ public_suffix (4.0.6)
15
17
 
16
18
  PLATFORMS
17
19
  ruby
18
20
 
19
21
  DEPENDENCIES
20
- bundler (~> 2.1.2)
21
- down (~> 5.1)
22
- hosts_file (~> 1.0)
23
- sniper!
22
+ dns-sniper!
24
23
 
25
24
  BUNDLED WITH
26
25
  2.1.2
data/README.md CHANGED
@@ -40,26 +40,19 @@ require 'dns-sniper'
40
40
 
41
41
  hostnames = DNSSniper::Hostnames.new
42
42
 
43
- # Block domain names
44
- hostnames.add_from('https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0;mimetype=plaintext') # From the web
45
- hostnames.add_from('https://raw.githubusercontent.com/brodyhoskins/dns-blocklists/master/tracking.list')
46
- hostnames.add_from('~/.config/dns-sniper/blocklists.list') # From filesystem
47
-
48
- # Manually add domain name
49
- hostnames.add('ads.yahoo.com')
50
- hostnames.add(['ads.doubleclick.net', 'ads.msn.com'])
51
-
52
- # Remove whitelisted domain names
53
- hostnames.remove_from('~/.config/dns-sniper/whitelisted-hostnames.list')
54
- hostnames.remove_from('https://example.com/whitelisted.hosts')
55
-
56
- # Manually remove domain name
57
- hostnames.remove('favoritewebsite.com')
58
- hostnames.remove(['favoritewebsite.com', 'otherfavoritewebsite.com'])
59
-
60
- # Convert to configuration file
61
- hostnames.to_format('dnsmasq')
62
- hostnames.to_format('unbound')
43
+ # Manually add blacklisted or whitelisted domains
44
+ hostnames.blacklist += 'ads.yahoo.com'
45
+ hostnames.whitelist += 'favoritewebsite.com'
46
+
47
+ # Use an Importer to process external lists
48
+ hostnames.blacklist += DNSSniper::DomainsImporter.new('https://raw.githubusercontent.com/brodyhoskins/dns-blocklists/master/tracking.list').hostnames
49
+ hostnames.blacklist += DNSSniper::HostsImporter.new('https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0;mimetype=plaintext').hostnames
50
+
51
+ # Blocklist is accessible as an Array
52
+ hostnames.blocklist
53
+
54
+ # Use an Exporter to convert to other formats
55
+ UnboundExporter.new(hostnames.blocklist).data
63
56
  ```
64
57
 
65
58
  ### From CLI
@@ -71,7 +64,6 @@ Using the CLI version makes it easy to update configuration formats automaticall
71
64
  ```bash
72
65
  #!/usr/bin/env bash
73
66
 
74
- /path/to/dns-sniper -f ~/.config/dns-sniper/blacklist.list -w ~/.config/dns-sniper/whitelist.list -o unbound > /etc/unbound/unbound.conf.t/blocklist.conf
75
-
67
+ /path/to/dns-sniper --conf ~/.config/dns-sniper/dns-sniper.yml --output unbound > /etc/unbound/unbound.conf.d/blocklist.conf
76
68
  service unbound reload
77
69
  ```
@@ -0,0 +1,9 @@
1
+ :sources:
2
+ :allow:
3
+ - :importer: :domains
4
+ :uri: https://example.com/whitelisted.domains.list
5
+ :reject:
6
+ - :importer: :domains
7
+ :uri: https://raw.githubusercontent.com/brodyhoskins/dns-blocklists/master/tracking.list
8
+ - :importer: :hosts
9
+ :uri: https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0;mimetype=plaintext
data/dns-sniper.gemspec CHANGED
@@ -3,8 +3,8 @@
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'dns-sniper'
5
5
  spec.license = 'MIT'
6
- spec.version = '0.0.1.pre6'
7
- spec.date = '2020-11-11'
6
+ spec.version = '0.0.1.pre7'
7
+ spec.date = '2021-07-26'
8
8
 
9
9
  spec.authors = ['Brody Hoskins']
10
10
  spec.email = ['brody@brody.digital']
@@ -11,8 +11,8 @@ module DNSSniper
11
11
  attr_accessor :whitelist
12
12
 
13
13
  def initialize
14
- @blacklist = [].to_set
15
- @whitelist = [].to_set
14
+ @blacklist = []
15
+ @whitelist = []
16
16
  self
17
17
  end
18
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns-sniper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre6
4
+ version: 0.0.1.pre7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brody Hoskins
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-11 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down
@@ -54,6 +54,7 @@ files:
54
54
  - README.md
55
55
  - Rakefile
56
56
  - bin/dns-sniper
57
+ - config.yml.example
57
58
  - dns-sniper.gemspec
58
59
  - lib/dns-sniper.rb
59
60
  - lib/dns-sniper/exporter.rb
@@ -76,7 +77,7 @@ licenses:
76
77
  metadata:
77
78
  homepage_uri: https://github.com/brodyhoskins/dns-sniper
78
79
  source_code_uri: https://github.com/brodyhoskins/dns-sniper
79
- post_install_message:
80
+ post_install_message:
80
81
  rdoc_options: []
81
82
  require_paths:
82
83
  - lib
@@ -91,8 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  - !ruby/object:Gem::Version
92
93
  version: 1.3.1
93
94
  requirements: []
94
- rubygems_version: 3.0.3
95
- signing_key:
95
+ rubygems_version: 3.2.15
96
+ signing_key:
96
97
  specification_version: 4
97
98
  summary: Combine DNS blacklists into desired configuration format
98
99
  test_files: []