rest-ftp-daemon 0.240.2 → 0.241
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/bin/rest-ftp-daemon +4 -3
- data/lib/rest-ftp-daemon/api/dashboard.rb +7 -7
- data/lib/rest-ftp-daemon/api/jobs.rb +11 -16
- data/lib/rest-ftp-daemon/api/root.rb +16 -16
- data/lib/rest-ftp-daemon/constants.rb +2 -2
- data/lib/rest-ftp-daemon/helpers.rb +5 -1
- data/lib/rest-ftp-daemon/views/dashboard.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_counters.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_footer.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_header.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_jobs.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_table.haml +8 -1
- data/lib/rest-ftp-daemon/views/dashboard_tokens.haml +1 -0
- data/lib/rest-ftp-daemon/views/dashboard_workers.haml +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17f4eefbc675627b89a5d71dc78253b53077d0b9
|
4
|
+
data.tar.gz: b5df884a47a2204cc87a9ceb05ba4bfccb35a44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ae88ce58e703b530929940f11b87dfa30468727fcc156ae62ac88499f10d5a62ad2c3874a9b85b220ade47ee4a0d3ef4030fc4fd85a06394fd69ce3414315e
|
7
|
+
data.tar.gz: 74df9fd3193fe8326af484e2e4a839c63fed6ae64d8c1a4e0ec456ebba65999446424c455544365a2013af4ccecf484667cd6a6764d2b58136edb9f009909b73
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rest-ftp-daemon (0.
|
4
|
+
rest-ftp-daemon (0.241)
|
5
5
|
double-bag-ftps
|
6
6
|
facter
|
7
7
|
get_process_mem
|
@@ -66,7 +66,7 @@ GEM
|
|
66
66
|
haml (4.0.7)
|
67
67
|
tilt
|
68
68
|
hashie (3.4.2)
|
69
|
-
http (0.9.
|
69
|
+
http (0.9.7)
|
70
70
|
addressable (~> 2.3)
|
71
71
|
http-cookie (~> 1.0)
|
72
72
|
http-form_data (~> 1.0.1)
|
@@ -79,13 +79,13 @@ GEM
|
|
79
79
|
ice_nine (0.11.1)
|
80
80
|
json (1.8.3)
|
81
81
|
method_source (0.8.2)
|
82
|
-
minitest (5.8.
|
82
|
+
minitest (5.8.1)
|
83
83
|
multi_json (1.11.2)
|
84
84
|
multi_xml (0.5.5)
|
85
85
|
net-sftp (2.1.2)
|
86
86
|
net-ssh (>= 2.6.5)
|
87
87
|
net-ssh (2.9.2)
|
88
|
-
newrelic_rpm (3.13.
|
88
|
+
newrelic_rpm (3.13.1.300)
|
89
89
|
parser (2.2.2.6)
|
90
90
|
ast (>= 1.1, < 3.0)
|
91
91
|
powerpack (0.1.1)
|
@@ -122,11 +122,11 @@ GEM
|
|
122
122
|
ruby-progressbar (1.7.5)
|
123
123
|
settingslogic (2.0.9)
|
124
124
|
slop (3.6.0)
|
125
|
-
sys-cpu (0.7.
|
126
|
-
ffi
|
127
|
-
thin (1.6.
|
125
|
+
sys-cpu (0.7.2)
|
126
|
+
ffi
|
127
|
+
thin (1.6.4)
|
128
128
|
daemons (~> 1.0, >= 1.0.9)
|
129
|
-
eventmachine (~> 1.0)
|
129
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
130
130
|
rack (~> 1.0)
|
131
131
|
thread_safe (0.3.5)
|
132
132
|
tilt (2.0.1)
|
data/bin/rest-ftp-daemon
CHANGED
@@ -92,13 +92,11 @@ end
|
|
92
92
|
|
93
93
|
|
94
94
|
# ARGV: build final
|
95
|
-
thin_logs = Settings.at(:logs, :thin)
|
96
95
|
argv = []
|
97
96
|
argv << ["-e", Settings.namespace]
|
98
97
|
argv << ["-p", Settings.port.to_s] if Settings.port
|
99
98
|
argv << ["--pid", Settings.pidfile]
|
100
99
|
argv << ["--tag", "'#{APP_NAME}/#{Settings.namespace}'"]
|
101
|
-
argv << ["--log", thin_logs] unless !thin_logs
|
102
100
|
argv << ["--daemonize"] if [1, true].include? Settings.daemonize
|
103
101
|
|
104
102
|
|
@@ -122,7 +120,8 @@ puts "Host \t #{Settings.host}"
|
|
122
120
|
puts "Namespace \t #{Settings.namespace}"
|
123
121
|
puts "Network port \t #{Settings.port}"
|
124
122
|
puts "User:group \t #{Settings.user}:#{Settings.group}" if (Settings.user || Settings.group)
|
125
|
-
puts "Newrelic \t #{Settings.newrelic_enabled? ? Settings.at(:
|
123
|
+
puts "Newrelic \t #{Settings.newrelic_enabled? ? Settings.at(:newrelic, :licence) : "no"}"
|
124
|
+
puts "Started at \t #{APP_STARTED.to_s}"
|
126
125
|
# puts Settings.dump
|
127
126
|
puts
|
128
127
|
puts "--- Thin ARGV"
|
@@ -140,6 +139,8 @@ rescue Thin::PidFileExist
|
|
140
139
|
puts "FAILED: daemon was already running (Thin::PidFileExist)"
|
141
140
|
rescue Thin::PidFileNotFound
|
142
141
|
puts "FAILED: daemon was not running (Thin::PidFileNotFound)"
|
142
|
+
rescue Errno::ENOENT => e
|
143
|
+
puts "FAILED: daemon cannot access files: #{e.message}"
|
143
144
|
rescue SystemExit
|
144
145
|
# Leave some time for the daemon to launch
|
145
146
|
pidfile = Settings.pidfile
|
@@ -10,26 +10,26 @@ module RestFtpDaemon
|
|
10
10
|
####### HELPERS
|
11
11
|
|
12
12
|
helpers do
|
13
|
-
|
14
13
|
def logger
|
15
14
|
Root.logger
|
16
15
|
end
|
17
|
-
|
18
16
|
def render name, values={}
|
19
17
|
template = File.read("#{APP_LIBS}/views/#{name}.haml")
|
20
18
|
haml_engine = Haml::Engine.new(template)
|
21
19
|
haml_engine.render(binding, values)
|
22
20
|
end
|
23
|
-
|
24
21
|
end
|
25
22
|
|
26
23
|
|
27
|
-
#######
|
24
|
+
####### Common request logging
|
25
|
+
before do
|
26
|
+
log_info "HTTP #{request.request_method} #{request.fullpath}", params
|
27
|
+
end
|
28
28
|
|
29
|
-
# Server global status
|
30
|
-
get "/" do
|
31
|
-
log_info "GET /"
|
32
29
|
|
30
|
+
####### DASHBOARD
|
31
|
+
|
32
|
+
get "/" do
|
33
33
|
# Initialize Facter
|
34
34
|
Facter.loadfacts
|
35
35
|
|
@@ -7,22 +7,25 @@ module RestFtpDaemon
|
|
7
7
|
####### HELPERS
|
8
8
|
|
9
9
|
helpers do
|
10
|
-
|
11
10
|
def logger
|
12
11
|
Root.logger
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
16
14
|
|
17
15
|
|
18
|
-
#######
|
16
|
+
####### Common request logging
|
17
|
+
before do
|
18
|
+
log_info "HTTP #{request.request_method} #{request.fullpath}", params
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
####### READ ONE JOB
|
19
23
|
|
24
|
+
desc "Read job with ID"
|
20
25
|
params do
|
21
26
|
requires :id, type: String, desc: "ID of the Job to read", regexp: /[^\/]+/
|
22
27
|
end
|
23
28
|
get "/*id" do
|
24
|
-
log_info "GET /jobs/#{params[:id]}"
|
25
|
-
|
26
29
|
begin
|
27
30
|
# Get job to display
|
28
31
|
raise RestFtpDaemon::JobNotFound if params[:id].nil?
|
@@ -45,13 +48,10 @@ module RestFtpDaemon
|
|
45
48
|
end
|
46
49
|
|
47
50
|
|
48
|
-
#######
|
51
|
+
####### READ ALL JOBS
|
49
52
|
|
50
53
|
desc "List all Jobs"
|
51
|
-
|
52
54
|
get "/" do
|
53
|
-
log_info "GET /jobs"
|
54
|
-
|
55
55
|
begin
|
56
56
|
# Get jobs to display
|
57
57
|
jobs = $queue.jobs
|
@@ -68,10 +68,9 @@ module RestFtpDaemon
|
|
68
68
|
end
|
69
69
|
|
70
70
|
|
71
|
-
#######
|
71
|
+
####### CREATE A JOB
|
72
72
|
|
73
73
|
desc "Create a new job"
|
74
|
-
|
75
74
|
params do
|
76
75
|
requires :source, type: String, desc: "Source file pattern"
|
77
76
|
requires :target, type: String, desc: "Target remote path"
|
@@ -91,13 +90,9 @@ module RestFtpDaemon
|
|
91
90
|
desc: "Upload to a temp file before renaming it to the target filename",
|
92
91
|
default: Settings.at(:transfer, :tempfile)
|
93
92
|
end
|
94
|
-
|
95
93
|
post "/" do
|
96
|
-
|
97
|
-
log_debug params.to_json
|
98
|
-
|
94
|
+
# log_debug params.to_json
|
99
95
|
begin
|
100
|
-
|
101
96
|
# Create a new job
|
102
97
|
job_id = $queue.generate_id
|
103
98
|
job = Job.new(job_id, params)
|
@@ -36,31 +36,32 @@ module RestFtpDaemon
|
|
36
36
|
####### HELPERS
|
37
37
|
|
38
38
|
helpers do
|
39
|
-
|
40
39
|
def logger
|
41
40
|
Root.logger
|
42
41
|
end
|
43
|
-
|
44
42
|
end
|
45
43
|
|
46
44
|
|
47
|
-
#######
|
45
|
+
####### Common request logging
|
46
|
+
before do
|
47
|
+
log_info "HTTP #{request.request_method} #{request.fullpath}", params
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
####### SHOW ROUTES
|
48
52
|
|
49
|
-
desc "
|
53
|
+
desc "Show application routes"
|
50
54
|
get "/routes" do
|
51
|
-
log_info "GET /routes"
|
52
55
|
status 200
|
53
56
|
return RestFtpDaemon::API::Root.routes
|
54
57
|
end
|
55
58
|
|
56
59
|
|
57
|
-
#######
|
60
|
+
####### SHOW STATUS
|
58
61
|
|
59
|
-
|
62
|
+
desc "Show daemon status"
|
60
63
|
get "/status" do
|
61
|
-
log_info "GET /status"
|
62
64
|
mem = GetProcessMem.new
|
63
|
-
|
64
65
|
status 200
|
65
66
|
return {
|
66
67
|
hostname: `hostname`.to_s.chomp,
|
@@ -78,20 +79,19 @@ module RestFtpDaemon
|
|
78
79
|
end
|
79
80
|
|
80
81
|
|
81
|
-
#######
|
82
|
+
####### SHOW CONFIG
|
82
83
|
|
83
|
-
|
84
|
+
desc "Show daemon config"
|
84
85
|
get "/config" do
|
85
|
-
log_info "GET /config"
|
86
|
-
|
87
86
|
status 200
|
88
87
|
return Helpers.get_censored_config
|
89
88
|
end
|
90
89
|
|
91
|
-
# Server config
|
92
|
-
post "/config/reload" do
|
93
|
-
log_info "POST /config/reload"
|
94
90
|
|
91
|
+
####### RELOAD CONFIG
|
92
|
+
|
93
|
+
desc "Reload daemon config"
|
94
|
+
post "/config/reload" do
|
95
95
|
if Settings.at(:debug, :allow_reload)==true
|
96
96
|
Settings.reload!
|
97
97
|
status 200
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Terrific constants
|
2
2
|
APP_NAME = "rest-ftp-daemon"
|
3
3
|
APP_NICK = "rftpd"
|
4
|
-
APP_VER = "0.
|
4
|
+
APP_VER = "0.241"
|
5
5
|
|
6
6
|
# Provide default config file information
|
7
7
|
APP_LIB = File.expand_path File.dirname(__FILE__)
|
@@ -89,7 +89,7 @@ DASHBOARD_WORKER_STYLES = {
|
|
89
89
|
|
90
90
|
# Configuration defaults
|
91
91
|
DEFAULT_WORKER_TIMEOUT = 3600
|
92
|
-
DEFAULT_FTP_CHUNK =
|
92
|
+
DEFAULT_FTP_CHUNK = 1024
|
93
93
|
DEFAULT_PAGE_SIZE = 40
|
94
94
|
DEFAULT_WORKERS = 1
|
95
95
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
-# coding: utf-8
|
1
2
|
- jobs.each do |job|
|
2
3
|
- progress = job.get :progress
|
3
4
|
- source_count = job.get(:source_count) || 0
|
@@ -12,7 +13,13 @@
|
|
12
13
|
|
13
14
|
%tr{class: trclass.to_s}
|
14
15
|
%td
|
15
|
-
|
16
|
+
|
17
|
+
|
18
|
+
%a{href: Helpers.dashboard_job_link(job)}
|
19
|
+
%b= job.id
|
20
|
+
|
21
|
+
|
22
|
+
|
16
23
|
|
17
24
|
%td= job.label
|
18
25
|
|
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: 0.
|
4
|
+
version: '0.241'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -345,7 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
347
|
rubyforge_project:
|
348
|
-
rubygems_version: 2.
|
348
|
+
rubygems_version: 2.4.8
|
349
349
|
signing_key:
|
350
350
|
specification_version: 4
|
351
351
|
summary: RESTful FTP client daemon
|