mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
update dav4rack, tempblock some methods until we can cover them properly
This commit is contained in:
parent
71534eda41
commit
69ba17d081
3 changed files with 28 additions and 15 deletions
2
Gemfile
2
Gemfile
|
@ -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'
|
||||
|
|
15
Gemfile.lock
15
Gemfile.lock
|
@ -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
|
||||
|
|
26
config.ru
26
config.ru
|
@ -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, {}, ['']]
|
||||
|
|
Loading…
Add table
Reference in a new issue