rest-ftp-daemon 0.230.0 → 0.230.1

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: 77ab7d0648a235291fd5cd1f3c0682dc5296d8f7
4
- data.tar.gz: cfa1db6e26b429e8228b11e65a127774fa270957
3
+ metadata.gz: a820370311bc6c810416430054b60eb9c2c7dde6
4
+ data.tar.gz: d5ffd7492d59c0d6d7367c967a2097f377b61da2
5
5
  SHA512:
6
- metadata.gz: 10059f2656187713a533efa90dbc3100f6092194d97d11d7e95e4ffa9b1dc0ab6a4147f666496d8cf4acdc190526e7d4c828fc90803b0f1488d931fd02110cbb
7
- data.tar.gz: a0d91e6e6d468c1c693e69b4b8fdfc3de62e70e41646543da9d2a5f3cc63f36599a8d7e5cfce151c8efdfb48d8d18221bc70b271b8fdc9cce71c6c991cee76e6
6
+ metadata.gz: 33588683ce35aa16a2df2a45ec9a1f0624b8d8d13f89a0aa4f9c0f1f48cdbaa30683d7c05193dc3566faa47a0ca1f1d124a1dc9a27e73abd044d296d30f1c74f
7
+ data.tar.gz: b4a782b02307ffeb32caf668668a61123a8bde05774b0b000cfa7589547b17705724db1337f3d5b85a55bd6fc131541901ce7f0a89a8015771fa1bf6ca989b05
data/Gemfile.lock CHANGED
@@ -28,8 +28,8 @@ GEM
28
28
  tzinfo (~> 1.1)
29
29
  addressable (2.3.8)
30
30
  ast (2.0.0)
31
- astrolabe (1.3.0)
32
- parser (>= 2.2.0.pre.3, < 3.0)
31
+ astrolabe (1.3.1)
32
+ parser (~> 2.2)
33
33
  axiom-types (0.1.1)
34
34
  descendants_tracker (~> 0.0.4)
35
35
  ice_nine (~> 0.11.0)
@@ -87,7 +87,7 @@ GEM
87
87
  net-ssh (>= 2.6.5)
88
88
  net-ssh (2.9.2)
89
89
  newrelic_rpm (3.12.1.298)
90
- parser (2.3.0.pre.2)
90
+ parser (2.2.2.6)
91
91
  ast (>= 1.1, < 3.0)
92
92
  powerpack (0.1.1)
93
93
  pry (0.10.1)
data/README.md CHANGED
@@ -291,6 +291,7 @@ So,
291
291
  About
292
292
  ------------------------------------------------------------------------------------
293
293
 
294
- Bruno MEDICI Consultant
294
+ Thanks to https://github.com/berkshelf/berkshelf-api for parts and ideas used in this project
295
295
 
296
+ Bruno MEDICI Consultant
296
297
  http://bmconseil.com/
@@ -1,27 +1,13 @@
1
1
  # Global libs
2
2
  require "rubygems"
3
- require "settingslogic"
4
3
  require "json"
5
- require "grape"
6
- require "grape-entity"
7
- require "haml"
8
- require "facter"
9
4
  require "uri"
10
- require "securerandom"
11
5
  require "timeout"
12
- require "sys/cpu"
13
6
  require "syslog"
14
- require "net/ftp"
15
- require "net/sftp"
16
7
  require "net/http"
17
- require "double_bag_ftps"
18
8
  require "thread"
19
- require "securerandom"
20
9
  require "singleton"
21
- require "logger"
22
-
23
10
  require "newrelic_rpm"
24
- require "get_process_mem"
25
11
 
26
12
 
27
13
  # Project's libs
@@ -1,3 +1,8 @@
1
+ require "grape"
2
+ require "haml"
3
+ require "sys/cpu"
4
+ require "facter"
5
+
1
6
  module RestFtpDaemon
2
7
  module API
3
8
  class Dashbaord < Grape::API
@@ -1,3 +1,5 @@
1
+ require "grape-entity"
2
+
1
3
  module RestFtpDaemon
2
4
  module API
3
5
  module Entities
@@ -1,3 +1,5 @@
1
+ require "grape"
2
+
1
3
  module RestFtpDaemon
2
4
  module API
3
5
  class Jobs < Grape::API
@@ -92,6 +94,7 @@ module RestFtpDaemon
92
94
 
93
95
  post "/" do
94
96
  log_info "POST /jobs", params
97
+ log_debug params.to_json
95
98
 
96
99
  begin
97
100
 
@@ -1,3 +1,6 @@
1
+ require "grape"
2
+ require "get_process_mem"
3
+
1
4
  module RestFtpDaemon
2
5
  module API
3
6
  class Root < Grape::API
@@ -18,7 +21,6 @@ module RestFtpDaemon
18
21
  mount RestFtpDaemon::API::Dashbaord => "/"
19
22
 
20
23
 
21
-
22
24
  ####### INITIALIZATION
23
25
 
24
26
  def initialize
@@ -1,7 +1,7 @@
1
1
  # Terrific constants
2
2
  APP_NAME = "rest-ftp-daemon"
3
3
  APP_NICK = "rftpd"
4
- APP_VER = "0.230.0"
4
+ APP_VER = "0.230.1"
5
5
 
6
6
 
7
7
  # Jobs and workers
@@ -1,3 +1,5 @@
1
+ require "securerandom"
2
+
1
3
  module RestFtpDaemon
2
4
  class Job
3
5
  include LoggerHelper
@@ -1,3 +1,5 @@
1
+ require "logger"
2
+
1
3
  class Logger
2
4
 
3
5
  def info_with_id message, context = {}
@@ -1,3 +1,5 @@
1
+ require "logger"
2
+
1
3
  module RestFtpDaemon
2
4
  module LoggerHelper
3
5
 
@@ -11,6 +13,10 @@ module RestFtpDaemon
11
13
  log message, lines, Logger::ERROR
12
14
  end
13
15
 
16
+ def log_debug message, lines = []
17
+ log message, lines, Logger::DEBUG
18
+ end
19
+
14
20
  def log_context
15
21
  {}
16
22
  end
@@ -1,3 +1,5 @@
1
+ require "logger"
2
+
1
3
  module RestFtpDaemon
2
4
  class LoggerPool
3
5
  include Singleton
@@ -1,3 +1,6 @@
1
+ require "net/ftp"
2
+ require "double_bag_ftps"
3
+
1
4
  module RestFtpDaemon
2
5
  class RemoteFTP < Remote
3
6
  attr_reader :ftp
@@ -1,3 +1,5 @@
1
+ require "net/sftp"
2
+
1
3
  module RestFtpDaemon
2
4
  class RemoteSFTP < Remote
3
5
  attr_reader :sftp
@@ -22,7 +24,7 @@ module RestFtpDaemon
22
24
  verbosity = @debug ? Logger::INFO : false
23
25
 
24
26
  # Connect remote server
25
- @sftp = Net::SFTP.start(@url.host, @url.user, password: @url.password, verbose: verbosity)
27
+ @sftp = Net::SFTP.start(@url.host, @url.user, password: @url.password, verbose: verbosity, port: @url.port)
26
28
  end
27
29
 
28
30
  def present? target
@@ -1,3 +1,5 @@
1
+ require "settingslogic"
2
+
1
3
  # Configuration class
2
4
  class Settings < Settingslogic
3
5
  # Read configuration
@@ -26,7 +28,7 @@ class Settings < Settingslogic
26
28
  end
27
29
 
28
30
  def newrelic_enabled?
29
- Settings.at(:debug, :newrelic)
31
+ Settings.at(:newrelic)
30
32
  end
31
33
 
32
34
  def init_newrelic
@@ -38,10 +40,11 @@ class Settings < Settingslogic
38
40
  ENV["NEW_RELIC_MONITOR_MODE"] = "true"
39
41
 
40
42
  # License
41
- ENV["NEW_RELIC_LICENSE_KEY"] = Settings.at(:debug, :newrelic)
43
+ ENV["NEW_RELIC_LICENSE_KEY"] = Settings.at(:newrelic, :licence)
42
44
 
43
45
  # Appname
44
- ENV["NEW_RELIC_APP_NAME"] = "#{APP_NICK}-#{Settings.host}-#{APP_ENV}"
46
+ platform = Settings.at(:newrelic, :platform) || Settings["host"]
47
+ ENV["NEW_RELIC_APP_NAME"] = "#{APP_NICK}-#{platform}-#{APP_ENV}"
45
48
 
46
49
  # Logfile
47
50
  ENV["NEW_RELIC_LOG"] = Settings.at(:logs, :newrelic)
@@ -5,7 +5,6 @@ defaults: &defaults
5
5
  user: rftpd
6
6
  group: rftpd
7
7
  #host: "myhost"
8
- #appname: "replay" # appname prefix used for NewRelic reporting
9
8
 
10
9
  transfer:
11
10
  notify_after_sec: 5 # wait at least X seconds between HTTP notifications
@@ -21,11 +20,14 @@ defaults: &defaults
21
20
  # clean_finished: 3600
22
21
  # clean_queued: 86400
23
22
 
23
+ newrelic:
24
+ licence: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
25
+ platform: devel # nickname used for naming app
26
+
24
27
  debug:
25
28
  ftp: false
26
29
  sftp: false
27
30
  conchita: false
28
- # newrelic: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
29
31
 
30
32
  logs:
31
33
  thin: "/var/log/rftpd-environment-thin.log"
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.230.0
4
+ version: 0.230.1
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-07-09 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler