rest-ftp-daemon 0.240.2 → 0.241

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: 01c63d539e5f607adb376390b85cb2a9a9a43b8f
4
- data.tar.gz: 643d5714d2347e85de8d097dc10d17df9939b9fc
3
+ metadata.gz: 17f4eefbc675627b89a5d71dc78253b53077d0b9
4
+ data.tar.gz: b5df884a47a2204cc87a9ceb05ba4bfccb35a44b
5
5
  SHA512:
6
- metadata.gz: 19cf92b19a08f61c88a3d09bb8262dbc7506c609567cc1bcc9cff2908d28b97eb1c0f1e6299a8a713c099c127dd69d4fced5a7d82fdb5a0ded174838af8aeef4
7
- data.tar.gz: a462495c65b96be3d3798734a7bb6bd4413f81a110868318e671b0531485964fd4231177bbbca3ac94f6524d007ad2077f3238bab2639015f50812d933c85d3d
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.240.2)
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.4)
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.0)
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.0.299)
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.1)
126
- ffi (>= 1.0.0)
127
- thin (1.6.3)
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(:debug, :newrelic) : "no"}"
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
- ####### DASHBOARD - GET /
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
- ####### GET /jobs/:id
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
- ####### GET /jobs/
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
- ####### POST /jobs/
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
- log_info "POST /jobs", params
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
- ####### GET /routes
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 "show application routes"
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
- ####### GET /status
60
+ ####### SHOW STATUS
58
61
 
59
- # Server global status
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
- ####### GET /config
82
+ ####### SHOW CONFIG
82
83
 
83
- # Server config
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.240.2"
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 = 512
92
+ DEFAULT_FTP_CHUNK = 1024
93
93
  DEFAULT_PAGE_SIZE = 40
94
94
  DEFAULT_WORKERS = 1
95
95
 
@@ -125,7 +125,11 @@ module RestFtpDaemon
125
125
  out << "#{seconds}s"
126
126
 
127
127
  out.join(' ')
128
- end
128
+ end
129
+
130
+ def self.dashboard_job_link job
131
+ "/jobs/#{job.id}" if job.respond_to? :id
132
+ end
129
133
 
130
134
  end
131
135
  end
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  !!! 5
2
3
  %html{:lang => "en"}
3
4
  %head
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  %h2 Counters
2
3
 
3
4
  %table.table.table-striped.table-hover.table-condensed
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  - trans = $queue.counter_get :transferred
2
3
  - info_procs = (Facter.value :processorcount).to_i
3
4
 
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  - trans = $queue.counter_get :transferred
2
3
  - info_procs = (Facter.value :processorcount).to_i
3
4
  - info_load = Sys::CPU.load_avg.first.to_f
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  - counts_by_status = $queue.counts_by_status
2
3
  - counts_all = $queue.jobs_count
3
4
  - jobs = @paginate.subset
@@ -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
- %b= job.id
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
 
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  %h2 Endpoint tokens
2
3
 
3
4
  %table.table.table-striped.table-hover.table-condensed
@@ -1,3 +1,4 @@
1
+ -# coding: utf-8
1
2
  %h2 Workers
2
3
 
3
4
  %table.table.table-striped.table-hover.table-condensed
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.240.2
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-04 00:00:00.000000000 Z
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.2.2
348
+ rubygems_version: 2.4.8
349
349
  signing_key:
350
350
  specification_version: 4
351
351
  summary: RESTful FTP client daemon