ratonvirus-clamby 0.1.0 → 0.2.0

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: 2ab97421ef8f1bcf87fc7465487f76f65d703b9e31ffc7fa156846863887ff90
4
- data.tar.gz: d917af42da7b4602fb6e674e863c8ee16ba454457cc7d500396f16c35b1b1eaa
3
+ metadata.gz: bbbf31447a05facfeb03d9c2549eff8a7213217dcf94e69efd3c7803dff9c99c
4
+ data.tar.gz: 42526d14c2b6abfbc698d727ae0e5bbc6eab286f46407c1d36b67dcac0ab7809
5
5
  SHA512:
6
- metadata.gz: 308ed44513124fd828b795f4bee414ead467a4ff8ae3c086d15b2a02a39a6dcf3fd9ccd7ce180a90e1278f06fdb11eecc923e34bd5a0704f840da11531f16a00
7
- data.tar.gz: 6d551e25b9247bc0c72e11a5dce518e6920c8ddc27c6b5d149d3646751b687e32dcb7b4bc2c4759cafc61edee31fe5b088c5c3e6e1b11b03ad2451d6cdd138ea
6
+ metadata.gz: d60272c1828bf8e95ab5a604ef4b044bdf3d99f43d79091e68419957fd8d5861549e78f9c74b8b7259e473109ba662be93d67a2487fe4a6a57819ce857b53b14
7
+ data.tar.gz: 8ce13e2af541516995c31b567ff0ffa34f1b1c1d1113a5aadfc18c1f6b4730149f80e52ac62040d84e7bfe8ee09f9eca31ebdab4b5e6cee11bae3b208c01ad9f
@@ -0,0 +1,3 @@
1
+ # v0.1.0
2
+
3
+ Initial public release.
data/README.md CHANGED
@@ -123,18 +123,19 @@ the application folder or the folder where the users are uploading the files in
123
123
  order to ensure that ClamAV daemon is able to access that folder and read files
124
124
  from it.
125
125
 
126
- Also note that Decidim uses
127
- [CarrierWave](https://github.com/carrierwaveuploader/carrierwave) to handle its
128
- file uploads and processing on the server, so make sure you are also testing the
129
- possible temporary paths of CarrierWave.
126
+ Also note that applications using
127
+ [CarrierWave](https://github.com/carrierwaveuploader/carrierwave) or other file
128
+ upload management system may store temporary files in specific configured
129
+ temporary paths (e.g. `tmp/storage`). Make sure you are also testing that the
130
+ files are scannable in all possible temporary paths.
130
131
 
131
132
  ## Installation
132
133
 
133
134
  Add this line to your application's Gemfile:
134
135
 
135
136
  ```ruby
136
- gem 'ratonvirus'
137
- gem 'ratonvirus-clamby'
137
+ gem "ratonvirus"
138
+ gem "ratonvirus-clamby"
138
139
  ```
139
140
 
140
141
  Then execute:
@@ -177,8 +178,6 @@ Shown when the `clamdscan` executable returns with the exit code other than 0 or
177
178
 
178
179
  ### antivirus_client_error ("could not be processed for virus scan")
179
180
 
180
- This means that the given file contains a virus detected by ClamAV.
181
-
182
181
  In this case the `clamdscan` executable did not finish its work successfully and
183
182
  an error was produced. This can be generally caused by the `clamav-daemon`
184
183
  service because of few different reasons:
@@ -1,7 +1,9 @@
1
- require 'clamby'
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative 'clamby/version'
4
- require_relative 'scanner/clamby'
3
+ require "clamby"
4
+
5
+ require_relative "clamby/version"
6
+ require_relative "scanner/clamby"
5
7
 
6
8
  module Ratonvirus
7
9
  module Clamby
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ratonvirus
4
4
  module Clamby
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -16,11 +16,11 @@ module Ratonvirus
16
16
  # We want Ratonvirus to report issues on file missing errors.
17
17
  error_file_missing: true,
18
18
  # No output is required not to fill the logs. The scanning errors
19
- output_level: 'off',
19
+ output_level: "off"
20
20
  ).freeze
21
21
 
22
22
  class << self
23
- def configure(config={})
23
+ def configure(config = {})
24
24
  ::Clamby.configure(config)
25
25
  end
26
26
 
@@ -44,32 +44,33 @@ module Ratonvirus
44
44
  end
45
45
 
46
46
  protected
47
- def run_scan(path)
48
- # In case the file is not present at all, scanning should always pass
49
- # because nil is not a virus.
50
- return if path.nil?
51
47
 
52
- begin
53
- errors << :antivirus_virus_detected if ::Clamby.virus?(path)
54
- rescue ::Clamby::ClamscanClientError
55
- # This can happen e.g. if the clamdscan utility does not have access
56
- # to read the file path. For debugging, try to run the clamdscan
57
- # utility manually for the same file:
58
- # clamdscan /path/to/file.pdf
59
- #
60
- # Also, make sure that the file uploads store directory is readable
61
- # by the clamdscan utility. E.g. /path/to/app/public/uploads/tmp.
62
- #
63
- # Another possible reason is that in case there are too many
64
- # concurrent virus checks ongoing, it may also trigger this error.
65
- errors << :antivirus_client_error
66
- rescue ::Clamby::FileNotFound
67
- # This should be pretty rare since the scanner should not be even
68
- # called when the file is not available. As the storage backend may
69
- # be configured, this may still happen with some storage backends.
70
- errors << :antivirus_file_not_found
71
- end
48
+ def run_scan(path)
49
+ # In case the file is not present at all, scanning should always pass
50
+ # because nil is not a virus.
51
+ return if path.nil?
52
+
53
+ begin
54
+ errors << :antivirus_virus_detected if ::Clamby.virus?(path)
55
+ rescue ::Clamby::ClamscanClientError
56
+ # This can happen e.g. if the clamdscan utility does not have access
57
+ # to read the file path. For debugging, try to run the clamdscan
58
+ # utility manually for the same file:
59
+ # clamdscan /path/to/file.pdf
60
+ #
61
+ # Also, make sure that the file uploads store directory is readable
62
+ # by the clamdscan utility. E.g. /path/to/app/public/uploads/tmp.
63
+ #
64
+ # Another possible reason is that in case there are too many
65
+ # concurrent virus checks ongoing, it may also trigger this error.
66
+ errors << :antivirus_client_error
67
+ rescue ::Clamby::FileNotFound
68
+ # This should be pretty rare since the scanner should not be even
69
+ # called when the file is not available. As the storage backend may
70
+ # be configured, this may still happen with some storage backends.
71
+ errors << :antivirus_file_not_found
72
72
  end
73
+ end
73
74
 
74
75
  # Make sure we are starting up with the default configuration.
75
76
  reset
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratonvirus-clamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-10 00:00:00.000000000 Z
11
+ date: 2020-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ratonvirus
14
+ name: clamby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.0
19
+ version: '1.6'
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: 0.1.0
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: clamby
28
+ name: ratonvirus
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: 0.2.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.6'
40
+ version: 0.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.3'
47
+ version: '13.0'
48
48
  type: :development
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: '12.3'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,42 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.16.0
75
+ version: 0.18.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.18.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.86.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.86.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.40'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: 0.16.0
110
+ version: '1.40'
83
111
  description: Provides ClamAV scanner backed by Clamby for the Ratonvirus gem.
84
112
  email:
85
113
  - antti.hukkanen@mainiotech.fi
@@ -87,9 +115,9 @@ executables: []
87
115
  extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
118
+ - CHANGELOG.md
90
119
  - LICENSE
91
120
  - README.md
92
- - Rakefile
93
121
  - lib/ratonvirus/clamby.rb
94
122
  - lib/ratonvirus/clamby/version.rb
95
123
  - lib/ratonvirus/scanner/clamby.rb
@@ -112,8 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
140
  - !ruby/object:Gem::Version
113
141
  version: '0'
114
142
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.7.7
143
+ rubygems_version: 3.0.3
117
144
  signing_key:
118
145
  specification_version: 4
119
146
  summary: Clamby scanner for Ratonvirus.
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rspec/core/rake_task'
4
-
5
- # Run all tests, with coverage report
6
- RSpec::Core::RakeTask.new(:coverage) do |t, task_args|
7
- ENV['CODECOV'] = '1'
8
- t.verbose = false
9
- end
10
-
11
- # Run all tests, include all
12
- RSpec::Core::RakeTask.new(:spec) do |t, task_args|
13
- t.verbose = false
14
- end
15
-
16
- # Run both by default
17
- task default: [:spec, :coverage]