rest-ftp-daemon 0.300.3 → 0.302.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
  SHA1:
3
- metadata.gz: 261bf46659b553d4503748d18c088522f198dcbd
4
- data.tar.gz: e38b90ee56450265d1967fe95b1992af9ac6e483
3
+ metadata.gz: 7a1b9e5ed6fac0ec90833a3fbb68442a4a780acf
4
+ data.tar.gz: c87259dbeb55f4ec01bdd252d7e0141938b58941
5
5
  SHA512:
6
- metadata.gz: eb73ad80937ab57466428b78fd2af4351e43df7e801fcedbfbf1fcaa0a7c331cdfdf4034946de81bd0498e3e701bcd00817a5f538ddb5140600ac6518996ed86
7
- data.tar.gz: 942a05aa3d4f0883e6905e9d3ebb5c860a9c908ba99fb35bc22125cbe101fe2d55e7a4682e13763ae91f81c6dfda54da239cc22a45c0ff1b21345321faeb1f72
6
+ metadata.gz: 309ccbf778b739bf66c2b2008c659865fe80e6a56400b6713c77f846aa6c121c6ad760fa54c7af2db67ad745708be02337cd10a92ef593ca95580b8ad5f5282b
7
+ data.tar.gz: 12140ba5f1314819d8a0638af66b91ca4c0aac8752885a40b9a0b387574f3d986ce62e51767a03c4ed9336c1f31f5406626654b3ca4dff24389643f60564232c
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.300.3)
4
+ rest-ftp-daemon (0.302.0)
5
+ api-auth
5
6
  chamber
6
7
  double-bag-ftps
7
8
  facter
@@ -12,6 +13,7 @@ PATH
12
13
  json
13
14
  net-sftp
14
15
  newrelic_rpm
16
+ rest-client (~> 1.8)
15
17
  settingslogic
16
18
  sys-cpu
17
19
  thin (~> 1)
@@ -26,7 +28,7 @@ GEM
26
28
  minitest (~> 5.1)
27
29
  thread_safe (~> 0.3, >= 0.3.4)
28
30
  tzinfo (~> 1.1)
29
- addressable (2.4.0)
31
+ api-auth (2.0.0)
30
32
  ast (2.3.0)
31
33
  astrolabe (1.3.1)
32
34
  parser (~> 2.2)
@@ -71,19 +73,13 @@ GEM
71
73
  haml (4.0.7)
72
74
  tilt
73
75
  hashie (3.4.4)
74
- http (2.0.1)
75
- addressable (~> 2.3)
76
- http-cookie (~> 1.0)
77
- http-form_data (~> 1.0.1)
78
- http_parser.rb (~> 0.6.0)
79
76
  http-cookie (1.0.2)
80
77
  domain_name (~> 0.5)
81
- http-form_data (1.0.1)
82
- http_parser.rb (0.6.0)
83
78
  i18n (0.7.0)
84
79
  ice_nine (0.11.2)
85
80
  json (1.8.3)
86
81
  method_source (0.8.2)
82
+ mime-types (2.99.2)
87
83
  minitest (5.9.0)
88
84
  multi_json (1.12.1)
89
85
  multi_xml (0.5.5)
@@ -92,7 +88,8 @@ GEM
92
88
  net-sftp (2.1.2)
93
89
  net-ssh (>= 2.6.5)
94
90
  net-ssh (3.2.0)
95
- newrelic_rpm (3.15.2.317)
91
+ netrc (0.11.0)
92
+ newrelic_rpm (3.16.0.318)
96
93
  parser (2.3.1.2)
97
94
  ast (~> 2.2)
98
95
  powerpack (0.1.1)
@@ -100,11 +97,15 @@ GEM
100
97
  coderay (~> 1.1.0)
101
98
  method_source (~> 0.8.1)
102
99
  slop (~> 3.4)
103
- rack (1.6.4)
100
+ rack (2.0.1)
104
101
  rack-accept (0.4.5)
105
102
  rack (>= 0.4)
106
103
  rainbow (2.1.0)
107
104
  rake (11.2.2)
105
+ rest-client (1.8.0)
106
+ http-cookie (>= 1.0.2, < 2.0)
107
+ mime-types (>= 1.16, < 3.0)
108
+ netrc (~> 0.7)
108
109
  rspec (3.4.0)
109
110
  rspec-core (~> 3.4.0)
110
111
  rspec-expectations (~> 3.4.0)
@@ -152,7 +153,6 @@ PLATFORMS
152
153
 
153
154
  DEPENDENCIES
154
155
  bundler (~> 1.6)
155
- http
156
156
  pry
157
157
  rake
158
158
  rest-ftp-daemon!
data/README.md CHANGED
@@ -234,17 +234,21 @@ This project is available as a rubygem, requires Ruby 2.2 and RubyGems installed
234
234
  #### Using rbenv and ruby-build
235
235
 
236
236
  You may use `rbenv` and `ruby-build` to get the right Ruby version. If this is your case, ensure that ruby-build definitions are up-to-date and include the right Ruby version.
237
+ You may have to install some extra packages for the compilations to complete.
237
238
 
238
239
  ```
240
+ # apt-get install libffi-dev zlib1g-dev bison libreadline-dev
239
241
  # git clone https://github.com/rbenv/rbenv.git ~/.rbenv
240
242
  # git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
241
243
  # echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
242
244
  # echo 'eval "$(rbenv init -)"' >> ~/.bashrc
243
- # ruby-build --definitions | grep '2.2'
245
+ # rbenv install --list | grep '2.2'
244
246
  ```
245
247
 
246
- Otherwise, you way have to update ruby-build to include Ruby 2.3.0 definitions.
247
- On Debian, 2.3.0 is not included in Wheezy and appears in Jessie's version of the package.
248
+ # curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3
249
+
250
+ Otherwise, you way have to update ruby-build to include Ruby 2.2 definitions.
251
+ On Debian, 2.2 is not included in Wheezy and appears in Jessie's version of the package.
248
252
 
249
253
  #### Dedicated user
250
254
 
@@ -289,6 +293,11 @@ gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/
289
293
  bundle install
290
294
  ```
291
295
 
296
+ * If you get ```uncommon.mk:189: recipe for target 'build-ext' failed``` on Debian, you can try with:
297
+ ```
298
+ curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3
299
+ ```
300
+
292
301
 
293
302
  Contributing
294
303
  ------------------------------------------------------------------------------------
data/bin/rest-ftp-daemon CHANGED
@@ -29,7 +29,6 @@ begin
29
29
  Conf.init File.dirname(__FILE__) + "/../"
30
30
 
31
31
  # Parse options and check compliance
32
- thinopts = {}
33
32
  parser = OptionParser.new do |opts|
34
33
  opts.banner = "Usage: #{File.basename $PROGRAM_NAME} [options] start|stop"
35
34
  opts.on("-c", "--config CONFIGFILE") { |value| cmd_config = File.expand_path(value)}
@@ -45,12 +44,13 @@ begin
45
44
  opts.separator ""
46
45
  opts.on_tail("-h", "--help", "Show this message") do
47
46
  puts opts
48
- puts Conf.gen_config_message unless File.exist?(Conf.gen_config_etc)
47
+ puts Conf.generate(:config_message) unless File.exist?(Conf.generate(:config_etc))
49
48
  exit
50
49
  end
51
50
  opts.on_tail("-v", "--version", "Show version (#{Conf.app_ver})") { puts(Conf.app_ver) && exit }
52
51
 
53
- end.order!(ARGV)
52
+ end
53
+ parser.order!(ARGV)
54
54
 
55
55
  # Load Chamber-based configuration
56
56
  Conf.prepare config: cmd_config, logfile: nil
@@ -69,6 +69,15 @@ else
69
69
  end
70
70
 
71
71
 
72
+ # Thin: override with cmdline then defaults
73
+ Conf[:daemonize] = cmd_daemonize unless cmd_daemonize.nil?
74
+ Conf[:port] = cmd_port unless cmd_port.nil?
75
+ Conf[:user] = cmd_user unless cmd_user.nil?
76
+ Conf[:group] = cmd_group unless cmd_group.nil?
77
+ Conf[:pidfile] = cmd_pidfile unless cmd_pidfile.nil?
78
+ Conf[:pidfile] ||= Conf.generate(:pidfile)
79
+
80
+
72
81
  # Validate network configuration
73
82
  if command == "start"
74
83
  if !Conf[:port]
@@ -79,23 +88,13 @@ if command == "start"
79
88
  end
80
89
 
81
90
 
82
- # Thin: override with cmdline then defaults
83
- Conf[:daemonize] = cmd_daemonize unless cmd_daemonize.nil?
84
- Conf[:port] = cmd_port unless cmd_port.nil?
85
- Conf[:user] = cmd_user unless cmd_user.nil?
86
- Conf[:group] = cmd_group unless cmd_group.nil?
87
- Conf[:pidfile] = cmd_pidfile unless cmd_pidfile.nil?
88
-
89
- Conf[:pidfile] ||= Conf.gen_pidfile
90
-
91
-
92
91
  # Thin: basic options
93
92
  thin_logfile = Conf.at(:logs, :thin)
94
93
  argv = []
95
94
  argv << ["-e", Conf.app_env]
96
95
  argv << ["-p", Conf[:port].to_s]
97
96
  argv << ["--pid", Conf[:pidfile].to_s]
98
- argv << ["--tag", "#{Conf.app_name}/#{Conf.app_env}"]
97
+ argv << ["--tag", Conf.generate(:process_name)]
99
98
  argv << ["--daemonize"] if ([1, true].include? Conf[:daemonize])
100
99
  argv << ["--log", thin_logfile] if thin_logfile
101
100
 
@@ -120,7 +119,7 @@ puts
120
119
  puts "Daemonize \t #{Conf[:daemonize]}"
121
120
  puts "Network port \t #{Conf[:port]}"
122
121
  puts "User:group \t #{Conf[:user]}:#{Conf[:group]}" if Conf[:user] && Conf[:group]
123
- puts "Newrelic \t #{Conf.newrelic_enabled? ? Conf.at(:newrelic, :licence) : "no"}"
122
+ puts "Newrelic \t #{Conf.newrelic_enabled? ? Conf.at(:newrelic, :licence) : 'no'}"
124
123
  puts "PID file \t #{Conf[:pidfile]}"
125
124
  puts
126
125
  puts Conf.dump
data/config.ru CHANGED
@@ -1,5 +1,6 @@
1
1
  # Load gem files
2
- load_path_libs = File.expand_path(File.join(File.dirname(__FILE__), "lib"))
2
+ # load_path_libs = File.expand_path(File.join(File.dirname(__FILE__), "lib"))
3
+ load_path_libs = File.expand_path "lib", File.dirname(__FILE__)
3
4
  $LOAD_PATH.unshift(load_path_libs) unless $LOAD_PATH.include?(load_path_libs)
4
5
  require "rest-ftp-daemon"
5
6
 
@@ -19,9 +20,6 @@ unless Conf[:adminpwd].nil?
19
20
  end
20
21
  end
21
22
 
22
- # NewRelic profiling
23
- # GC::Profiler.enable if Conf.newrelic_enabled?
24
-
25
23
  # Serve static assets
26
24
  use Rack::Static, urls: ["/css", "/js", "/images"], root: "#{Conf.app_libs}/static/"
27
25
 
@@ -31,9 +29,5 @@ unless Conf.app_env == "production"
31
29
  # use Rack::MiniProfiler
32
30
  end
33
31
 
34
- # Set up encodings
35
- Encoding.default_internal = "utf-8"
36
- Encoding.default_external = "utf-8"
37
-
38
32
  # Launch the main daemon
39
33
  run RestFtpDaemon::API::Root
data/defaults.yml CHANGED
@@ -1,61 +1,85 @@
1
- daemonize: true
2
- port: 3000
3
- nick: rftpd
4
- user: rftpd
5
- # group: rftpd
6
- # host: "myhost"
7
-
8
- pools:
9
- default: 2
10
-
11
- transfer:
12
- # notify_after_sec: 5 # wait at least X seconds between HTTP notifications
13
- # mkdir: true # build directory tree if missing
14
- # tempfile: true # transfer to temporary file, rename after sucessful transfer
15
- # overwrite: false # overwrite any target file with the same name
16
- timeout: 1800 # jobs running for longer than X seconds will be killed
17
-
18
- retry:
19
- # on_errors:
20
- # - ftp_perm_error
21
- # - net_temp_error
22
- # - conn_reset_by_peer
23
- # - conn_timed_out
24
- # - conn_refused
25
- # - sftp_auth_failed
26
- # - conn_host_is_down
27
- # - conn_unreachable
28
- # - conn_failed
29
- # - conn_openssl_error
30
- # max_runs: 5
31
- # max_age: 1800
32
- # delay: 10
33
-
34
- conchita:
35
- # timer: 60
36
- # garbage_collector: true
37
- # clean_failed: 3600
38
- # clean_finished: 3600
39
- # clean_queued: 86400
40
-
41
- newrelic:
42
- # licence: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
43
- prefix: "rftpd" # app prefix
44
- # platform: "bigbusiness" # app platform name
45
- # app_name: "rftpd-bigbusiness-dev" # nickname used for naming app
46
-
47
- debug:
48
- ftp: false
49
- sftp: false
50
- conchita: false
51
- reporter: fakse
1
+ defaults: &defaults
2
+ daemonize: true
3
+ port: 3000
4
+ user: rftpd
5
+ # group: rftpd
6
+ # host: "myhost"
52
7
  allow_reload: false
53
8
 
54
- logs:
55
- thin: "/var/log/rftpd-environment-thin.log"
56
- queue: "/var/log/rftpd-environment-core.log"
57
- api: "/var/log/rftpd-environment-core.log"
58
- workers: "/var/log/rftpd-environment-work.log"
59
- jobs: "/var/log/rftpd-environment-work.log"
60
- notify: "/var/log/rftpd-environment-work.log"
61
- newrelic: "/var/log/rftpd-environment-newrelic.log"
9
+ pools:
10
+ default: 2
11
+ urgent: 1
12
+
13
+ reporter:
14
+ debug: false
15
+ timer: 10
16
+ debug: false
17
+
18
+ conchita:
19
+ debug: false
20
+ timer: 60
21
+ garbage_collector: true
22
+ clean_failed: 3600
23
+ clean_finished: 3600
24
+ clean_queued: 86400
25
+
26
+ transfer:
27
+ debug: false
28
+ mkdir: true # build directory tree if missing
29
+ tempfile: true # transfer to temporary file, rename after sucessful transfer
30
+ overwrite: false # overwrite any target file with the same name
31
+ timeout: 1800 # jobs running for longer than X seconds will be killed
32
+ notify_after: 5 # wait at least X seconds between HTTP notifications
33
+
34
+ debug_ftp: false
35
+ debug_sftp: false
36
+
37
+ retry_on:
38
+ - ftp_perm_error
39
+ - net_temp_error
40
+ - conn_reset_by_peer
41
+ - conn_timed_out
42
+ - conn_refused
43
+ - sftp_auth_failed
44
+ - conn_host_is_down
45
+ - conn_unreachable
46
+ - conn_failed
47
+ - conn_openssl_error
48
+ retry_max: 5
49
+ retry_for: 1800
50
+ retry_after: 10
51
+
52
+ newrelic:
53
+ # licence: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
54
+ prefix: "rftpd" # app prefix
55
+ # platform: "bigbusiness" # app platform name
56
+ # app_name: "rftpd-bigbusiness-dev" # nickname used for naming app
57
+
58
+ logs:
59
+ path: "/var/log/"
60
+
61
+ thin: "rftpd-environment-thin.log"
62
+ newrelic: "rftpd-environment-newrelic.log"
63
+ queue: "rftpd-environment-core.log"
64
+ api: "rftpd-environment-core.log"
65
+ workers: "rftpd-environment-core.log"
66
+
67
+ transfer: "rftpd-environment-workers.log"
68
+ conchita: "rftpd-environment-workers.log"
69
+ reporter: "rftpd-environment-workers.log"
70
+ notify: "rftpd-environment-workers.log"
71
+
72
+ test:
73
+ <<: *defaults
74
+
75
+ development:
76
+ <<: *defaults
77
+ port: 3100
78
+
79
+ pre-production:
80
+ <<: *defaults
81
+ port: 3200
82
+
83
+ production:
84
+ <<: *defaults
85
+ port: 3300
@@ -6,11 +6,7 @@ require "haml"
6
6
  require "uri"
7
7
  require "timeout"
8
8
  require "syslog"
9
- require "net/http"
10
9
  require "thread"
11
- require "singleton"
12
- require "grape"
13
- require "grape-entity"
14
10
  require "newrelic_rpm"
15
11
 
16
12
 
@@ -18,6 +14,7 @@ require "newrelic_rpm"
18
14
  require_relative "shared/logger_formatter"
19
15
  require_relative "shared/logger_helper"
20
16
  require_relative "shared/conf"
17
+ require_relative "shared/worker_base"
21
18
 
22
19
 
23
20
  # Project's libs
@@ -31,11 +28,10 @@ require_relative "rest-ftp-daemon/paginate"
31
28
  require_relative "rest-ftp-daemon/uri"
32
29
  require_relative "rest-ftp-daemon/job_queue"
33
30
  require_relative "rest-ftp-daemon/counters"
34
- require_relative "rest-ftp-daemon/worker"
35
- require_relative "rest-ftp-daemon/worker_conchita"
36
- require_relative "rest-ftp-daemon/worker_reporter"
37
- require_relative "rest-ftp-daemon/worker_job"
38
31
  require_relative "rest-ftp-daemon/worker_pool"
32
+ require_relative "rest-ftp-daemon/workers/conchita"
33
+ require_relative "rest-ftp-daemon/workers/reporter"
34
+ require_relative "rest-ftp-daemon/workers/transfer"
39
35
  require_relative "rest-ftp-daemon/job"
40
36
  require_relative "rest-ftp-daemon/notification"
41
37
 
@@ -1,3 +1,5 @@
1
+ require "grape"
2
+
1
3
  module RestFtpDaemon
2
4
  module API
3
5
  class Config < Grape::API
@@ -11,7 +13,7 @@ module RestFtpDaemon
11
13
 
12
14
  desc "Reload daemon config"
13
15
  post "/reload" do
14
- if Conf.at(:debug, :allow_reload)==true
16
+ if Conf[:allow_reload]==true
15
17
  Conf.reload!
16
18
  status 200
17
19
  return Helpers.get_censored_config
@@ -2,6 +2,7 @@ require "haml"
2
2
  require "sys/cpu"
3
3
  require "get_process_mem"
4
4
  require "facter"
5
+ require "grape"
5
6
 
6
7
  module RestFtpDaemon
7
8
  module API
@@ -1,3 +1,5 @@
1
+ require "grape"
2
+
1
3
  module RestFtpDaemon
2
4
  module API
3
5
  class Debug < Grape::API
@@ -1,3 +1,5 @@
1
+ require "grape-entity"
2
+
1
3
  module RestFtpDaemon
2
4
  module API
3
5
  module Entities