rest-ftp-daemon 0.6 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,305 @@
1
- # Global libs
2
- require 'rubygems'
3
- require 'json'
4
- require 'securerandom'
5
- # require 'celluloid/autostart'
6
-
7
- # My libs
8
- require 'rest-ftp-daemon/config'
9
- require 'rest-ftp-daemon/exceptions'
10
- require 'rest-ftp-daemon/common'
11
- require 'rest-ftp-daemon/job_queue'
12
- require 'rest-ftp-daemon/worker_pool'
13
- require 'rest-ftp-daemon/logger'
14
- require 'rest-ftp-daemon/job'
15
- require 'rest-ftp-daemon/notification'
16
- require 'rest-ftp-daemon/api/defaults'
17
- require 'rest-ftp-daemon/api/jobs'
18
- require 'rest-ftp-daemon/api/root'
1
+ class RestFtpDaemon < Sinatra::Base
19
2
 
3
+ # General config
4
+ configure :development, :production do
5
+
6
+ # Create new thread group
7
+ @@workers = ThreadGroup.new
8
+
9
+ # Logging configuration
10
+ #use Rack::CommonLogger, logger
11
+
12
+ # Some other configuration
13
+ disable :sessions
14
+ disable :logging
15
+ end
16
+
17
+ # Server initialization
18
+ def initialize
19
+ # Setup logger
20
+ @logger = Logger.new(APP_LOGTO, 'daily')
21
+ #@logger = Logger.new
22
+ #@logger.level = Logger::INFO
23
+
24
+ # Other stuff
25
+ @@last_worker_id = 0
26
+ @@hostname = `hostname`.chomp
27
+
28
+ super
29
+ end
30
+
31
+ # Server global status
32
+ get "/" do
33
+ # Debug query
34
+ info "GET /"
35
+
36
+ # Build response
37
+ content_type :json
38
+ JSON.pretty_generate get_status
39
+ end
40
+
41
+ # List jobs
42
+ get "/jobs" do
43
+ # Debug query
44
+ info "GET /jobs"
45
+
46
+ # Build response
47
+ content_type :json
48
+ JSON.pretty_generate get_jobs
49
+ end
50
+
51
+ # Get job info
52
+ get "/jobs/:id" do
53
+ # Debug query
54
+ info "GET /jobs/#{params[:id]}"
55
+
56
+ # Find this process by name
57
+ found = find_job params[:id]
58
+
59
+ # Build response
60
+ error 404 and return if found.nil?
61
+ content_type :json
62
+ JSON.pretty_generate found
63
+ end
64
+
65
+ # Delete jobs
66
+ delete "/jobs/:id" do
67
+ # Debug query
68
+ info "DELETE /jobs/#{params[:name]}"
69
+
70
+ # Find and kill this job
71
+ found = delete_job params[:id]
72
+
73
+ # Build response
74
+ error 404 and return if found.nil?
75
+ content_type :json
76
+ JSON.pretty_generate found
77
+ end
78
+
79
+ # Spawn a new thread for this new job
80
+ post '/jobs' do
81
+ # Extract payload
82
+ request.body.rewind
83
+ payload = JSON.parse request.body.read
84
+
85
+ # Debug query
86
+ info "POST /jobs: #{payload.to_json}"
87
+
88
+ # Spawn a thread for this job
89
+ result = new_job payload
90
+
91
+ # Build response
92
+ content_type :json
93
+ JSON.pretty_generate result
94
+ end
95
+
96
+ protected
97
+
98
+ def process_job
99
+ # Init
100
+ info "process_job: starting"
101
+ job = Thread.current.job
102
+ job_status :started
103
+ transferred = 0
104
+
105
+ # Check source
106
+ job_source = File.expand_path(job["source"])
107
+ if !(File.exists? job_source)
108
+ job_error ERR_JOB_SOURCE_NOTFOUND, :ERR_JOB_SOURCE_NOTFOUND
109
+ return
110
+ end
111
+ info "process_job: job_source: #{job_source}"
112
+ source_size = File.size job_source
113
+ job_set :source_size, source_size
114
+
115
+ # Check target
116
+ job_target = job["target"]
117
+ target = URI(job_target) rescue nil
118
+ if job_target.nil? || target.nil?
119
+ job_error ERR_JOB_TARGET_UNPARSEABLE, :ERR_JOB_TARGET_UNPARSEABLE
120
+ return
121
+ end
122
+ info "process_job: job_target: #{job_target}"
123
+
124
+ # Split URI
125
+ target_path = File.dirname target.path
126
+ target_name = File.basename target.path
127
+ info "ftp_transfer: job_target.host [#{target.host}]"
128
+ info "ftp_transfer: target_path [#{target_path}]"
129
+ info "ftp_transfer: target_name [#{target_name}]"
130
+
131
+ # Prepare FTP transfer
132
+ ftp = Net::FTP.new(target.host)
133
+ ftp.passive = true
134
+ ftp.login
135
+ ftp.chdir(target_path)
136
+
137
+
138
+ # Check if target file is found
139
+ info "source: checking target file"
140
+ job_status :checking_target
141
+ job_error ERR_BUSY, :checking_target
142
+
143
+ results = ftp.list(target_name)
144
+ info "ftp.list: #{results}"
145
+ unless results.count.zero?
146
+ job_error ERR_JOB_TARGET_PRESENT, :ERR_JOB_TARGET_PRESENT
147
+ info "target: existing: ERR_JOB_TARGET_PRESENT"
148
+ ftp.close
149
+ return
150
+ end
151
+
152
+
153
+ # Do transfer
154
+ info "source: starting stransfer"
155
+ #Thread.current[:status] = :transferring
156
+ job_status :uploading
157
+ job_error ERR_BUSY, :uploading
158
+
159
+ begin
160
+ ftp.putbinaryfile(job_source, target_name, TRANSFER_CHUNK_SIZE) do |block|
161
+ # Update thread info
162
+ percent = (100.0 * transferred / source_size).round(1)
163
+ job_set :progress, percent
164
+ job_set :transferred, transferred
165
+ info "transferring [#{percent} %] of [#{target_name}]"
166
+
167
+ # Update counters
168
+ transferred += TRANSFER_CHUNK_SIZE
169
+ end
170
+
171
+ rescue Net::FTPPermError
172
+ #job_status :failed
173
+ job_error ERR_JOB_PERMISSION, :ERR_JOB_PERMISSION
174
+ info "source: FAILED: PERMISSIONS ERROR"
175
+
176
+ else
177
+ #job_status :finished
178
+ job_error ERR_OK, :finished
179
+ info "source: finished stransfer"
180
+ end
181
+
182
+ # Close FTP connexion
183
+ ftp.close
184
+ end
185
+
186
+ def get_status
187
+ info "> get_status"
188
+ {
189
+ app_name: APP_NAME,
190
+ hostname: @@hostname,
191
+ version: APP_VER,
192
+ started: APP_STARTED,
193
+ uptime: (Time.now - APP_STARTED).round(1),
194
+ jobs_count: @@workers.list.count,
195
+ }
196
+ end
197
+
198
+ def get_jobs
199
+ info "> get_jobs"
200
+
201
+ # Collect info's
202
+ @@workers.list.map { |thread| thread.job }
203
+ end
204
+
205
+ def delete_job id
206
+ info "> delete_job(#{id})"
207
+
208
+ # Find jobs with this id
209
+ jobs = jobs_with_id id
210
+
211
+ # Kill them
212
+ jobs.each{ |thread| Thread.kill(thread) }
213
+
214
+ # Return the first one
215
+ return nil if jobs.empty?
216
+ jobs.first.job
217
+ end
218
+
219
+ def find_job id
220
+ info "> find_job(#{id})"
221
+
222
+ # Find jobs with this id
223
+ jobs = jobs_with_id id
224
+
225
+ # Return the first one
226
+ return nil if jobs.empty?
227
+ jobs.first.job
228
+ end
229
+
230
+ def jobs_with_id id
231
+ info "> find_jobs_by_id(#{id})"
232
+ @@workers.list.select{ |thread| thread[:id].to_s == id.to_s }
233
+ end
234
+
235
+ def new_job context = {}
236
+ info "new_job"
237
+
238
+ # Generate name
239
+ @@last_worker_id +=1
240
+ host = @@hostname.split('.')[0]
241
+ worker_id = @@last_worker_id
242
+ worker_name = "#{host}-#{Process.pid.to_s}-#{worker_id}"
243
+ info "new_job: creating thread [#{worker_name}]"
244
+
245
+ # Parse parameters
246
+ job_source = context["source"]
247
+ job_target = context["target"]
248
+ return { code: ERR_REQ_SOURCE_MISSING, errmsg: :ERR_REQ_SOURCE_MISSING} if job_source.nil?
249
+ return { code: ERR_REQ_TARGET_MISSING, errmsg: :ERR_REQ_TARGET_MISSING} if job_target.nil?
250
+
251
+ # Parse dest URI
252
+ target = URI(job_target)
253
+ info target.scheme
254
+ return { code: ERR_REQ_TARGET_SCHEME, errmsg: :ERR_REQ_TARGET_SCHEME} unless target.scheme == "ftp"
255
+
256
+ # Create thread
257
+ job = Thread.new(worker_id, worker_name, job) do
258
+ # Tnitialize thread
259
+ Thread.abort_on_exception = true
260
+ job_status :initializing
261
+ job_error ERR_OK
262
+
263
+ # Initialize job info
264
+ Thread.current[:job] = {}
265
+ Thread.current[:job].merge! context if context.is_a? Enumerable
266
+ Thread.current[:id] = worker_id
267
+ job_set :worker_name, worker_name
268
+ job_set :created, Time.now
269
+
270
+ # Do the job
271
+ info "new_job: thread running"
272
+ process_job
273
+
274
+ # Sleep a few seconds before dying
275
+ job_status :graceful_ending
276
+ sleep THREAD_SLEEP_BEFORE_DIE
277
+ job_status :ended
278
+ info "new_job: thread finished"
279
+ end
280
+
281
+ # Keep thread in thread group
282
+ info "new_job: attaching thread [#{worker_name}] to group"
283
+ @@workers.add job
284
+
285
+ return { code: 0, errmsg: 'success', worker_id: worker_id, context: context }
286
+ end
287
+
288
+ def info msg=""
289
+ @logger.info msg
290
+ end
291
+
292
+ def job_error error, errmsg = nil
293
+ job_set :error, error
294
+ job_set :errmsg, errmsg
295
+ end
296
+ def job_status status
297
+ job_set :status, status
298
+ end
299
+
300
+ def job_set attribute, value, thread = Thread.current
301
+ thread[:job][attribute] = value if thread[:job].is_a? Enumerable
302
+ end
303
+
304
+
305
+ end
@@ -1,36 +1,67 @@
1
- # coding: utf-8
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
2
5
 
3
- # Libs
4
- lib = File.expand_path('../lib', __FILE__)
5
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
- require 'rest-ftp-daemon/config'
6
+ Gem::Specification.new do |s|
7
+ s.name = "rest-ftp-daemon"
8
+ s.version = "0.7.0"
7
9
 
8
- Gem::Specification.new do |spec|
9
- spec.name = Settings[:name]
10
- spec.date = Time.now.strftime("%Y-%m-%d")
11
- spec.authors = ["Bruno MEDICI"]
12
- spec.email = "rest-ftp-daemon@bmconseil.com"
13
- spec.description = "This is a pretty simple FTP client daemon, controlled through a RESTfull API"
14
- spec.summary = "RESTful FTP client daemon"
15
- spec.homepage = "http://github.com/bmedici/rest-ftp-daemon"
16
- spec.licenses = ["MIT"]
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Bruno"]
12
+ s.date = "2014-08-01"
13
+ s.description = "This is a pretty simple FTP client daemon, controlled through a RESTfull API"
14
+ s.email = "rest-ftp-daemon@bmconseil.com"
15
+ s.executables = ["rest-ftp-daemon"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/rest-ftp-daemon",
28
+ "lib/config.rb",
29
+ "lib/config.ru",
30
+ "lib/errors.rb",
31
+ "lib/extend_threads.rb",
32
+ "lib/rest-ftp-daemon.rb",
33
+ "rest-ftp-daemon.gemspec",
34
+ "test/helper.rb",
35
+ "test/test_rest-ftp-daemon.rb"
36
+ ]
37
+ s.homepage = "http://github.com/bmedici/rest-ftp-daemon"
38
+ s.licenses = ["MIT"]
39
+ s.require_paths = ["lib"]
40
+ s.rubygems_version = "1.8.23"
41
+ s.summary = "RESTful FTP client daemon"
17
42
 
18
- spec.files = `git ls-files -z`.split("\x0")
19
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
- spec.version = Settings[:version]
22
-
23
- spec.required_ruby_version = '>= 1.9.3'
24
-
25
- spec.add_development_dependency "bundler", "~> 1.6"
26
- spec.add_development_dependency "rake"
27
-
28
- spec.add_runtime_dependency "thin", "~> 1.6"
29
- spec.add_runtime_dependency "grape"
30
- spec.add_runtime_dependency "settingslogic"
31
- spec.add_runtime_dependency "haml"
32
- spec.add_runtime_dependency "json"
33
- spec.add_runtime_dependency "facter"
34
- spec.add_runtime_dependency "sys-cpu"
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 3
35
45
 
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<sinatra>, [">= 0"])
48
+ s.add_runtime_dependency(%q<json>, [">= 0"])
49
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
52
+ else
53
+ s.add_dependency(%q<sinatra>, [">= 0"])
54
+ s.add_dependency(%q<json>, [">= 0"])
55
+ s.add_dependency(%q<shoulda>, [">= 0"])
56
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
57
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
58
+ end
59
+ else
60
+ s.add_dependency(%q<sinatra>, [">= 0"])
61
+ s.add_dependency(%q<json>, [">= 0"])
62
+ s.add_dependency(%q<shoulda>, [">= 0"])
63
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
64
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
65
+ end
36
66
  end
67
+
metadata CHANGED
@@ -1,60 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-ftp-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: 0.9.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
- - Bruno MEDICI
8
+ - Bruno
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
12
+ date: 2014-08-01 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '1.6'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: thin
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '1.6'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.6'
55
- - !ruby/object:Gem::Dependency
56
- name: grape
15
+ name: sinatra
57
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
58
18
  requirements:
59
19
  - - ! '>='
60
20
  - !ruby/object:Gem::Version
@@ -62,27 +22,15 @@ dependencies:
62
22
  type: :runtime
63
23
  prerelease: false
64
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
65
26
  requirements:
66
27
  - - ! '>='
67
28
  - !ruby/object:Gem::Version
68
29
  version: '0'
69
30
  - !ruby/object:Gem::Dependency
70
- name: settingslogic
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ! '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ! '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: haml
31
+ name: json
85
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
86
34
  requirements:
87
35
  - - ! '>='
88
36
  - !ruby/object:Gem::Version
@@ -90,112 +38,110 @@ dependencies:
90
38
  type: :runtime
91
39
  prerelease: false
92
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
93
42
  requirements:
94
43
  - - ! '>='
95
44
  - !ruby/object:Gem::Version
96
45
  version: '0'
97
46
  - !ruby/object:Gem::Dependency
98
- name: json
47
+ name: shoulda
99
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
100
50
  requirements:
101
51
  - - ! '>='
102
52
  - !ruby/object:Gem::Version
103
53
  version: '0'
104
- type: :runtime
54
+ type: :development
105
55
  prerelease: false
106
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
107
58
  requirements:
108
59
  - - ! '>='
109
60
  - !ruby/object:Gem::Version
110
61
  version: '0'
111
62
  - !ruby/object:Gem::Dependency
112
- name: facter
63
+ name: bundler
113
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
114
66
  requirements:
115
- - - ! '>='
67
+ - - ~>
116
68
  - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
69
+ version: '1.0'
70
+ type: :development
119
71
  prerelease: false
120
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
121
74
  requirements:
122
- - - ! '>='
75
+ - - ~>
123
76
  - !ruby/object:Gem::Version
124
- version: '0'
77
+ version: '1.0'
125
78
  - !ruby/object:Gem::Dependency
126
- name: sys-cpu
79
+ name: jeweler
127
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
128
82
  requirements:
129
- - - ! '>='
83
+ - - ~>
130
84
  - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
85
+ version: 2.0.1
86
+ type: :development
133
87
  prerelease: false
134
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
135
90
  requirements:
136
- - - ! '>='
91
+ - - ~>
137
92
  - !ruby/object:Gem::Version
138
- version: '0'
93
+ version: 2.0.1
139
94
  description: This is a pretty simple FTP client daemon, controlled through a RESTfull
140
95
  API
141
96
  email: rest-ftp-daemon@bmconseil.com
142
97
  executables:
143
98
  - rest-ftp-daemon
144
99
  extensions: []
145
- extra_rdoc_files: []
100
+ extra_rdoc_files:
101
+ - LICENSE.txt
102
+ - README.md
146
103
  files:
147
- - .gitignore
148
104
  - Gemfile
149
105
  - Gemfile.lock
150
106
  - LICENSE.txt
151
107
  - README.md
152
108
  - Rakefile
109
+ - VERSION
153
110
  - bin/rest-ftp-daemon
154
- - config.ru
111
+ - lib/config.rb
112
+ - lib/config.ru
113
+ - lib/errors.rb
114
+ - lib/extend_threads.rb
155
115
  - lib/rest-ftp-daemon.rb
156
- - lib/rest-ftp-daemon/api/defaults.rb
157
- - lib/rest-ftp-daemon/api/jobs.rb
158
- - lib/rest-ftp-daemon/api/root.rb
159
- - lib/rest-ftp-daemon/api/workers.rb
160
- - lib/rest-ftp-daemon/common.rb
161
- - lib/rest-ftp-daemon/config.rb
162
- - lib/rest-ftp-daemon/exceptions.rb
163
- - lib/rest-ftp-daemon/job.rb
164
- - lib/rest-ftp-daemon/job_queue.rb
165
- - lib/rest-ftp-daemon/logger.rb
166
- - lib/rest-ftp-daemon/notification.rb
167
- - lib/rest-ftp-daemon/static/css/bootstrap.min.css
168
- - lib/rest-ftp-daemon/views/dashboard.haml
169
- - lib/rest-ftp-daemon/views/dashboard_jobs.haml
170
- - lib/rest-ftp-daemon/views/index.haml
171
- - lib/rest-ftp-daemon/worker_pool.rb
172
116
  - rest-ftp-daemon.gemspec
173
- - rest-ftp-daemon.yml.sample
174
117
  - test/helper.rb
175
118
  - test/test_rest-ftp-daemon.rb
176
119
  homepage: http://github.com/bmedici/rest-ftp-daemon
177
120
  licenses:
178
121
  - MIT
179
- metadata: {}
180
122
  post_install_message:
181
123
  rdoc_options: []
182
124
  require_paths:
183
125
  - lib
184
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
+ none: false
185
128
  requirements:
186
129
  - - ! '>='
187
130
  - !ruby/object:Gem::Version
188
- version: 1.9.3
131
+ version: '0'
132
+ segments:
133
+ - 0
134
+ hash: 3650939871823663291
189
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
+ none: false
190
137
  requirements:
191
138
  - - ! '>='
192
139
  - !ruby/object:Gem::Version
193
140
  version: '0'
194
141
  requirements: []
195
142
  rubyforge_project:
196
- rubygems_version: 2.4.1
143
+ rubygems_version: 1.8.23
197
144
  signing_key:
198
- specification_version: 4
145
+ specification_version: 3
199
146
  summary: RESTful FTP client daemon
200
147
  test_files: []
201
- has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWY3YjIzYTk0MzIyODlmMmE1MGE3ZTgzZWZkMjllY2JlYThkZjQ1YQ==
5
- data.tar.gz: !binary |-
6
- YWM0ZmUwNmU3YjY3NjBjZTAyYWEwYjZlYjJjMmNjZjJiZjc3MTJhMA==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- ZDUzMTU5NThlMWQ1Njk1YWY1YTgyOTg1ZDVjMWMxZjJkMmJhNzRhNmQ0NmYw
10
- NjhkZmFhOWFhZDIxZjY3NzNkMGRjMTA3Y2RmNDJiZDViZGQzYmJlNjYyMGM2
11
- ZWE4ZjI2ODgzZDk4MWRjOTU2ZjhhMmQzZjBkYTE0MjlkYjk5ZTQ=
12
- data.tar.gz: !binary |-
13
- ZjEzNjg4YmQ3Yjg5N2JjNTZhZTY0OGQwOWRjMDZmNTIyZjdlODFmNGI5OTQ3
14
- ZjBiNjcyYTZlMWZlMWRhOTFiMjI4MTIxMDEzM2QzNzM5YTA3MDk2ODc2NGIx
15
- YWZiZTk2NzNhZGYyNDQ2Y2YwN2I3OTI5ZjE0ODQyNTNjZmRkNWU=
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- pkg
2
- .bundle
3
- .DS_Store
4
- *.log
5
- tmp/
6
- work/
data/config.ru DELETED
@@ -1,14 +0,0 @@
1
- # Load gem files
2
- $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
3
- require 'rest-ftp-daemon'
4
-
5
- # Some extra constants
6
- APP_STARTED = Time.now
7
-
8
- # Create worker pool
9
- $queue = RestFtpDaemon::JobQueue.new
10
- $pool = RestFtpDaemon::WorkerPool.new(Settings.workers.to_i)
11
-
12
- # Start REST FTP Daemon
13
- use Rack::Static, :urls => ["/css", "/images"], :root => "lib/rest-ftp-daemon/static/"
14
- run Rack::Cascade.new [RestFtpDaemon::API::Root]