rest-ftp-daemon 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +3 -3
- data/Gemfile.lock +20 -20
- data/lib/rest-ftp-daemon/entities/location.rb +1 -0
- data/lib/rest-ftp-daemon/exceptions.rb +2 -2
- data/lib/rest-ftp-daemon/job.rb +10 -9
- data/lib/rest-ftp-daemon/jobs/errors.rb +2 -1
- data/lib/rest-ftp-daemon/jobs/video.rb +7 -13
- data/lib/rest-ftp-daemon/location.rb +4 -3
- data/rest-ftp-daemon.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db11803efd6d48d4e7aff83543e9ff091e7a4d61
|
4
|
+
data.tar.gz: 1460828d4e7b088ac1324b89f6b72e128dc310f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89fd7fe8e10cb110b4ce02ca0f87e7fb47a2255fa18022e550da05fdaadebaf6a4d833715ce9fd1cff6ec5a30e21839e1ba297771c25930343c039085b43e883
|
7
|
+
data.tar.gz: 918633eac9d2fbe931de4b4ca41225ac08a8bf58a6b54eaf19d4e1bcbebb211c74ac9320902f88d5c256dbfdf8d4a597f34276d251afe565f69c7a06bafa8826
|
data/Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Docker headers
|
2
2
|
FROM ruby:2.3.0-slim
|
3
|
-
MAINTAINER Bruno MEDICI <
|
3
|
+
MAINTAINER Bruno MEDICI <rest-ftp-daemon@bmconseil.com>
|
4
4
|
|
5
5
|
|
6
6
|
# Environment
|
@@ -18,7 +18,7 @@ RUN gem install bundler --no-rdoc --no-ri
|
|
18
18
|
WORKDIR $INSTALL_PATH
|
19
19
|
ADD Gemfile $INSTALL_PATH
|
20
20
|
ADD Gemfile.lock $INSTALL_PATH
|
21
|
-
ADD
|
21
|
+
ADD rest-ftp-daemon.gemspec $INSTALL_PATH
|
22
22
|
RUN bundle install --system --without="development test" -j4
|
23
23
|
|
24
24
|
|
@@ -29,4 +29,4 @@ ADD . $INSTALL_PATH
|
|
29
29
|
|
30
30
|
# App run
|
31
31
|
EXPOSE 3000
|
32
|
-
CMD ["bin
|
32
|
+
CMD ["bin/rest-ftp-daemon", "-c", "/etc/rftpd.yml", "-f", "start"]
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rest-ftp-daemon (1.
|
4
|
+
rest-ftp-daemon (1.0.3)
|
5
5
|
activesupport (~> 4.2)
|
6
6
|
api-auth
|
7
7
|
aws-sdk-resources (~> 2)
|
8
|
-
bmc-daemon-lib (~> 0.
|
8
|
+
bmc-daemon-lib (~> 0.7)
|
9
9
|
double-bag-ftps
|
10
10
|
facter
|
11
11
|
get_process_mem
|
@@ -36,21 +36,21 @@ GEM
|
|
36
36
|
tzinfo (~> 1.1)
|
37
37
|
addressable (2.5.0)
|
38
38
|
public_suffix (~> 2.0, >= 2.0.2)
|
39
|
-
api-auth (2.0
|
39
|
+
api-auth (2.1.0)
|
40
40
|
ast (2.3.0)
|
41
|
-
aws-sdk-core (2.6.
|
41
|
+
aws-sdk-core (2.6.46)
|
42
42
|
aws-sigv4 (~> 1.0)
|
43
43
|
jmespath (~> 1.0)
|
44
|
-
aws-sdk-resources (2.6.
|
45
|
-
aws-sdk-core (= 2.6.
|
44
|
+
aws-sdk-resources (2.6.46)
|
45
|
+
aws-sdk-core (= 2.6.46)
|
46
46
|
aws-sigv4 (1.0.0)
|
47
47
|
axiom-types (0.1.1)
|
48
48
|
descendants_tracker (~> 0.0.4)
|
49
49
|
ice_nine (~> 0.11.0)
|
50
50
|
thread_safe (~> 0.3, >= 0.3.1)
|
51
|
-
bmc-daemon-lib (0.
|
51
|
+
bmc-daemon-lib (0.7.3)
|
52
52
|
chamber (~> 2.9.1)
|
53
|
-
builder (3.2.
|
53
|
+
builder (3.2.3)
|
54
54
|
chamber (2.9.1)
|
55
55
|
hashie (~> 3.3)
|
56
56
|
thor (~> 0.19.1)
|
@@ -70,9 +70,9 @@ GEM
|
|
70
70
|
eventmachine (1.2.1)
|
71
71
|
facter (2.4.6)
|
72
72
|
CFPropertyList (~> 2.2.6)
|
73
|
-
ffi (1.9.
|
73
|
+
ffi (1.9.17)
|
74
74
|
get_process_mem (0.2.1)
|
75
|
-
grape (0.
|
75
|
+
grape (0.19.1)
|
76
76
|
activesupport
|
77
77
|
builder
|
78
78
|
hashie (>= 2.1.0)
|
@@ -85,8 +85,8 @@ GEM
|
|
85
85
|
grape-entity (0.6.0)
|
86
86
|
activesupport
|
87
87
|
multi_json (>= 1.3.2)
|
88
|
-
grape-swagger (0.
|
89
|
-
grape (>= 0.
|
88
|
+
grape-swagger (0.26.0)
|
89
|
+
grape (>= 0.16.2)
|
90
90
|
grape-swagger-entity (0.1.5)
|
91
91
|
grape-entity
|
92
92
|
grape-swagger (>= 0.20.4)
|
@@ -108,7 +108,7 @@ GEM
|
|
108
108
|
i18n (0.7.0)
|
109
109
|
ice_nine (0.11.2)
|
110
110
|
jmespath (1.3.1)
|
111
|
-
json (1.8.
|
111
|
+
json (1.8.6)
|
112
112
|
method_source (0.8.2)
|
113
113
|
mime-types (2.99.3)
|
114
114
|
minitest (5.10.1)
|
@@ -120,7 +120,7 @@ GEM
|
|
120
120
|
mustermann (= 0.4.0)
|
121
121
|
net-sftp (2.1.2)
|
122
122
|
net-ssh (>= 2.6.5)
|
123
|
-
net-ssh (
|
123
|
+
net-ssh (4.0.1)
|
124
124
|
netrc (0.11.0)
|
125
125
|
newrelic_rpm (3.17.2.327)
|
126
126
|
parser (2.3.3.1)
|
@@ -130,11 +130,11 @@ GEM
|
|
130
130
|
coderay (~> 1.1.0)
|
131
131
|
method_source (~> 0.8.1)
|
132
132
|
slop (~> 3.4)
|
133
|
-
public_suffix (2.0.
|
133
|
+
public_suffix (2.0.5)
|
134
134
|
rack (2.0.1)
|
135
135
|
rack-accept (0.4.5)
|
136
136
|
rack (>= 0.4)
|
137
|
-
rainbow (2.1
|
137
|
+
rainbow (2.2.1)
|
138
138
|
rake (12.0.0)
|
139
139
|
representable (3.0.2)
|
140
140
|
declarative (~> 0.0.5)
|
@@ -143,7 +143,7 @@ GEM
|
|
143
143
|
http-cookie (>= 1.0.2, < 2.0)
|
144
144
|
mime-types (>= 1.16, < 3.0)
|
145
145
|
netrc (~> 0.7)
|
146
|
-
rollbar (2.
|
146
|
+
rollbar (2.14.0)
|
147
147
|
multi_json
|
148
148
|
rspec (3.5.0)
|
149
149
|
rspec-core (~> 3.5.0)
|
@@ -158,8 +158,8 @@ GEM
|
|
158
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
159
159
|
rspec-support (~> 3.5.0)
|
160
160
|
rspec-support (3.5.0)
|
161
|
-
rubocop (0.
|
162
|
-
parser (>= 2.3.
|
161
|
+
rubocop (0.47.0)
|
162
|
+
parser (>= 2.3.3.1, < 3.0)
|
163
163
|
powerpack (~> 0.1)
|
164
164
|
rainbow (>= 1.99.1, < 3.0)
|
165
165
|
ruby-progressbar (~> 1.7)
|
@@ -185,7 +185,7 @@ GEM
|
|
185
185
|
unf (0.1.4)
|
186
186
|
unf_ext
|
187
187
|
unf_ext (0.0.7.2)
|
188
|
-
unicode-display_width (1.1.
|
188
|
+
unicode-display_width (1.1.3)
|
189
189
|
virtus (1.0.5)
|
190
190
|
axiom-types (~> 0.1)
|
191
191
|
coercible (~> 1.0)
|
data/lib/rest-ftp-daemon/job.rb
CHANGED
@@ -304,14 +304,15 @@ module RestFtpDaemon
|
|
304
304
|
include_backtrace = true
|
305
305
|
end
|
306
306
|
|
307
|
-
# Log backtrace ?
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
307
|
+
# Log message and backtrace ?
|
308
|
+
log_error "OOPS: #{exception.class}", {
|
309
|
+
exception: exception.class.to_s,
|
310
|
+
message: exception.message,
|
311
|
+
error: error,
|
312
|
+
signal: signal,
|
313
|
+
}
|
314
|
+
log_debug "OOPS: backtrace below", exception.backtrace if include_backtrace
|
315
|
+
|
315
316
|
# Log to Rollbar
|
316
317
|
Rollbar.warning exception, "oops [#{error}]: #{exception.class.name}: #{exception.message}"
|
317
318
|
|
@@ -347,4 +348,4 @@ module RestFtpDaemon
|
|
347
348
|
add_transaction_tracer :initialize, category: :task
|
348
349
|
|
349
350
|
end
|
350
|
-
end
|
351
|
+
end
|
@@ -64,8 +64,9 @@ module RestFtpDaemon
|
|
64
64
|
s3_error: Aws::S3::Errors::ServiceError,
|
65
65
|
|
66
66
|
video_missing_binary: RestFtpDaemon::VideoMissingBinary,
|
67
|
+
video_not_found: RestFtpDaemon::VideoNotFound,
|
67
68
|
video_movie_error: RestFtpDaemon::VideoMovieError,
|
68
|
-
video_ffmpeg_error:
|
69
|
+
video_ffmpeg_error: FFMPEG::Error,
|
69
70
|
|
70
71
|
# rescue Encoding::UndefinedConversionError => exception
|
71
72
|
# return oops :ended, exception, "encoding_error", true
|
@@ -12,12 +12,12 @@ module RestFtpDaemon
|
|
12
12
|
|
13
13
|
# Process job
|
14
14
|
def do_before
|
15
|
-
log_info "JobVideo.before source_loc.
|
16
|
-
log_info "JobVideo.before target_loc.
|
15
|
+
log_info "JobVideo.before source_loc.filepath: #{@source_loc.filepath}"
|
16
|
+
log_info "JobVideo.before target_loc.filepath: #{@target_loc.filepath}"
|
17
17
|
|
18
18
|
# Ensure FFMPEG lib is available
|
19
|
-
check_ffmpeg_binary :ffmpeg_binary
|
20
19
|
check_ffmpeg_binary :ffprobe_binary
|
20
|
+
check_ffmpeg_binary :ffmpeg_binary
|
21
21
|
|
22
22
|
# Ensure source and target are FILE
|
23
23
|
raise RestFtpDaemon::AssertionFailed unless @video_options.is_a? Hash
|
@@ -35,7 +35,7 @@ module RestFtpDaemon
|
|
35
35
|
# Add the source file name if none found in the target path
|
36
36
|
target_final = @target_loc.clone
|
37
37
|
target_final.name = @source_loc.name unless target_final.name
|
38
|
-
log_info "JobVideo.work target_final.
|
38
|
+
log_info "JobVideo.work target_final.filepath [#{target_final.filepath}]"
|
39
39
|
|
40
40
|
# Ensure target directory exists
|
41
41
|
t_dir = @target_loc.filedir
|
@@ -60,7 +60,10 @@ module RestFtpDaemon
|
|
60
60
|
set_info INFO_SOURCE_CURRENT, source.name
|
61
61
|
begin
|
62
62
|
movie = FFMPEG::Movie.new(source.path)
|
63
|
+
rescue Errno::ENOENT => exception
|
64
|
+
raise RestFtpDaemon::VideoNotFound, exception.message
|
63
65
|
rescue StandardError => exception
|
66
|
+
log_error "FFMPEG Error [#{exception.class}] : #{exception.message}"
|
64
67
|
raise RestFtpDaemon::VideoMovieError, exception.message
|
65
68
|
else
|
66
69
|
set_info :ffmpeg_size, movie.size
|
@@ -117,12 +120,3 @@ module RestFtpDaemon
|
|
117
120
|
|
118
121
|
end
|
119
122
|
end
|
120
|
-
|
121
|
-
# require "stringio"
|
122
|
-
# def capture_stderr
|
123
|
-
# real_stderr, $stderr = $stderr, StringIO.new
|
124
|
-
# yield
|
125
|
-
# $stderr.string
|
126
|
-
# ensure
|
127
|
-
# $stderr = real_stderr
|
128
|
-
# end
|
@@ -60,13 +60,14 @@ module RestFtpDaemon
|
|
60
60
|
def path
|
61
61
|
File.join(@dir.to_s, name.to_s)
|
62
62
|
end
|
63
|
+
def filepath
|
64
|
+
# "/#{path}"
|
65
|
+
File.join('/', @dir.to_s, name.to_s)
|
66
|
+
end
|
63
67
|
|
64
68
|
def filedir
|
65
69
|
"/#{@dir}"
|
66
70
|
end
|
67
|
-
def filepath
|
68
|
-
"/#{path}"
|
69
|
-
end
|
70
71
|
|
71
72
|
def local_files
|
72
73
|
Dir.glob("/#{path}").collect do |file|
|
data/rest-ftp-daemon.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
|
4
4
|
# Project version
|
5
|
-
spec.version = "1.0.
|
5
|
+
spec.version = "1.0.3"
|
6
6
|
|
7
7
|
# Project description
|
8
8
|
spec.name = "rest-ftp-daemon"
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "ruby-prof"
|
33
33
|
|
34
34
|
# Runtime dependencies
|
35
|
-
spec.add_runtime_dependency "bmc-daemon-lib", "~> 0.
|
35
|
+
spec.add_runtime_dependency "bmc-daemon-lib", "~> 0.7"
|
36
36
|
spec.add_runtime_dependency "json", "~> 1.8"
|
37
37
|
spec.add_runtime_dependency "thin", "~> 1.7"
|
38
38
|
spec.add_runtime_dependency "activesupport", "~> 4.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-ftp-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: '0.7'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: '0.7'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: json
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|