Can access WebDAV when redmine is located under sub-URI #377

This commit is contained in:
Karel Pičman 2015-04-15 10:20:14 +02:00
parent e15c56657d
commit 5dfde34127
3 changed files with 10 additions and 30 deletions

View File

@ -144,33 +144,12 @@ Before installing ensure that the Redmine instance is stopped.
1. In case of upgrade BACKUP YOUR DATABASE first
2. Put redmine_dmsf plugin directory into plugins
3. If you install Redmine in a sub-uri, it's necessary to modify two hard-coded paths in order to webdav is working:
a) /config/routes.rb
```ruby
mount DAV4Rack::Handler.new(
-- :root_uri_path => '/dmsf/webdav',
++ :root_uri_path => '/sub-uri/dmsf/webdav',
:resource_class => RedmineDmsf::Webdav::ResourceProxy,
:controller_class => RedmineDmsf::Webdav::Controller
), :at => "/dmsf/webdav"
```
b) lib/redmine_dmsf/webdav/no_parse.rb
```ruby
Rails.configuration.middleware.insert_before(ActionDispatch::ParamsParser,
-- RedmineDmsf::NoParse, :urls => ['/dmsf/webdav'])
++ RedmineDmsf::NoParse, :urls => ['/sub-uri/dmsf/webdav'])
```
4. Initialize/Update database: `rake redmine:plugins:migrate RAILS_ENV="production"`
5. The access rights must be set for web server, example: `chown -R www-data:www-data plugins/redmine_dmsf`
6. Restart web server
7. You should configure plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure
8. Assign DMSF permissions to appropriate roles
9. There are two rake tasks:
3. Initialize/Update database: `rake redmine:plugins:migrate RAILS_ENV="production"`
4. The access rights must be set for web server, example: `chown -R www-data:www-data plugins/redmine_dmsf`
5. Restart web server
6. You should configure plugin via Redmine interface: Administration -> Plugins -> DMSF -> Configure
7. Assign DMSF permissions to appropriate roles
8. There are two rake tasks:
a) To convert documents from the standard Redmine document module

View File

@ -111,7 +111,7 @@ RedmineApp::Application.routes.draw do
# DAV4Rack implementation of Webdav [note: if changing path you'll need to update lib/redmine_dmsf/webdav/no_parse.rb also]
# /dmsf/webdav
mount DAV4Rack::Handler.new(
:root_uri_path => "/dmsf/webdav",
:root_uri_path => "#{Redmine::Utils::relative_url_root}/dmsf/webdav",
:resource_class => RedmineDmsf::Webdav::ResourceProxy,
:controller_class => RedmineDmsf::Webdav::Controller
), :at => "/dmsf/webdav"

View File

@ -46,5 +46,6 @@ end
# This should probably be configurable somehow or better have the module hunt for the correct pathing
# automatically without the need to add a "/dmsf/webdav" configuration to it, as if the route is changed
# the functonality of this patch will effectively break.
Rails.configuration.middleware.insert_before(ActionDispatch::ParamsParser,
RedmineDmsf::NoParse, :urls => ['/dmsf/webdav'])
Rails.configuration.middleware.insert_before(
ActionDispatch::ParamsParser,
RedmineDmsf::NoParse, :urls => ["#{Redmine::Utils::relative_url_root}/dmsf/webdav"])