1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-08-09 04:48:39 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
cn
3f150ad065 docs: add link to newer version 2020-07-28 17:33:27 +02:00
9 changed files with 21 additions and 27 deletions

View File

@@ -1,6 +1,5 @@
AllCops: AllCops:
TargetRubyVersion: '2.5' TargetRubyVersion: '2.3'
NewCops: enable
Layout/EmptyLineAfterGuardClause: Layout/EmptyLineAfterGuardClause:
Enabled: false Enabled: false

View File

@@ -5,6 +5,8 @@ rvm:
- 2.7 - 2.7
- 2.6 - 2.6
- 2.5 - 2.5
- 2.4
- 2.3
script: script:
- bundle exec rake travis - bundle exec rake travis

View File

@@ -1,11 +1,5 @@
# Changelog # Changelog
## 3.0.0 (July 29, 2020)
IMPROVEMENTS:
- Drop EOL Ruby 2.4 and lower support, now minimum version supported is Ruby 2.5
## 2.3.1 (July 27, 2020) ## 2.3.1 (July 27, 2020)
IMPROVEMENTS: IMPROVEMENTS:

View File

@@ -1,9 +1,10 @@
# dyndnsd.rb # dyndnsd.rb
[![Build Status](https://travis-ci.org/cmur2/dyndnsd.svg?branch=master)](https://travis-ci.org/cmur2/dyndnsd) [![Dependencies](https://badges.depfu.com/badges/4f25da8493f7a29f652ac892fbf9227b/overview.svg)](https://depfu.com/github/cmur2/dyndnsd) [![Build Status](https://travis-ci.org/cmur2/dyndnsd.svg?branch=dyndnsd-2.x)](https://travis-ci.org/cmur2/dyndnsd) [![Dependencies](https://badges.depfu.com/badges/4f25da8493f7a29f652ac892fbf9227b/overview.svg)](https://depfu.com/github/cmur2/dyndnsd)
A small, lightweight and extensible DynDNS server written with Ruby and Rack. A small, lightweight and extensible DynDNS server written with Ruby and Rack.
**Note:** a newer version of dyndnsd.rb is available on [branch master](https://github.com/cmur2/dyndnsd), see also the [changelog](https://github.com/cmur2/dyndnsd/blob/master/CHANGELOG.md).
## Description ## Description

View File

@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.executables = ['dyndnsd'] s.executables = ['dyndnsd']
s.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE'] s.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE']
s.required_ruby_version = '>= 2.5' s.required_ruby_version = '>= 2.3'
s.add_runtime_dependency 'async-dns', '~> 1.2.0' s.add_runtime_dependency 'async-dns', '~> 1.2.0'
s.add_runtime_dependency 'jaeger-client', '~> 0.10.0' s.add_runtime_dependency 'jaeger-client', '~> 0.10.0'
@@ -39,6 +39,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rack-test' s.add_development_dependency 'rack-test'
s.add_development_dependency 'rake' s.add_development_dependency 'rake'
s.add_development_dependency 'rspec' s.add_development_dependency 'rspec'
s.add_development_dependency 'rubocop', '~> 0.88.0' s.add_development_dependency 'rubocop', '~> 0.81.0'
s.add_development_dependency 'solargraph' s.add_development_dependency 'solargraph'
end end

View File

@@ -27,10 +27,9 @@ module Dyndnsd
# @param body [Array{String}] # @param body [Array{String}]
# @return [Array{Integer,Hash{String => String},Array{String}}] # @return [Array{Integer,Hash{String => String},Array{String}}]
def decorate_dyndnsd_response(status_code, headers, body) def decorate_dyndnsd_response(status_code, headers, body)
case status_code if status_code == 200
when 200
[200, {'Content-Type' => 'text/plain'}, [get_success_body(body[0], body[1])]] [200, {'Content-Type' => 'text/plain'}, [get_success_body(body[0], body[1])]]
when 422 elsif status_code == 422
error_response_map[headers['X-DynDNS-Response']] error_response_map[headers['X-DynDNS-Response']]
end end
end end
@@ -40,10 +39,9 @@ module Dyndnsd
# @param _body [Array{String}] # @param _body [Array{String}]
# @return [Array{Integer,Hash{String => String},Array{String}}] # @return [Array{Integer,Hash{String => String},Array{String}}]
def decorate_other_response(status_code, headers, _body) def decorate_other_response(status_code, headers, _body)
case status_code if status_code == 400
when 400
[status_code, headers, ['Bad Request']] [status_code, headers, ['Bad Request']]
when 401 elsif status_code == 401
[status_code, headers, ['badauth']] [status_code, headers, ['badauth']]
end end
end end

View File

@@ -27,10 +27,9 @@ module Dyndnsd
# @param body [Array{String}] # @param body [Array{String}]
# @return [Array{Integer,Hash{String => String},Array{String}}] # @return [Array{Integer,Hash{String => String},Array{String}}]
def decorate_dyndnsd_response(status_code, headers, body) def decorate_dyndnsd_response(status_code, headers, body)
case status_code if status_code == 200
when 200
[200, {'Content-Type' => 'text/plain'}, [get_success_body(body[0], body[1])]] [200, {'Content-Type' => 'text/plain'}, [get_success_body(body[0], body[1])]]
when 422 elsif status_code == 422
error_response_map[headers['X-DynDNS-Response']] error_response_map[headers['X-DynDNS-Response']]
end end
end end
@@ -40,10 +39,9 @@ module Dyndnsd
# @param _body [Array{String}] # @param _body [Array{String}]
# @return [Array{Integer,Hash{String => String},Array{String}}] # @return [Array{Integer,Hash{String => String},Array{String}}]
def decorate_other_response(status_code, headers, _body) def decorate_other_response(status_code, headers, _body)
case status_code if status_code == 400
when 400
[status_code, headers, ['Bad Request']] [status_code, headers, ['Bad Request']]
when 401 elsif status_code == 401
[status_code, headers, ['Unauthorized']] [status_code, headers, ['Unauthorized']]
end end
end end

View File

@@ -28,6 +28,7 @@ module Dyndnsd
sleep @interval sleep @interval
Thread.new do Thread.new do
begin
write write
rescue StandardError => e rescue StandardError => e
@on_error[e] rescue nil @on_error[e] rescue nil
@@ -35,6 +36,7 @@ module Dyndnsd
end end
end end
end end
end
# @return [void] # @return [void]
def stop def stop

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dyndnsd module Dyndnsd
VERSION = '3.0.0' VERSION = '2.3.1'
end end