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 +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +2 -1
- data/lib/rest-ftp-daemon.rb +0 -14
- data/lib/rest-ftp-daemon/api/dashboard.rb +5 -0
- data/lib/rest-ftp-daemon/api/job_presenter.rb +2 -0
- data/lib/rest-ftp-daemon/api/jobs.rb +3 -0
- data/lib/rest-ftp-daemon/api/root.rb +3 -1
- data/lib/rest-ftp-daemon/constants.rb +1 -1
- data/lib/rest-ftp-daemon/job.rb +2 -0
- data/lib/rest-ftp-daemon/logger.rb +2 -0
- data/lib/rest-ftp-daemon/logger_helper.rb +6 -0
- data/lib/rest-ftp-daemon/logger_pool.rb +2 -0
- data/lib/rest-ftp-daemon/remote_ftp.rb +3 -0
- data/lib/rest-ftp-daemon/remote_sftp.rb +3 -1
- data/lib/rest-ftp-daemon/settings.rb +6 -3
- data/rest-ftp-daemon.yml.sample +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a820370311bc6c810416430054b60eb9c2c7dde6
|
4
|
+
data.tar.gz: d5ffd7492d59c0d6d7367c967a2097f377b61da2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
32
|
-
parser (
|
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.
|
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
|
-
|
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/
|
data/lib/rest-ftp-daemon.rb
CHANGED
@@ -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
|
data/lib/rest-ftp-daemon/job.rb
CHANGED
@@ -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 "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(:
|
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(:
|
43
|
+
ENV["NEW_RELIC_LICENSE_KEY"] = Settings.at(:newrelic, :licence)
|
42
44
|
|
43
45
|
# Appname
|
44
|
-
|
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)
|
data/rest-ftp-daemon.yml.sample
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|