update dav4rack, tempblock some methods until we can cover them properly

This commit is contained in:
Kyle Drake 2019-09-03 00:16:41 -07:00
parent 71534eda41
commit 69ba17d081
3 changed files with 28 additions and 15 deletions

View file

@ -17,7 +17,7 @@ gem 'stripe', '4.2.0' #, source: 'https://code.stripe.com/'
gem 'terrapin'
gem 'zipruby'
gem 'sass', require: nil
gem 'dav4rack', git: 'https://github.com/planio-gmbh/dav4rack.git', branch: 'redmine-storage'
gem 'dav4rack', git: 'https://github.com/neocities/dav4rack.git', ref: '3ecde122a0b8bcc1d85581dc85ef3a7120b6a8f0'
gem 'filesize'
gem 'thread'
gem 'rack-cache'

View file

@ -1,12 +1,13 @@
GIT
remote: https://github.com/planio-gmbh/dav4rack.git
revision: ec491dccab4bcfa846bb4616c7177fb09819981c
branch: redmine-storage
remote: https://github.com/neocities/dav4rack.git
revision: 3ecde122a0b8bcc1d85581dc85ef3a7120b6a8f0
ref: 3ecde122a0b8bcc1d85581dc85ef3a7120b6a8f0
specs:
dav4rack (0.3.0)
nokogiri (>= 1.4.2)
dav4rack (1.1.0)
addressable (>= 2.5.0)
nokogiri (>= 1.6.0)
ox (>= 2.1.0)
rack (>= 1.1.0)
rack (>= 1.6)
uuidtools (~> 2.1.1)
GEM
@ -387,4 +388,4 @@ DEPENDENCIES
zipruby
BUNDLED WITH
2.0.1
2.0.2

View file

@ -43,21 +43,33 @@ map '/webdav' do
end
if env['REQUEST_METHOD'] == 'MOVE'
tmpfile = Tempfile.new 'moved_file'
tmpfile.close
destination = env['HTTP_DESTINATION'].match(/^.+\/webdav(.+)$/i).captures.first
FileUtils.cp site.files_path(env['PATH_INFO']), tmpfile.path
env['PATH_INFO'] = env['PATH_INFO'][1..env['PATH_INFO'].length] if env['PATH_INFO'][0] == '/'
DB.transaction do
@site.store_files [{filename: destination, tempfile: tmpfile}]
@site.delete_file env['PATH_INFO']
end
site_file = @site.site_files.select {|s| s.path == env['PATH_INFO']}.first
res = site_file.rename destination
return [201, {}, ['']]
end
if env['REQUEST_METHOD'] == 'COPY'
return [501, {}, ['']]
end
if env['REQUEST_METHOD'] == 'LOCK'
return [501, {}, ['']]
end
if env['REQUEST_METHOD'] == 'UNLOCK'
return [501, {}, ['']]
end
if env['REQUEST_METHOD'] == 'PROPPATCH'
return [501, {}, ['']]
end
if env['REQUEST_METHOD'] == 'DELETE'
@site.delete_file env['PATH_INFO']
return [201, {}, ['']]