rest-ftp-daemon 0.302.2 → 0.302.3

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: 4068d4abcf6001eb5996416a20da6e307a64f8e8
4
- data.tar.gz: bc1043ae08c65fdbb40e495559fbcac62a2bd50f
3
+ metadata.gz: 404ecae7bf682e2d02aafe69f1a04acfd5792ba6
4
+ data.tar.gz: c9b5924aa5387ea7423fd9464c695ffc37a3a424
5
5
  SHA512:
6
- metadata.gz: 61772cd43a690dbff017305680fde1d0bc0bd5a3d801c829e2d94e6a612451bfe12816baef7cad473167b4f814e41880a9c30c12f3690528b484ecb9def573e5
7
- data.tar.gz: aa77fd72fdef6a2a25048fbc5996cf47599197bf820f17ae8df9cba88c92b2efed20fa4857eb037e83ce23ad9f6b3797af3e83361461505ef851ccf97860b5a2
6
+ metadata.gz: 1e88538745df4eca736c1f9b238e6645a6de0fa412b117d741554d7091c9b4d5eeb741bf2be3bc57f9aad5a399b640a163098700c17700b9e40e146cbf231360
7
+ data.tar.gz: 6e2afd3392eddfbfd6cb3a8422e604ac78971f56a3f3ed3b253c96e0f986c67e44fdc916bdb3defce12095ac839841670dd4157e4aebd7e33dcf3546b06630b1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.302.2)
4
+ rest-ftp-daemon (0.302.3)
5
5
  api-auth
6
6
  chamber
7
7
  double-bag-ftps
@@ -55,7 +55,7 @@ GEM
55
55
  eventmachine (1.2.0.1)
56
56
  facter (2.4.6)
57
57
  CFPropertyList (~> 2.2.6)
58
- ffi (1.9.10)
58
+ ffi (1.9.13)
59
59
  get_process_mem (0.2.1)
60
60
  grape (0.16.2)
61
61
  activesupport
@@ -93,7 +93,7 @@ GEM
93
93
  parser (2.3.1.2)
94
94
  ast (~> 2.2)
95
95
  powerpack (0.1.1)
96
- pry (0.10.3)
96
+ pry (0.10.4)
97
97
  coderay (~> 1.1.0)
98
98
  method_source (~> 0.8.1)
99
99
  slop (~> 3.4)
@@ -106,19 +106,19 @@ GEM
106
106
  http-cookie (>= 1.0.2, < 2.0)
107
107
  mime-types (>= 1.16, < 3.0)
108
108
  netrc (~> 0.7)
109
- rspec (3.4.0)
110
- rspec-core (~> 3.4.0)
111
- rspec-expectations (~> 3.4.0)
112
- rspec-mocks (~> 3.4.0)
113
- rspec-core (3.4.4)
114
- rspec-support (~> 3.4.0)
115
- rspec-expectations (3.4.0)
109
+ rspec (3.5.0)
110
+ rspec-core (~> 3.5.0)
111
+ rspec-expectations (~> 3.5.0)
112
+ rspec-mocks (~> 3.5.0)
113
+ rspec-core (3.5.1)
114
+ rspec-support (~> 3.5.0)
115
+ rspec-expectations (3.5.0)
116
116
  diff-lcs (>= 1.2.0, < 2.0)
117
- rspec-support (~> 3.4.0)
118
- rspec-mocks (3.4.1)
117
+ rspec-support (~> 3.5.0)
118
+ rspec-mocks (3.5.0)
119
119
  diff-lcs (>= 1.2.0, < 2.0)
120
- rspec-support (~> 3.4.0)
121
- rspec-support (3.4.1)
120
+ rspec-support (~> 3.5.0)
121
+ rspec-support (3.5.0)
122
122
  rubocop (0.32.1)
123
123
  astrolabe (~> 1.3)
124
124
  parser (>= 2.2.2.5, < 3.0)
data/README.md CHANGED
@@ -43,25 +43,28 @@ Features
43
43
  * metrics about pools, throughtput, and queues output to NewRelic
44
44
 
45
45
 
46
- Project status
46
+ Project status and quick installation
47
47
  ------------------------------------------------------------------------------------
48
48
 
49
+ #### Stability
50
+
49
51
  Though it may need more robust tests, this gem has been used successfully in production for
50
52
  a while without any glitches at France Télévisions.
51
53
 
52
- Expected features in a short-time range :
54
+ #### API Documentation
55
+
56
+ API documentation was [maintained on Apiary](http://docs.restftpdaemon.apiary.io/) and will me migrated to swagger on day or another.
57
+
58
+ #### Expected features in a short-time range
53
59
 
54
60
  * Provide swagger-style API documentation
55
61
  * Authenticate API clients
56
62
  * Allow more transfer protocols (HTTP POST etc)
57
63
  * Expose JSON status of workers on `GET /jobs/` for automated monitoring
58
64
 
65
+ #### Installation
59
66
 
60
-
61
- Installation
62
- ------------------------------------------------------------------------------------
63
-
64
- With Ruby (version 2.2 or higher) and rubygems properly installed, you only need :
67
+ With Ruby (version 2.3 or higher) and rubygems properly installed, you only need :
65
68
 
66
69
  ```
67
70
  gem install rest-ftp-daemon
@@ -70,9 +73,29 @@ gem install rest-ftp-daemon
70
73
  If that is not the case yet, see section [Debian install preparation](#debian-install-preparation).
71
74
 
72
75
 
73
- Usage
76
+ Subsystems
77
+ ------------------------------------------------------------------------------------
78
+
79
+ #### Conchita: jobs queues cleanup
80
+
81
+ Job queue can be set to automatically cleanup after a certain delay. Entries are removed from the queue when they have been idle (updated_at) for more than X seconds, and in any of the following statuses:
82
+
83
+ - failed (conchita.clean_failed)
84
+ - finished (conchita.clean_finished)
85
+ - queued, (conchita.clean_queued)
86
+
87
+ Cleanup is done on a regular basis, every (conchita.timer) seconds.
88
+
89
+ #### Reporter: metrics collection
90
+
91
+ [TODO]
92
+
93
+
94
+ Usage and examples
74
95
  ------------------------------------------------------------------------------------
75
96
 
97
+ #### Launching rest-ftp-daemon
98
+
76
99
  You must provide a configuration file for the daemon to start, either explicitly using
77
100
  option `--config` or implicitly at `/etc/rest-ftp-daemon.yml`. A sample file is provided, issue
78
101
  `--help` to get more info.
@@ -89,7 +112,7 @@ The dashboard will provide an overview at `http://localhost:3000/`
89
112
 
90
113
  If the daemon appears to exit quickly when launched, it may be caused by logfiles that can't be written (check files permissions or owner).
91
114
 
92
- Launcher options :
115
+ #### Launcher options :
93
116
 
94
117
  | Param | Short | Default | Description |
95
118
  |------- |-------------- |------------- |----------------------------------------------------------- |
@@ -105,9 +128,6 @@ Launcher options :
105
128
  | -v | --version | | Show the current version |
106
129
 
107
130
 
108
- Usage and examples
109
- ------------------------------------------------------------------------------------
110
-
111
131
  #### Start a job to transfer a file named "file.iso" to a local FTP server
112
132
 
113
133
  ```
@@ -159,12 +179,6 @@ GET http://localhost:3000/jobs/1
159
179
  ```
160
180
 
161
181
 
162
- API Documentation
163
- ------------------------------------------------------------------------------------
164
-
165
- API documentation is [maintained on Apiary](http://docs.restftpdaemon.apiary.io/)
166
-
167
-
168
182
  Configuration
169
183
  ------------------------------------------------------------------------------------
170
184
 
@@ -185,31 +199,80 @@ As a starting point, `rest-ftp-daemon.yml.sample` is an example config file that
185
199
  Default administrator credentials are `admin/admin`. Please change the password in this configuration file before starting any kind of production.
186
200
 
187
201
 
188
- Metrics
189
- ------------------------------------------------------------------------------------
190
-
191
- [FIXME]
192
-
193
-
194
-
195
- Logging
196
- ------------------------------------------------------------------------------------
197
-
198
- The application will log to paths specified in the configuration file, if any.
199
- Separate logging paths can be provided for the Thin webserver, API related messages, and workers related messages.
200
- Providing empty values as paths, will simply activate logging to `STDOUT`.
202
+ Here is the contents of the default configuration (oeverride by passing -c local.yml at startup)
203
+
204
+ ```yaml
205
+ daemonize: true
206
+ port: 3000
207
+ user: rftpd
208
+ # group: rftpd
209
+ # host: "myhost"
210
+ allow_reload: false
211
+
212
+ pools: # number of workers decidated to each pool value
213
+ default: 2
214
+ urgent: 1
215
+
216
+ reporter: # the subsytem in charge of reporting metrics, mainly to NewRelic
217
+ debug: false
218
+ timer: 10 # report every X seconds
219
+
220
+ conchita:
221
+ debug: false
222
+ timer: 60 # do the cleaning up every X seconds
223
+ garbage_collector: true # force a garbage collector cleanup when cleaning things up
224
+ clean_failed: 3600 # after X seconds, clean jobs with status="failed"
225
+ clean_finished: 3600 # // // // finished
226
+ clean_queued: 86400 # // // // queued
227
+
228
+ transfer:
229
+ debug: false
230
+ mkdir: true # build directory tree if missing
231
+ tempfile: true # transfer to temporary file, rename after sucessful transfer
232
+ overwrite: false # overwrite any target file with the same name
233
+ timeout: 1800 # jobs running for longer than X seconds will be killed
234
+ notify_after: 5 # wait at least X seconds between HTTP notifications
235
+
236
+ debug_ftp: false
237
+ debug_sftp: false
238
+
239
+ retry_on: # job error values that will allow a retry
240
+ - ftp_perm_error
241
+ - net_temp_error
242
+ - conn_reset_by_peer
243
+ - conn_timed_out
244
+ - conn_refused
245
+ - sftp_auth_failed
246
+ - conn_host_is_down
247
+ - conn_unreachable
248
+ - conn_failed
249
+ - conn_openssl_error
250
+ retry_max: 5 # maximum number of retries before giving up on that job
251
+ retry_for: 1800 # maximum time window to retry failed jobs
252
+ retry_after: 10 # delay to wait before tries
253
+
254
+ newrelic:
255
+ debug: false
256
+ # licence: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
257
+ # app_name: "rftpd-bigbusiness-dev" # app_name used for naming app (used as-is if provided)
258
+ prefix: "rftpd" # app prefix to build app_name
259
+ # platform: "bigbusiness" # app platform to build app_name
260
+
261
+ logs:
262
+ path: "/var/log/"
263
+ thin: "rftpd-environment-thin.log"
264
+ newrelic: "rftpd-environment-newrelic.log"
265
+ queue: "rftpd-environment-core.log"
266
+ api: "rftpd-environment-core.log"
267
+ workers: "rftpd-environment-core.log"
268
+ transfer: "rftpd-environment-workers.log"
269
+ conchita: "rftpd-environment-workers.log"
270
+ reporter: "rftpd-environment-workers.log"
271
+ notify: "rftpd-environment-workers.log"
201
272
 
273
+ ```
202
274
 
203
- Job cleanup
204
- ------------------------------------------------------------------------------------
205
275
 
206
- Job queue can be set to automatically cleanup after a certain delay. Entries are removed from the queue when they have been idle (updated_at) for more than X seconds, and in any of the following statuses:
207
-
208
- - failed (conchita.clean_failed)
209
- - finished (conchita.clean_finished)
210
- - queued, (conchita.clean_queued)
211
-
212
- Cleanup is done on a regular basis, every (conchita.timer) seconds.
213
276
 
214
277
 
215
278
  TODO for this document
@@ -245,7 +308,9 @@ You may have to install some extra packages for the compilations to complete.
245
308
  # rbenv install --list | grep '2.2'
246
309
  ```
247
310
 
311
+ ```
248
312
  # curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3
313
+ ```
249
314
 
250
315
  Otherwise, you way have to update ruby-build to include Ruby 2.2 definitions.
251
316
  On Debian, 2.2 is not included in Wheezy and appears in Jessie's version of the package.
data/defaults.yml CHANGED
@@ -5,22 +5,21 @@ user: rftpd
5
5
  # host: "myhost"
6
6
  allow_reload: false
7
7
 
8
- pools:
8
+ pools: # number of workers decidated to each pool value
9
9
  default: 2
10
10
  urgent: 1
11
11
 
12
- reporter:
13
- debug: false
14
- timer: 10
12
+ reporter: # the subsytem in charge of reporting metrics, mainly to NewRelic
15
13
  debug: false
14
+ timer: 10 # report every X seconds
16
15
 
17
16
  conchita:
18
17
  debug: false
19
- timer: 60
20
- garbage_collector: true
21
- clean_failed: 3600
22
- clean_finished: 3600
23
- clean_queued: 86400
18
+ timer: 60 # do the cleaning up every X seconds
19
+ garbage_collector: true # force a garbage collector cleanup when cleaning things up
20
+ clean_failed: 3600 # after X seconds, clean jobs with status="failed"
21
+ clean_finished: 3600 # // // // finished
22
+ clean_queued: 86400 # // // // queued
24
23
 
25
24
  transfer:
26
25
  debug: false
@@ -33,7 +32,7 @@ transfer:
33
32
  debug_ftp: false
34
33
  debug_sftp: false
35
34
 
36
- retry_on:
35
+ retry_on: # job error values that will allow a retry
37
36
  - ftp_perm_error
38
37
  - net_temp_error
39
38
  - conn_reset_by_peer
@@ -44,15 +43,16 @@ transfer:
44
43
  - conn_unreachable
45
44
  - conn_failed
46
45
  - conn_openssl_error
47
- retry_max: 5
48
- retry_for: 1800
49
- retry_after: 10
46
+ retry_max: 5 # maximum number of retries before giving up on that job
47
+ retry_for: 1800 # maximum time window to retry failed jobs
48
+ retry_after: 10 # delay to wait before tries
50
49
 
51
50
  newrelic:
51
+ debug: false
52
52
  # licence: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
53
- prefix: "rftpd" # app prefix
54
- # platform: "bigbusiness" # app platform name
55
- # app_name: "rftpd-bigbusiness-dev" # nickname used for naming app
53
+ # app_name: "rftpd-bigbusiness-dev" # app_name used for naming app (used as-is if provided)
54
+ prefix: "rftpd" # app prefix to build app_name
55
+ # platform: "bigbusiness" # app platform to build app_name
56
56
 
57
57
  logs:
58
58
  path: "/var/log/"
@@ -52,11 +52,11 @@ module RestFtpDaemon
52
52
  metrics_newrelic[name] = value
53
53
  end
54
54
  end
55
- if @config[:debug]
56
- log_debug "reported following metrics to NewRelic", metrics_newrelic
57
- else
58
- log_debug "reported all metrics to NewRelic"
59
- end
55
+
56
+ # Don't dump metrics unless we're debugging
57
+ metrics_newrelic = nil unless @config[:debug]
58
+ newrelic_app_name = ENV["NEW_RELIC_APP_NAME"]
59
+ log_debug "reported metrics to NewRelic [#{newrelic_app_name}]", metrics_newrelic
60
60
  end
61
61
 
62
62
  end
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |spec|
3
3
 
4
4
  # Project version
5
- spec.version = "0.302.2"
5
+ spec.version = "0.302.3"
6
6
 
7
7
  # Project description
8
8
  spec.name = "rest-ftp-daemon"
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.302.2
4
+ version: 0.302.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -382,7 +382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
382
382
  version: '0'
383
383
  requirements: []
384
384
  rubyforge_project:
385
- rubygems_version: 2.4.5.1
385
+ rubygems_version: 2.6.6
386
386
  signing_key:
387
387
  specification_version: 4
388
388
  summary: RESTful FTP client daemon