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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6103d147e0009badc20c17fc1019e3a66602ed04cb256216a024b9f464c1f1c3
4
- data.tar.gz: bbefd6e7ec3bac69ac6b32c23f52d991699b636393607c22e102f7d6f6799cfd
3
+ metadata.gz: 9eb3566b683e5a63a61b3f9627faee372f137498652e1d6760f0b4baa4edc986
4
+ data.tar.gz: 8a412e370ccf739826c79450a6464de68d06e20ae681726c78a3ca97d691b704
5
5
  SHA512:
6
- metadata.gz: 0d30625375f42ecb9e6ca6db557fe96bc395a3531bf8411c08bc164f239a0ddb27e276a8bd606360670c8f4c2f8f6d8ad0ae095993b76f84b5b82ab9125a34c9
7
- data.tar.gz: 0d3da41b59c05e40ba739726d1d8efa03ac7916b1feaad2ce38ab5e635a8298d9fc0a2f30042bd3aeacf3171fffa066b7d048a49c7f6b17b6d626faf21ebac44
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 [OpenTracing](http://opentracing.io/) framework and will emit span tracing data for the most important operations happening during the request/response cycle. Using a middleware for Rack allows handling incoming OpenTracing span information properly.
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, only one OpenTracing-compatible tracer implementation named [CNCF Jaeger](https://github.com/jaegertracing/jaeger) can be configured to use with dyndnsd.rb.
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 OpenTracing spans as parents
286
- jaeger:
287
- host: 127.0.0.1 # defaults for host and port of local jaeger-agent
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.set_tag('dyndnsd.user', username)
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 priviliges as soon as possible
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.set_tag('dyndnsd.hostnames', hostnames.join(','))
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
- # configure OpenTracing
300
- if config.dig('tracing', 'jaeger')
301
- require 'jaeger/client'
302
-
303
- host = config['tracing']['jaeger']['host'] || '127.0.0.1'
304
- port = config['tracing']['jaeger']['port'] || 6831
305
- service_name = config['tracing']['jaeger']['service_name'] || 'dyndnsd'
306
- OpenTracing.global_tracer = Jaeger::Client.build(
307
- host: host, port: port, service_name: service_name, flush_interval: 1
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
- trust_incoming_span = config.dig('tracing', 'trust_incoming_span') || false
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
@@ -45,24 +45,17 @@ module Dyndnsd
45
45
  # @param block [Proc]
46
46
  # @return [void]
47
47
  def self.span(operation, &block)
48
- scope = OpenTracing.start_active_span(operation)
49
- span = scope.span
50
- span.set_tag('component', 'dyndnsd')
51
- span.set_tag('span.kind', 'server')
52
- begin
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.set_tag('error', true)
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.set_tag('dyndnsd.updater.name', self.class.name&.split('::')&.last || 'None')
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.set_tag('dyndnsd.updater.name', self.class.name&.split('::')&.last || 'None')
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dyndnsd
4
- VERSION = '3.4.1'
4
+ VERSION = '3.4.2'
5
5
  end
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.1
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-04-15 00:00:00.000000000 Z
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: jaeger-client
28
+ name: metriks
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.0
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: 1.1.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: metriks
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: '0'
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: '0'
54
+ version: 0.19.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: opentracing
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.5.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.5.0
68
+ version: 0.19.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rack
70
+ name: opentelemetry-sdk
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.0'
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: '2.0'
82
+ version: 1.0.0.rc2
83
83
  - !ruby/object:Gem::Dependency
84
- name: rack-tracer
84
+ name: rack
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.0
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: 0.9.0
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.12.0
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.12.0
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.5.1
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.5.1
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.2.0
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.2.0
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.40.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.40.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: