dyndnsd 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +5 -7
- data/lib/dyndnsd.rb +33 -17
- data/lib/dyndnsd/helper.rb +8 -15
- data/lib/dyndnsd/updater/command_with_bind_zone.rb +1 -1
- data/lib/dyndnsd/updater/zone_transfer_server.rb +1 -1
- data/lib/dyndnsd/version.rb +1 -1
- metadata +29 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eb3566b683e5a63a61b3f9627faee372f137498652e1d6760f0b4baa4edc986
|
4
|
+
data.tar.gz: 8a412e370ccf739826c79450a6464de68d06e20ae681726c78a3ca97d691b704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb50e6aa85ca663cea2d504c4aa3d42c6f12b17dca08839886e59ad6b0f0b78f50d7ba97757aa1953555fe61dae02a3d1d83aeb88c27ca9d08d6b9ca95049d76
|
7
|
+
data.tar.gz: 8e6e1395d2e52ea14fae024560d8587457562084ec6767ac817bd7837f686069e33eac7885ba63e633e89adbd0b494200aebd344c4c76b95e0474b68ef1b982a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.4.2 (July 30, 2021)
|
4
|
+
|
5
|
+
IMPROVEMENTS:
|
6
|
+
|
7
|
+
- move from OpenTracing to OpenTelemetry for experimental tracing feature
|
8
|
+
|
9
|
+
OTHER:
|
10
|
+
|
11
|
+
- re-release 3.4.1 to rebuild Docker image with security vulnerabilities fixes
|
12
|
+
- adopt Renovate for dependency updates
|
13
|
+
|
3
14
|
## 3.4.1 (April 15, 2021)
|
4
15
|
|
5
16
|
OTHER:
|
data/README.md
CHANGED
@@ -271,9 +271,9 @@ users:
|
|
271
271
|
|
272
272
|
### Tracing (experimental)
|
273
273
|
|
274
|
-
For tracing, dyndnsd.rb is instrumented using the [
|
274
|
+
For tracing, dyndnsd.rb is instrumented using the [OpenTelemetry](https://opentelemetry.io/docs/ruby/) framework and will emit span tracing data for the most important operations happening during the request/response cycle. Using an [instrumentation for Rack](https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/rack) allows handling incoming OpenTelemetry parent span information properly (when desired, turned off by default to reduce attack surface).
|
275
275
|
|
276
|
-
Currently,
|
276
|
+
Currently, the [OpenTelemetry trace exporter](https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/jaeger) for [CNCF Jaeger](https://github.com/jaegertracing/jaeger) can be enabled via dyndnsd.rb configuration. Alternatively, you can also enable other exporters via the environment variable `OTEL_TRACES_EXPORTER`, e.g. `OTEL_TRACES_EXPORTER=console`.
|
277
277
|
|
278
278
|
```yaml
|
279
279
|
host: "0.0.0.0"
|
@@ -282,11 +282,9 @@ db: "/opt/dyndnsd/db.json"
|
|
282
282
|
domain: "dyn.example.org"
|
283
283
|
# enable and configure tracing using the (currently only) tracer jaeger
|
284
284
|
tracing:
|
285
|
-
trust_incoming_span: false # default value, change to accept incoming
|
286
|
-
|
287
|
-
|
288
|
-
port: 6831
|
289
|
-
service_name: "my.dyndnsd.identifier"
|
285
|
+
trust_incoming_span: false # default value, change to accept incoming OpenTelemetry spans as parents
|
286
|
+
service_name: "my.dyndnsd.identifier" # default unset, will be populated by OpenTelemetry
|
287
|
+
jaeger: true # enables the Jaeger AgentExporter
|
290
288
|
# configure the updater, here we use command_with_bind_zone, params are updater-specific
|
291
289
|
updater:
|
292
290
|
name: "command_with_bind_zone"
|
data/lib/dyndnsd.rb
CHANGED
@@ -8,9 +8,9 @@ require 'json'
|
|
8
8
|
require 'yaml'
|
9
9
|
require 'rack'
|
10
10
|
require 'metriks'
|
11
|
+
require 'opentelemetry/instrumentation/rack'
|
12
|
+
require 'opentelemetry/sdk'
|
11
13
|
require 'metriks/reporter/graphite'
|
12
|
-
require 'opentracing'
|
13
|
-
require 'rack/tracer'
|
14
14
|
|
15
15
|
require 'dyndnsd/generator/bind'
|
16
16
|
require 'dyndnsd/updater/command_with_bind_zone'
|
@@ -69,7 +69,7 @@ module Dyndnsd
|
|
69
69
|
# @return [Boolean]
|
70
70
|
def authorized?(username, password)
|
71
71
|
Helper.span('check_authorized') do |span|
|
72
|
-
span.
|
72
|
+
span.set_attribute('enduser.id', username)
|
73
73
|
|
74
74
|
allow = Helper.user_allowed?(username, password, @users)
|
75
75
|
if !allow
|
@@ -112,7 +112,7 @@ module Dyndnsd
|
|
112
112
|
|
113
113
|
Dyndnsd.logger.info 'Starting...'
|
114
114
|
|
115
|
-
# drop
|
115
|
+
# drop privileges as soon as possible
|
116
116
|
# NOTE: first change group than user
|
117
117
|
if config['group']
|
118
118
|
group = Etc.getgrnam(config['group'])
|
@@ -170,7 +170,7 @@ module Dyndnsd
|
|
170
170
|
def process_changes(hostnames, myips)
|
171
171
|
changes = []
|
172
172
|
Helper.span('process_changes') do |span|
|
173
|
-
span.
|
173
|
+
span.set_attribute('dyndnsd.hostnames', hostnames.join(','))
|
174
174
|
|
175
175
|
hostnames.each do |hostname|
|
176
176
|
# myips order is always deterministic
|
@@ -252,6 +252,8 @@ module Dyndnsd
|
|
252
252
|
Dyndnsd.logger.progname = 'dyndnsd'
|
253
253
|
Dyndnsd.logger.formatter = LogFormatter.new
|
254
254
|
Dyndnsd.logger.level = config['debug'] ? Logger::DEBUG : Logger::INFO
|
255
|
+
|
256
|
+
OpenTelemetry.logger = Dyndnsd.logger
|
255
257
|
end
|
256
258
|
|
257
259
|
# @return [void]
|
@@ -296,16 +298,31 @@ module Dyndnsd
|
|
296
298
|
# @param config [Hash{String => Object}]
|
297
299
|
# @return [void]
|
298
300
|
private_class_method def self.setup_tracing(config)
|
299
|
-
#
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
301
|
+
# by default do not try to emit any traces until the user opts in
|
302
|
+
ENV['OTEL_TRACES_EXPORTER'] ||= 'none'
|
303
|
+
|
304
|
+
# configure OpenTelemetry
|
305
|
+
OpenTelemetry::SDK.configure do |c|
|
306
|
+
if config.dig('tracing', 'jaeger')
|
307
|
+
require 'opentelemetry/exporter/jaeger'
|
308
|
+
|
309
|
+
c.add_span_processor(
|
310
|
+
OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
|
311
|
+
OpenTelemetry::Exporter::Jaeger::AgentExporter.new
|
312
|
+
)
|
313
|
+
)
|
314
|
+
end
|
315
|
+
|
316
|
+
if config.dig('tracing', 'service_name')
|
317
|
+
c.service_name = config['tracing']['service_name']
|
318
|
+
end
|
319
|
+
|
320
|
+
c.service_version = Dyndnsd::VERSION
|
321
|
+
c.use('OpenTelemetry::Instrumentation::Rack')
|
322
|
+
end
|
323
|
+
|
324
|
+
if !config.dig('tracing', 'trust_incoming_span')
|
325
|
+
OpenTelemetry.propagation = OpenTelemetry::Context::Propagation::NoopTextMapPropagator.new
|
309
326
|
end
|
310
327
|
end
|
311
328
|
|
@@ -331,8 +348,7 @@ module Dyndnsd
|
|
331
348
|
app = Responder::DynDNSStyle.new(app)
|
332
349
|
end
|
333
350
|
|
334
|
-
|
335
|
-
app = Rack::Tracer.new(app, trust_incoming_span: trust_incoming_span)
|
351
|
+
app = OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware.new(app)
|
336
352
|
|
337
353
|
Rack::Handler::WEBrick.run app, Host: config['host'], Port: config['port']
|
338
354
|
end
|
data/lib/dyndnsd/helper.rb
CHANGED
@@ -45,24 +45,17 @@ module Dyndnsd
|
|
45
45
|
# @param block [Proc]
|
46
46
|
# @return [void]
|
47
47
|
def self.span(operation, &block)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
tracer = OpenTelemetry.tracer_provider.tracer(Dyndnsd.name, Dyndnsd::VERSION)
|
49
|
+
tracer.in_span(
|
50
|
+
operation,
|
51
|
+
attributes: {'component' => 'dyndnsd'},
|
52
|
+
kind: :server
|
53
|
+
) do |span|
|
54
|
+
Dyndnsd.logger.debug "Creating span ID #{span.context.hex_span_id} for trace ID #{span.context.hex_trace_id}"
|
53
55
|
block.call(span)
|
54
56
|
rescue StandardError => e
|
55
|
-
span.
|
56
|
-
span.log_kv(
|
57
|
-
event: 'error',
|
58
|
-
'error.kind': e.class.to_s,
|
59
|
-
'error.object': e,
|
60
|
-
message: e.message,
|
61
|
-
stack: e.backtrace&.join("\n") || ''
|
62
|
-
)
|
57
|
+
span.record_exception(e)
|
63
58
|
raise e
|
64
|
-
ensure
|
65
|
-
scope.close
|
66
59
|
end
|
67
60
|
end
|
68
61
|
end
|
@@ -18,7 +18,7 @@ module Dyndnsd
|
|
18
18
|
return if !db.changed?
|
19
19
|
|
20
20
|
Helper.span('updater_update') do |span|
|
21
|
-
span.
|
21
|
+
span.set_attribute('dyndnsd.updater.name', self.class.name&.split('::')&.last || 'None')
|
22
22
|
|
23
23
|
# write zone file in bind syntax
|
24
24
|
File.open(@zone_file, 'w') { |f| f.write(@generator.generate(db)) }
|
@@ -35,7 +35,7 @@ module Dyndnsd
|
|
35
35
|
# @return [void]
|
36
36
|
def update(db)
|
37
37
|
Helper.span('updater_update') do |span|
|
38
|
-
span.
|
38
|
+
span.set_attribute('dyndnsd.updater.name', self.class.name&.split('::')&.last || 'None')
|
39
39
|
|
40
40
|
soa_rr = Resolv::DNS::Resource::IN::SOA.new(
|
41
41
|
@zone_nameservers[0], @zone_email_address,
|
data/lib/dyndnsd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyndnsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Nicolai
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-dns
|
@@ -25,75 +25,75 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: metriks
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '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:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: opentelemetry-exporter-jaeger
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.19.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.19.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: opentelemetry-instrumentation-rack
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.19.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.19.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: opentelemetry-sdk
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.0.0.rc2
|
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:
|
82
|
+
version: 1.0.0.rc2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rack
|
84
|
+
name: rack
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '2.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:
|
96
|
+
version: '2.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: webrick
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,56 +184,56 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
187
|
+
version: 1.18.1
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
194
|
+
version: 1.18.1
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rubocop-rake
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
201
|
+
version: 0.6.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
208
|
+
version: 0.6.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: rubocop-rspec
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 2.
|
215
|
+
version: 2.4.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 2.
|
222
|
+
version: 2.4.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: solargraph
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 0.
|
229
|
+
version: 0.43.0
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 0.
|
236
|
+
version: 0.43.0
|
237
237
|
description: A small, lightweight and extensible DynDNS server written with Ruby and
|
238
238
|
Rack.
|
239
239
|
email:
|