transmission-rss 0.2.4 → 0.2.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 704c52a380e2d3a708361c0bcc0f6a3a6b09b645
4
- data.tar.gz: 0ede1eafb3b90889b62e33667d78b2b556e71ebe
3
+ metadata.gz: f6d73ffc3970765dd6e3cf73c3cd4b8a0f448748
4
+ data.tar.gz: abfa8c32eca25e0c8d19f97456cc7b7ef42f968f
5
5
  SHA512:
6
- metadata.gz: 835221ea29553f8e4c95fceaca9278d141201635fe766e13ee6b50d8129416c713ddd2d095d7a3d49ac9347760a46a0a0ce45781009526e93c1cb537d3b18621
7
- data.tar.gz: a2ac8712185966c4e6179e33c645c0f8598f41c023f22625ef1954d2ec9f2add118d9e176602f724a54a6bc43d635dbcee8f3d944c80203d2dbd5135e78b8447
6
+ metadata.gz: fcc856bd2404f61c9d73b736e4ee1580b39c4dd8bafba51ad8c53f753ea7a121ecd181d4446c172d44aab5fbe0a52a2acce54249b37db4af8d83089abb1181e8
7
+ data.tar.gz: bd8215efee450e96d7728e68eaf0eada697a6e9b7cf28fcdf8b51d4b9b7d479b5e985921aea8f39b4332978380c322c530406c5e7f3e3c32db66543e8aeedd99
data/README.md CHANGED
@@ -36,6 +36,12 @@ Installation
36
36
  gem build transmission-rss.gemspec
37
37
  gem install transmission-rss-*.gem
38
38
 
39
+ ### Via Docker
40
+
41
+ docker run \
42
+ -v $(pwd)/transmission-rss.conf:/etc/transmission-rss.conf \
43
+ nning2/transmission-rss
44
+
39
45
  Configuration
40
46
  -------------
41
47
 
@@ -71,6 +77,12 @@ Setting the seed ratio limit is supported per feed:
71
77
  feeds:
72
78
  - url: http://example.com/feed1
73
79
  seed_ratio_limit: 0
80
+
81
+ Configurable certificate validation, good for self-signed certificates. Default is true:
82
+
83
+ feeds:
84
+ - url: http://example.com/feed1
85
+ validate_cert: false
74
86
 
75
87
  ### All available options
76
88
 
@@ -88,20 +100,22 @@ transmission is configured for HTTP basic authentication.
88
100
  regexp: match1
89
101
  - url: http://example.com/feed4
90
102
  regexp: (match1|match2)
91
- - url: http://example.com/feed4
103
+ - url: http://example.com/feed5
92
104
  download_path: /home/user/Downloads
93
- - url: http://example.com/feed4
105
+ - url: http://example.com/feed6
94
106
  seed_ratio_limit: 1
95
- - url: http://example.com/feed4
107
+ - url: http://example.com/feed7
96
108
  regexp:
97
109
  - match1
98
110
  - match2
99
- - url: http://example.com/feed5
111
+ - url: http://example.com/feed8
100
112
  regexp:
101
113
  - matcher: match1
102
114
  download_path: /home/user/match1
103
115
  - matcher: match2
104
116
  download_path: /home/user/match2
117
+ - url: http://example.com/feed9
118
+ validate_cert: false
105
119
 
106
120
  update_interval: 600
107
121
 
@@ -12,6 +12,11 @@ include TransmissionRSS
12
12
  config_file = '/etc/transmission-rss.conf'
13
13
  custom_config = false
14
14
 
15
+ # Change default config file path on BSD.
16
+ if bsd?
17
+ config_file = '/usr/local' + config_file
18
+ end
19
+
15
20
  # Do not fork by default.
16
21
  dofork = false
17
22
 
@@ -1,6 +1,7 @@
1
1
  require 'open-uri'
2
2
  require 'open_uri_redirections'
3
3
  require 'rss'
4
+ require 'openssl'
4
5
 
5
6
  libdir = File.dirname(__FILE__)
6
7
  require File.join(libdir, 'log')
@@ -42,9 +43,16 @@ module TransmissionRSS
42
43
  loop do
43
44
  @feeds.each do |feed|
44
45
  @log.debug('aggregate ' + feed.url)
46
+
47
+ options = {allow_redirections: :safe}
48
+
49
+ unless feed.validate_cert
50
+ @log.debug('aggregate certificate validation: false')
51
+ options[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE
52
+ end
45
53
 
46
54
  begin
47
- content = open(feed.url, allow_redirections: :safe).read
55
+ content = open(feed.url, options).read
48
56
  rescue StandardError => e
49
57
  @log.debug("retrieval error (#{e.class}: #{e.message})")
50
58
  next
@@ -1,4 +1,8 @@
1
1
  class Object
2
+ def bsd?
3
+ RUBY_PLATFORM.include?('bsd')
4
+ end
5
+
2
6
  def linux?
3
7
  RUBY_PLATFORM.downcase.include?('linux')
4
8
  end
@@ -1,6 +1,6 @@
1
1
  module TransmissionRSS
2
2
  class Feed
3
- attr_reader :url, :regexp, :config
3
+ attr_reader :url, :regexp, :config, :validate_cert
4
4
 
5
5
  def initialize(config = {})
6
6
  @download_paths = {}
@@ -11,7 +11,8 @@ module TransmissionRSS
11
11
 
12
12
  @url = URI.encode(config['url'] || config.keys.first)
13
13
 
14
- @download_path = config['download_path']
14
+ @download_path = config['download_path']
15
+ @validate_cert = config['validate_cert'].nil? || config['validate_cert']
15
16
 
16
17
  matchers = Array(config['regexp']).map do |e|
17
18
  e.is_a?(String) ? e : e['matcher']
@@ -1,3 +1,3 @@
1
1
  module TransmissionRSS
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -12,18 +12,20 @@ feeds:
12
12
  regexp: match1
13
13
  - url: http://example.com/feed4
14
14
  regexp: (match1|match2)
15
- - url: http://example.com/feed4
15
+ - url: http://example.com/feed5
16
16
  download_path: /home/user/Downloads
17
- - url: http://example.com/feed4
17
+ - url: http://example.com/feed6
18
18
  regexp:
19
19
  - match1
20
20
  - match2
21
- - url: http://example.com/feed5
21
+ - url: http://example.com/feed7
22
22
  regexp:
23
23
  - matcher: match1
24
24
  download_path: /home/user/match1
25
25
  - matcher: match2
26
26
  download_path: /home/user/match2
27
+ - url: http://example.com/feed8
28
+ validate_cert: false
27
29
 
28
30
  # Feed probing interval in seconds. Default is 600.
29
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transmission-rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - henning mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-18 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: open_uri_redirections
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.6.8
99
+ rubygems_version: 2.6.11
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Adds torrents from rss feeds to transmission web frontend.