wildcard-dnsd 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 638d9806764c3a4c3853f707671f4aab4926d87e7d81478afbae7b0dc9094f35
4
+ data.tar.gz: f4ab63a2561d09894e0299ba26765e5f07e91b72d959bbeb470f909b0ee66aeb
5
+ SHA512:
6
+ metadata.gz: 26bd90633e8c448cddb6cceb33b221369f09df8dd8709b854b214edb4d9015b2dc7b6a1ec2aa8ac792230d52a4e25bf73c400426060a254014c4a6ea603a9f74
7
+ data.tar.gz: 98eed8c17f39dc040a770fd8ad940d8493aa677d88de991e961ed6241919b99c136fa68fdde1945335e805f2871bb6f2eb815d1de4585ad4ecf07a40a88f6a79
@@ -0,0 +1,3 @@
1
+ `G�^��0��/D�(sE��װ�
2
+ ��i%�4�"��-�5DvG���
3
+ -B�^��;�q���(��<��Ȓx��o�󈟣�v��Q�V��0>��'��Z��zm�����W�qM�FV-E��j�F�XF��?�X�ߺ��5 Q�����U�76pO�eK��G�Jy�#Pg�w�Z�\�o�.`k���7�T�Ly(�$�:8�ک��mib���7@�����v��ּ\:6T'�D�y�����y.��Κ�?��{CT��UBrOR��)tgh)H����i
Binary file
@@ -0,0 +1,59 @@
1
+
2
+ # Created by https://www.gitignore.io/api/ruby
3
+ # Edit at https://www.gitignore.io/?templates=ruby
4
+
5
+ ### Ruby ###
6
+ *.gem
7
+ *.rbc
8
+ /.config
9
+ /coverage/
10
+ /InstalledFiles
11
+ /pkg/
12
+ /spec/reports/
13
+ /spec/examples.txt
14
+ /test/tmp/
15
+ /test/version_tmp/
16
+ /tmp/
17
+
18
+ # Used by dotenv library to load environment variables.
19
+ # .env
20
+
21
+ # Ignore Byebug command history file.
22
+ .byebug_history
23
+
24
+ ## Specific to RubyMotion:
25
+ .dat*
26
+ .repl_history
27
+ build/
28
+ *.bridgesupport
29
+ build-iPhoneOS/
30
+ build-iPhoneSimulator/
31
+
32
+ ## Specific to RubyMotion (use of CocoaPods):
33
+ #
34
+ # We recommend against adding the Pods directory to your .gitignore. However
35
+ # you should judge for yourself, the pros and cons are mentioned at:
36
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
37
+ # vendor/Pods/
38
+
39
+ ## Documentation cache and generated files:
40
+ /.yardoc/
41
+ /_yardoc/
42
+ /doc/
43
+ /rdoc/
44
+
45
+ ## Environment normalization:
46
+ /.bundle/
47
+ /vendor/bundle
48
+ /lib/bundler/man/
49
+
50
+ # for a library or gem, you might want to ignore these files since the code is
51
+ # intended to run in multiple environments; otherwise, check them in:
52
+ # Gemfile.lock
53
+ # .ruby-version
54
+ # .ruby-gemset
55
+
56
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
57
+ .rvmrc
58
+
59
+ # End of https://www.gitignore.io/api/ruby
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,21 @@
1
+
2
+ The MIT License (MIT)
3
+ Copyright © 2019 Chris Olstrom <chris@olstrom.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the “Software”), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ #+TITLE: Wildcard DNSd
2
+ #+LATEX: \pagebreak
3
+
4
+ * Overview
5
+
6
+ ~wildcard-dnsd~ is a simple, standalone wildcard DNS service. It is very
7
+ similar to [[https://nip.io][nip.io]], but is written in Ruby rather than Python, and does not
8
+ require the deployment and configuration of PowerDNS.
9
+
10
+ * Why does this exist?
11
+
12
+ Because sometimes you want a self-hosted alternative to nip.io, without the
13
+ hassle, for reliability, network isolation, or other reasons.
14
+
15
+ * Installation
16
+
17
+ =gem install wildcard-dnsd=
18
+
19
+ * Usage
20
+
21
+ =wildcard-dnsd [domain ...]=
22
+
23
+ * Configuration
24
+
25
+ ~wildcard-dnsd~ requires very little (if any) configuration. Assuming it has
26
+ sufficient privileges to bind a privileged port (53), the default behaviour is
27
+ to bind to all interfaces and listen on UDP/53.
28
+
29
+ It uses the default DNS resolvers for your system, detected at startup.
30
+
31
+ If you prefer to bind to a specific interface, set =FRONTEND_HOST= in the
32
+ environment. If you need to bind to a different port, set =FRONTEND_PORT=.
33
+
34
+ * License
35
+
36
+ ~wildcard-dnsd~ is available under the [[https://tldrlegal.com/license/mit-license][MIT License]]. See =LICENSE.txt= for the
37
+ full text.
@@ -0,0 +1,41 @@
1
+ #! /usr/bin/env ruby
2
+ # coding: utf-8
3
+ # -*- ruby -*-
4
+
5
+ require "rubydns" # SPDX-License-Identifier: MIT
6
+
7
+ FRONTEND_HOST = ENV.fetch("FRONTEND_HOST") { "0.0.0.0" }
8
+ FRONTEND_PORT = ENV.fetch("FRONTEND_PORT") { 53 }.to_i
9
+ FRONTENDS = [
10
+ [:udp, FRONTEND_HOST, FRONTEND_PORT]
11
+ ]
12
+
13
+ Resolv.getname("1.1.1.1")
14
+ SYSTEM_DEFAULT_RESOLVERS = Resolv::DefaultResolver
15
+ .instance_variable_get(:@resolvers)
16
+ .select { |resolver| Resolv::DNS === resolver }
17
+ .map(&:make_udp_requester)
18
+ .map do |resolver|
19
+ [
20
+ :udp,
21
+ resolver.instance_variable_get(:@host),
22
+ resolver.instance_variable_get(:@port),
23
+ ]
24
+ end
25
+
26
+ BACKENDS = RubyDNS::Resolver.new(SYSTEM_DEFAULT_RESOLVERS)
27
+
28
+ IPV4_PATTERN = "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)[.-]){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
29
+
30
+ ARGV.push(Socket.gethostname) if ARGV.empty?
31
+
32
+ RubyDNS.run_server(FRONTENDS) do
33
+ ARGV.each do |domain|
34
+ match(/^(?<prefix>.+[.-])?(?<ipv4>#{IPV4_PATTERN})[.]#{Regexp.escape(domain)}$/, Resolv::DNS::Resource::IN::A) do |transaction, match_data|
35
+ transaction.respond!(match_data[:ipv4].tr("-", "."))
36
+ end
37
+ end
38
+ otherwise do |transaction|
39
+ transaction.passthrough!(BACKENDS)
40
+ end
41
+ end
@@ -0,0 +1,25 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdjaHJp
3
+ cy9EQz1vbHN0cm9tL0RDPWNvbTAeFw0xOTA2MTMyMTA1NDlaFw0yMDA2MTIyMTA1
4
+ NDlaMCIxIDAeBgNVBAMMF2NocmlzL0RDPW9sc3Ryb20vREM9Y29tMIIBojANBgkq
5
+ hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA9JtEKdevqT5+3QbLCIrEe2kY1s+GjPgq
6
+ pMQt+VR7BLjQx/keobztPGPkGM8AzPxvJ5s+8HIrCQW3npzmadj3TNn5MJS1Mfez
7
+ dW+HXih+J3App3CuhHWrEkPjjWnOJMdltzeHUTXGc5D49xG0/ijL6McO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sGH0+fQFhCPG9W2o8uyakRimIHxDPHpr7HT3s5+vlIR
24
+ ++pdkR83HVNOuHEO3yPK2bf7NGJpNbcM
25
+ -----END CERTIFICATE-----
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |gem|
2
+ tag = `git describe --tags --abbrev=0`.chomp
3
+
4
+ gem.name = 'wildcard-dnsd'
5
+ gem.homepage = 'https://github.com/colstrom/wildcard-dnsd'
6
+ gem.summary = 'Wildcard DNS Daemon'
7
+
8
+ gem.version = "#{tag}"
9
+ gem.licenses = ['MIT']
10
+ gem.authors = ['Chris Olstrom']
11
+ gem.email = 'chris@olstrom.com'
12
+
13
+ gem.cert_chain = ['trust/certificates/colstrom.pem']
14
+ gem.signing_key = File.expand_path ENV.fetch 'GEM_SIGNING_KEY'
15
+
16
+ gem.files = `git ls-files -z`.split("\x0")
17
+ gem.test_files = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
18
+ gem.executables = `git ls-files -z -- bin/*`.split("\x0").map { |f| File.basename(f) }
19
+
20
+ gem.require_paths = ['lib']
21
+
22
+ gem.add_runtime_dependency 'rubydns', '~> 2.0', '>= 2.0.2' # SPDX-License-Identifier: MIT
23
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wildcard-dnsd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Olstrom
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIENDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdjaHJp
14
+ cy9EQz1vbHN0cm9tL0RDPWNvbTAeFw0xOTA2MTMyMTA1NDlaFw0yMDA2MTIyMTA1
15
+ NDlaMCIxIDAeBgNVBAMMF2NocmlzL0RDPW9sc3Ryb20vREM9Y29tMIIBojANBgkq
16
+ hkiG9w0BAQEFAAOCAY8AMIIB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
32
+ RfToz4kuoi5VNZk1mZsGNuAh7RVVFUFGkK4lY34FkD+gHqKBMY6wOjy2wIc5lnze
33
+ 9BSM2/BfchYUZZFWWahMGFWJhIpKR7qGM4N0XtzDnUXKmhoV6EiM5QN76E7bCwbX
34
+ APmVyMIj8BOONTIc1ZAHLsGH0+fQFhCPG9W2o8uyakRimIHxDPHpr7HT3s5+vlIR
35
+ ++pdkR83HVNOuHEO3yPK2bf7NGJpNbcM
36
+ -----END CERTIFICATE-----
37
+ date: 2019-07-03 00:00:00.000000000 Z
38
+ dependencies:
39
+ - !ruby/object:Gem::Dependency
40
+ name: rubydns
41
+ requirement: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '2.0'
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 2.0.2
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '2.0'
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 2.0.2
59
+ description:
60
+ email: chris@olstrom.com
61
+ executables:
62
+ - wildcard-dnsd
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - ".gitignore"
67
+ - Gemfile
68
+ - LICENSE.txt
69
+ - README.org
70
+ - bin/wildcard-dnsd
71
+ - trust/certificates/colstrom.pem
72
+ - wildcard-dnsd.gemspec
73
+ homepage: https://github.com/colstrom/wildcard-dnsd
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubygems_version: 3.0.4
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Wildcard DNS Daemon
96
+ test_files: []
@@ -0,0 +1,2 @@
1
+ (e��ݛ%�M/�"*�x ?1���p��㞱;9��*�z&"O������Ff�O�Tx�R��O��-�K�ߴI+ݶ9x�aV%1G#� ������ ��.�>���C��z�e]3�bJh���%O��*#�4Q{˜�uh��QN�(%8Xnzm ���^�9�w�b�1d ���v��…���˝�ʭ��nTw���@>p
2
+ 8Y7��( ���c�ɯ�c%�J�#q�{�&܎J~7����@-2�c��r"��[B%�l���?t����n8����"�rL�`�X�BG�ϛ��F�����H��UF�ޯ;(��!�q�c�������@ѷ��<�g����5QiƘ\O�8�ع��I�}�*��D��] ʽ�;g�MtN