dyndnsd 2.0.0 → 2.3.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.
@@ -1,4 +1,5 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  module Dyndnsd
3
- VERSION = '2.0.0'.freeze
4
+ VERSION = '2.3.1'
4
5
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndnsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Nicolai
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-25 00:00:00.000000000 Z
11
+ date: 2020-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rack
14
+ name: async-dns
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: 1.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: json
28
+ name: jaeger-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.10.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.10.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: metriks
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,33 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.5.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rack-tracer
70
+ name: rack
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.8.0
75
+ version: '2.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.8.0
82
+ version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: jaeger-client
84
+ name: rack-tracer
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.10.0
89
+ version: 0.9.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.10.0
96
+ version: 0.9.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,21 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rake
112
+ name: bundler-audit
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.7.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.7.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rack-test
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - ">="
@@ -123,7 +137,7 @@ dependencies:
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
- name: rspec
140
+ name: rake
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - ">="
@@ -137,7 +151,7 @@ dependencies:
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
- name: rack-test
154
+ name: rspec
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - ">="
@@ -156,16 +170,16 @@ dependencies:
156
170
  requirements:
157
171
  - - "~>"
158
172
  - !ruby/object:Gem::Version
159
- version: 0.63.0
173
+ version: 0.81.0
160
174
  type: :development
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - "~>"
165
179
  - !ruby/object:Gem::Version
166
- version: 0.63.0
180
+ version: 0.81.0
167
181
  - !ruby/object:Gem::Dependency
168
- name: bundler-audit
182
+ name: solargraph
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - ">="
@@ -180,23 +194,19 @@ dependencies:
180
194
  version: '0'
181
195
  description: A small, lightweight and extensible DynDNS server written with Ruby and
182
196
  Rack.
183
- email: chrnicolai@gmail.com
197
+ email:
184
198
  executables:
185
199
  - dyndnsd
186
200
  extensions: []
187
- extra_rdoc_files: []
201
+ extra_rdoc_files:
202
+ - README.md
203
+ - CHANGELOG.md
204
+ - LICENSE
188
205
  files:
189
- - ".gitignore"
190
- - ".rubocop.yml"
191
- - ".rubocop_todo.yml"
192
- - ".travis.yml"
193
206
  - CHANGELOG.md
194
- - Gemfile
195
207
  - LICENSE
196
208
  - README.md
197
- - Rakefile
198
- - bin/dyndnsd
199
- - dyndnsd.gemspec
209
+ - exe/dyndnsd
200
210
  - init.d/debian-6-dyndnsd
201
211
  - lib/dyndnsd.rb
202
212
  - lib/dyndnsd/database.rb
@@ -206,15 +216,15 @@ files:
206
216
  - lib/dyndnsd/responder/rest_style.rb
207
217
  - lib/dyndnsd/textfile_reporter.rb
208
218
  - lib/dyndnsd/updater/command_with_bind_zone.rb
219
+ - lib/dyndnsd/updater/zone_transfer_server.rb
209
220
  - lib/dyndnsd/version.rb
210
- - spec/daemon_spec.rb
211
- - spec/spec_helper.rb
212
- - spec/support/dummy_database.rb
213
- - spec/support/dummy_updater.rb
214
221
  homepage: https://github.com/cmur2/dyndnsd
215
222
  licenses:
216
223
  - Apache-2.0
217
- metadata: {}
224
+ metadata:
225
+ bug_tracker_uri: https://github.com/cmur2/dyndnsd/issues
226
+ changelog_uri: https://github.com/cmur2/dyndnsd/blob/master/CHANGELOG.md
227
+ source_code_uri: https://github.com/cmur2/dyndnsd
218
228
  post_install_message:
219
229
  rdoc_options: []
220
230
  require_paths:
@@ -230,13 +240,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
240
  - !ruby/object:Gem::Version
231
241
  version: '0'
232
242
  requirements: []
233
- rubyforge_project:
234
- rubygems_version: 2.7.7
243
+ rubygems_version: 3.1.2
235
244
  signing_key:
236
245
  specification_version: 4
237
246
  summary: dyndnsd.rb
238
- test_files:
239
- - spec/daemon_spec.rb
240
- - spec/spec_helper.rb
241
- - spec/support/dummy_database.rb
242
- - spec/support/dummy_updater.rb
247
+ test_files: []
data/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- .DS_Store
2
- *.lock
3
- pkg/*
@@ -1,80 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- AllCops:
4
- TargetRubyVersion: '2.3'
5
-
6
- Gemspec/OrderedDependencies:
7
- Enabled: false
8
-
9
- Layout/AlignHash:
10
- Enabled: false
11
-
12
- Layout/EmptyLineAfterGuardClause:
13
- Enabled: false
14
-
15
- # allows nicer usage of private_class_method
16
- Layout/EmptyLinesAroundArguments:
17
- Enabled: false
18
-
19
- Layout/LeadingBlankLines:
20
- Enabled: false
21
-
22
- Layout/SpaceInsideHashLiteralBraces:
23
- Enabled: false
24
-
25
- Metrics/AbcSize:
26
- Enabled: false
27
-
28
- Metrics/BlockLength:
29
- Enabled: false
30
-
31
- Metrics/ClassLength:
32
- Enabled: false
33
-
34
- Metrics/CyclomaticComplexity:
35
- Enabled: false
36
-
37
- Metrics/LineLength:
38
- Max: 200
39
-
40
- Metrics/MethodLength:
41
- Enabled: false
42
-
43
- Metrics/PerceivedComplexity:
44
- Enabled: false
45
-
46
- Naming/UncommunicativeMethodParamName:
47
- Enabled: false
48
-
49
- Naming/MemoizedInstanceVariableName:
50
- Enabled: false
51
-
52
- Style/ConditionalAssignment:
53
- Enabled: false
54
-
55
- Style/Documentation:
56
- Enabled: false
57
-
58
- Style/FormatStringToken:
59
- Enabled: false
60
-
61
- Style/FrozenStringLiteralComment:
62
- Enabled: false
63
-
64
- Style/GuardClause:
65
- Enabled: false
66
-
67
- Style/IdenticalConditionalBranches:
68
- Enabled: false
69
-
70
- Style/InverseMethods:
71
- Enabled: false
72
-
73
- Style/NegatedIf:
74
- Enabled: false
75
-
76
- Style/RescueModifier:
77
- Enabled: false
78
-
79
- Style/SymbolArray:
80
- Enabled: false
@@ -1,7 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2018-02-23 12:54:10 +0100 using RuboCop version 0.52.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
@@ -1,8 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- rvm:
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - 2.3
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'rubocop/rake_task'
4
- require 'bundler/audit/task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
- RuboCop::RakeTask.new
8
- Bundler::Audit::Task.new
9
-
10
- task default: [:rubocop, :spec, 'bundle:audit']
@@ -1,4 +0,0 @@
1
-
2
- require 'dyndnsd'
3
-
4
- Dyndnsd::Daemon.run!
@@ -1,36 +0,0 @@
1
-
2
- $LOAD_PATH.push File.expand_path('lib', __dir__)
3
-
4
- require 'dyndnsd/version'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'dyndnsd'
8
- s.version = Dyndnsd::VERSION
9
- s.summary = 'dyndnsd.rb'
10
- s.description = 'A small, lightweight and extensible DynDNS server written with Ruby and Rack.'
11
- s.author = 'Christian Nicolai'
12
- s.email = 'chrnicolai@gmail.com'
13
- s.homepage = 'https://github.com/cmur2/dyndnsd'
14
- s.license = 'Apache-2.0'
15
-
16
- s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
- s.require_paths = ['lib']
19
- s.executables = ['dyndnsd']
20
-
21
- s.required_ruby_version = '>= 2.3'
22
-
23
- s.add_runtime_dependency 'rack', '~> 2.0'
24
- s.add_runtime_dependency 'json'
25
- s.add_runtime_dependency 'metriks'
26
- s.add_runtime_dependency 'opentracing', '~> 0.5.0'
27
- s.add_runtime_dependency 'rack-tracer', '~> 0.8.0'
28
- s.add_runtime_dependency 'jaeger-client', '~> 0.10.0'
29
-
30
- s.add_development_dependency 'bundler'
31
- s.add_development_dependency 'rake'
32
- s.add_development_dependency 'rspec'
33
- s.add_development_dependency 'rack-test'
34
- s.add_development_dependency 'rubocop', '~> 0.63.0'
35
- s.add_development_dependency 'bundler-audit'
36
- end
@@ -1,240 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Dyndnsd::Daemon do
4
- include Rack::Test::Methods
5
-
6
- def app
7
- Dyndnsd.logger = Logger.new(STDOUT)
8
- Dyndnsd.logger.level = Logger::UNKNOWN
9
-
10
- config = {
11
- 'domain' => 'example.org',
12
- 'users' => {
13
- 'test' => {
14
- 'password' => 'secret',
15
- 'hosts' => ['foo.example.org', 'bar.example.org']
16
- }
17
- }
18
- }
19
- db = Dyndnsd::DummyDatabase.new({})
20
- updater = Dyndnsd::Updater::Dummy.new
21
- daemon = Dyndnsd::Daemon.new(config, db, updater)
22
-
23
- app = Rack::Auth::Basic.new(daemon, 'DynDNS', &daemon.method(:authorized?))
24
-
25
- app = Dyndnsd::Responder::DynDNSStyle.new(app)
26
-
27
- Rack::Tracer.new(app, trust_incoming_span: false)
28
- end
29
-
30
- it 'requires authentication' do
31
- get '/'
32
- expect(last_response.status).to eq(401)
33
- expect(last_response.body).to eq('badauth')
34
- end
35
-
36
- it 'requires configured correct credentials' do
37
- authorize 'test', 'wrongsecret'
38
- get '/'
39
- expect(last_response.status).to eq(401)
40
- expect(last_response.body).to eq('badauth')
41
- end
42
-
43
- it 'only supports GET requests' do
44
- authorize 'test', 'secret'
45
- post '/nic/update'
46
- expect(last_response.status).to eq(405)
47
- end
48
-
49
- it 'provides only the /nic/update URL' do
50
- authorize 'test', 'secret'
51
- get '/other/url'
52
- expect(last_response.status).to eq(404)
53
- end
54
-
55
- it 'requires the hostname query parameter' do
56
- authorize 'test', 'secret'
57
- get '/nic/update'
58
- expect(last_response).to be_ok
59
- expect(last_response.body).to eq('notfqdn')
60
- end
61
-
62
- it 'supports multiple hostnames in request' do
63
- authorize 'test', 'secret'
64
-
65
- get '/nic/update?hostname=foo.example.org,bar.example.org&myip=1.2.3.4'
66
- expect(last_response).to be_ok
67
- expect(last_response.body).to eq("good 1.2.3.4\ngood 1.2.3.4")
68
-
69
- get '/nic/update?hostname=foo.example.org,bar.example.org&myip=2001:db8::1'
70
- expect(last_response).to be_ok
71
- expect(last_response.body).to eq("good 2001:db8::1\ngood 2001:db8::1")
72
- end
73
-
74
- it 'rejects request if one hostname is invalid' do
75
- authorize 'test', 'secret'
76
-
77
- get '/nic/update?hostname=test'
78
- expect(last_response).to be_ok
79
- expect(last_response.body).to eq('notfqdn')
80
-
81
- get '/nic/update?hostname=test.example.com'
82
- expect(last_response).to be_ok
83
- expect(last_response.body).to eq('notfqdn')
84
-
85
- get '/nic/update?hostname=test.example.org.me'
86
- expect(last_response).to be_ok
87
- expect(last_response.body).to eq('notfqdn')
88
-
89
- get '/nic/update?hostname=foo.test.example.org'
90
- expect(last_response).to be_ok
91
- expect(last_response.body).to eq('notfqdn')
92
-
93
- get '/nic/update?hostname=in%20valid.example.org'
94
- expect(last_response).to be_ok
95
- expect(last_response.body).to eq('notfqdn')
96
-
97
- get '/nic/update?hostname=valid.example.org,in.valid.example.org'
98
- expect(last_response).to be_ok
99
- expect(last_response.body).to eq('notfqdn')
100
- end
101
-
102
- it 'rejects request if user does not own one hostname' do
103
- authorize 'test', 'secret'
104
-
105
- get '/nic/update?hostname=notmyhost.example.org'
106
- expect(last_response).to be_ok
107
- expect(last_response.body).to eq('nohost')
108
-
109
- get '/nic/update?hostname=foo.example.org,notmyhost.example.org'
110
- expect(last_response).to be_ok
111
- expect(last_response.body).to eq('nohost')
112
- end
113
-
114
- it 'updates a host on IP change' do
115
- authorize 'test', 'secret'
116
-
117
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
118
- expect(last_response).to be_ok
119
-
120
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.40'
121
- expect(last_response).to be_ok
122
- expect(last_response.body).to eq('good 1.2.3.40')
123
-
124
- get '/nic/update?hostname=foo.example.org&myip=2001:db8::1'
125
- expect(last_response).to be_ok
126
-
127
- get '/nic/update?hostname=foo.example.org&myip=2001:db8::10'
128
- expect(last_response).to be_ok
129
- expect(last_response.body).to eq('good 2001:db8::10')
130
- end
131
-
132
- it 'returns IP no change' do
133
- authorize 'test', 'secret'
134
-
135
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
136
- expect(last_response).to be_ok
137
-
138
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
139
- expect(last_response).to be_ok
140
- expect(last_response.body).to eq('nochg 1.2.3.4')
141
-
142
- get '/nic/update?hostname=foo.example.org&myip=2001:db8::1'
143
- expect(last_response).to be_ok
144
-
145
- get '/nic/update?hostname=foo.example.org&myip=2001:db8::1'
146
- expect(last_response).to be_ok
147
- expect(last_response.body).to eq('nochg 2001:db8::1')
148
- end
149
-
150
- it 'outputs IP status per hostname' do
151
- authorize 'test', 'secret'
152
-
153
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
154
- expect(last_response).to be_ok
155
- expect(last_response.body).to eq('good 1.2.3.4')
156
-
157
- get '/nic/update?hostname=foo.example.org,bar.example.org&myip=1.2.3.4'
158
- expect(last_response).to be_ok
159
- expect(last_response.body).to eq("nochg 1.2.3.4\ngood 1.2.3.4")
160
-
161
- get '/nic/update?hostname=foo.example.org&myip=2001:db8::1'
162
- expect(last_response).to be_ok
163
- expect(last_response.body).to eq('good 2001:db8::1')
164
-
165
- get '/nic/update?hostname=foo.example.org,bar.example.org&myip=2001:db8::1'
166
- expect(last_response).to be_ok
167
- expect(last_response.body).to eq("nochg 2001:db8::1\ngood 2001:db8::1")
168
- end
169
-
170
- it 'offlines a host' do
171
- authorize 'test', 'secret'
172
-
173
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
174
- expect(last_response).to be_ok
175
- expect(last_response.body).to eq('good 1.2.3.4')
176
-
177
- get '/nic/update?hostname=foo.example.org&offline=YES'
178
- expect(last_response).to be_ok
179
- expect(last_response.body).to eq('good ')
180
-
181
- get '/nic/update?hostname=foo.example.org&offline=YES'
182
- expect(last_response).to be_ok
183
- expect(last_response.body).to eq('nochg ')
184
-
185
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4'
186
- expect(last_response).to be_ok
187
- expect(last_response.body).to eq('good 1.2.3.4')
188
-
189
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4&offline=YES'
190
- expect(last_response).to be_ok
191
- expect(last_response.body).to eq('good ')
192
-
193
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4&offline=YES'
194
- expect(last_response).to be_ok
195
- expect(last_response.body).to eq('nochg ')
196
- end
197
-
198
- it 'uses clients remote IP address if myip not specified' do
199
- authorize 'test', 'secret'
200
- get '/nic/update?hostname=foo.example.org'
201
- expect(last_response).to be_ok
202
- expect(last_response.body).to eq('good 127.0.0.1')
203
- end
204
-
205
- it 'uses clients remote IP address from X-Real-IP header if behind proxy' do
206
- authorize 'test', 'secret'
207
-
208
- get '/nic/update?hostname=foo.example.org', '', 'HTTP_X_REAL_IP' => '10.0.0.1'
209
- expect(last_response).to be_ok
210
- expect(last_response.body).to eq('good 10.0.0.1')
211
-
212
- get '/nic/update?hostname=foo.example.org', '', 'HTTP_X_REAL_IP' => '2001:db8::1'
213
- expect(last_response).to be_ok
214
- expect(last_response.body).to eq('good 2001:db8::1')
215
- end
216
-
217
- it 'supports an IPv4 and an IPv6 address in one request' do
218
- authorize 'test', 'secret'
219
-
220
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4&myip6=2001:db8::1'
221
- expect(last_response).to be_ok
222
- expect(last_response.body).to eq('good 1.2.3.4 2001:db8::1')
223
-
224
- get '/nic/update?hostname=foo.example.org&myip=BROKENIP&myip6=2001:db8::1'
225
- expect(last_response).to be_ok
226
- expect(last_response.body).to eq('nohost')
227
-
228
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.4&myip6=BROKENIP'
229
- expect(last_response).to be_ok
230
- expect(last_response.body).to eq('nohost')
231
-
232
- get '/nic/update?hostname=foo.example.org&myip6=2001:db8::10'
233
- expect(last_response).to be_ok
234
- expect(last_response.body).to eq('nohost')
235
-
236
- get '/nic/update?hostname=foo.example.org&myip=1.2.3.40'
237
- expect(last_response).to be_ok
238
- expect(last_response.body).to eq('good 1.2.3.40')
239
- end
240
- end