PluginWebDav » History » Version 3

Arnaud Martel, 2010-08-03 13:31

1 3 Arnaud Martel
{{toc}}
2 3 Arnaud Martel
3 1 Arnaud Martel
h1. Introduction
4 1 Arnaud Martel
5 1 Arnaud Martel
This WebDav plugin is mainly a POC (proof of concept) for accessing files and documents using WebDav protocol. 
6 1 Arnaud Martel
This plugin is a fork of this existing railsdav plugin (""railsdav":http://github.com/funkensturm/railsdav) with some modifications to make it run with REDMINE.
7 1 Arnaud Martel
8 1 Arnaud Martel
This was done using REDMINE r3826 (=> 0.9.5 +) but any release after 0.9 should work
9 1 Arnaud Martel
10 1 Arnaud Martel
Main features:
11 1 Arnaud Martel
*  webdav access to a project is done using an url like http://myserver/redmine/webdav
12 1 Arnaud Martel
* the plugin allows you to see folders with the following structure:
13 1 Arnaud Martel
<pre>
14 1 Arnaud Martel
project1
15 1 Arnaud Martel
   + documents
16 1 Arnaud Martel
   |    + title_document1
17 1 Arnaud Martel
   |    |     + file1
18 1 Arnaud Martel
   |    |     + file2
19 1 Arnaud Martel
   |    |     
20 1 Arnaud Martel
   |    + title_document2
21 1 Arnaud Martel
   |          + file1
22 1 Arnaud Martel
   |          + file2
23 1 Arnaud Martel
   |
24 1 Arnaud Martel
   + files
25 2 Arnaud Martel
   |    + file1 (with no version)
26 2 Arnaud Martel
   |    + file2 (with no version)
27 2 Arnaud Martel
   |    + Version1
28 2 Arnaud Martel
   |    |     + file1
29 2 Arnaud Martel
   |    |     + file2
30 2 Arnaud Martel
   |    |
31 2 Arnaud Martel
   |    + Version2
32 2 Arnaud Martel
   |          + file1
33 2 Arnaud Martel
   |          + file2
34 2 Arnaud Martel
   |
35 2 Arnaud Martel
   + subversion
36 2 Arnaud Martel
        + branches
37 2 Arnaud Martel
        + tags
38 2 Arnaud Martel
        + trunk
39 1 Arnaud Martel
project2
40 1 Arnaud Martel
   + documents
41 1 Arnaud Martel
   + files
42 1 Arnaud Martel
project3
43 1 Arnaud Martel
   + documents
44 2 Arnaud Martel
   + subversion
45 1 Arnaud Martel
46 1 Arnaud Martel
</pre>
47 1 Arnaud Martel
* plugin is using REDMINE permissions (:view_files, :manage_files, :view_documents and :manage_documents) to grant access to files and folders/documents
48 1 Arnaud Martel
* plugin allows you all files operations (create, delete, rename, move and copy)
49 1 Arnaud Martel
* plugin allows you to create documents (just create a folder inside documents folder) but version creation is not allowed
50 3 Arnaud Martel
* plugin allows repository access through WEBDAV (Read/Write for subversion and filesystem SCM if repositories are on the redmine server, Read only for all others SCM supported in REDMINE)
51 2 Arnaud Martel
* folder names used (ie: files/documents/subversion in the example) can be changed through per project settings
52 1 Arnaud Martel
53 1 Arnaud Martel
54 1 Arnaud Martel
h1. Setup
55 1 Arnaud Martel
56 1 Arnaud Martel
WEBDAV is using basic HTTP authentication which is not supported in REDMINE core (at least in 0.9.5). A workaround is to use this very nice plugin "redmine_http_auth":http://github.com/AdamLantos/redmine_http_auth in conjunction with Apache and RedmineAdvanced.pm (located in  redmine_webdav/extra/svn)
57 1 Arnaud Martel
58 2 Arnaud Martel
_About subversion support:_
59 2 Arnaud Martel
To commit changes in Subversion, the plugin opens the repository with the file protocol. For this reason, you need the following:
60 2 Arnaud Martel
* The repositories have to be installed on the REDMINE server.
61 2 Arnaud Martel
* Plugin will replace the beginning of your repository location ([protocol]://[server]/" with "file:///svnroot/". You may need to create a symbolic link /svnroot for this to work...  
62 2 Arnaud Martel
63 1 Arnaud Martel
h3. 1. Install plugin into vendor/plugins
64 1 Arnaud Martel
65 1 Arnaud Martel
If you want to install redmine_http_auth, run the following command from your redmine directory:
66 1 Arnaud Martel
* ruby script/plugin install http://github.com/AdamLantos/redmine_http_auth.git
67 1 Arnaud Martel
68 1 Arnaud Martel
Then install redmine_webdav with:
69 1 Arnaud Martel
* ruby script/plugin install http://github.com/amartel/redmine_webdav.git
70 2 Arnaud Martel
* rake db:migrate_plugins RAILS_ENV="production"
71 1 Arnaud Martel
72 1 Arnaud Martel
h3. 2. Get the required gems
73 1 Arnaud Martel
74 1 Arnaud Martel
<a href="http://github.com/stueccles/railsdav">Railsdav</a> needs these 2 plugins:
75 1 Arnaud Martel
* unicode
76 1 Arnaud Martel
* shared-mime-info
77 1 Arnaud Martel
78 1 Arnaud Martel
Under linux, install is done with:
79 1 Arnaud Martel
* sudo gem install unicode
80 1 Arnaud Martel
* sudo gem install shared-mime-info
81 1 Arnaud Martel
82 1 Arnaud Martel
h3. 3. Configure your web server
83 1 Arnaud Martel
84 1 Arnaud Martel
Assuming you are using RHEL5/CentOS5:
85 1 Arnaud Martel
* Copy redmine_webdav/extra/svn/RedmineAdavanced.pm in /etc/httpd/Apache/Authn
86 1 Arnaud Martel
* Create the file /etc/httpd/conf.d/redmine_webdav.conf
87 1 Arnaud Martel
88 1 Arnaud Martel
<pre>
89 1 Arnaud Martel
<Location /redmine/webdav>
90 1 Arnaud Martel
   AuthType Basic
91 1 Arnaud Martel
   AuthName REDMINE
92 1 Arnaud Martel
   Require valid-user
93 1 Arnaud Martel
   PerlAccessHandler Apache::Authn::RedmineAdvanced::access_handler
94 1 Arnaud Martel
   PerlAuthenHandler Apache::Authn::RedmineAdvanced::authen_handler
95 1 Arnaud Martel
   RedmineDSN "DBI:mysql:database=redmine;host=192.168.10.1;port=3306"
96 1 Arnaud Martel
   RedmineDbUser "redmine"
97 1 Arnaud Martel
   RedmineDbPass "password"
98 1 Arnaud Martel
   RedmineAuthenticationOnly "On"
99 1 Arnaud Martel
  Order allow,deny
100 1 Arnaud Martel
  Allow from 127.0.0.1
101 1 Arnaud Martel
  Satisfy Any
102 1 Arnaud Martel
</Location>
103 1 Arnaud Martel
</pre>
104 1 Arnaud Martel
105 1 Arnaud Martel
h3. 4. Restart your web server
106 1 Arnaud Martel
107 1 Arnaud Martel
/etc/init.d/httpd restart
108 1 Arnaud Martel
109 1 Arnaud Martel
h3. 5. Configure REDMINE with your web browser
110 1 Arnaud Martel
111 1 Arnaud Martel
If everything is OK, you should see both plugins (WebDav and HTTP authentication) in the plugin list (Administration -> Plugins)
112 1 Arnaud Martel
113 2 Arnaud Martel
New permissions are now available and you have to assign them to the roles you need
114 1 Arnaud Martel
115 1 Arnaud Martel
h3. 6. Set up your project
116 1 Arnaud Martel
117 1 Arnaud Martel
Don't forget to activate the webdav module in the projects where you want to access files over WevDav
118 1 Arnaud Martel
119 1 Arnaud Martel
h3. 7. Use webdav to manage files and documents
120 1 Arnaud Martel
121 1 Arnaud Martel
You have to use a WebDav client in order to use the plugin. 
122 1 Arnaud Martel
123 1 Arnaud Martel
For MacOSX (webdav access is natively supported):
124 1 Arnaud Martel
* Open the finder and choose "Go to -> Connect to server..."
125 1 Arnaud Martel
* enter *http://myserver/redmine/webdav* as the url of the server
126 1 Arnaud Martel
* enter your credentials (login/password)
127 1 Arnaud Martel
* You're in
128 1 Arnaud Martel
129 1 Arnaud Martel
130 1 Arnaud Martel
For linux:
131 1 Arnaud Martel
TODO
132 1 Arnaud Martel
133 1 Arnaud Martel
For WindowsXP:
134 1 Arnaud Martel
* Open *My Network Places*.
135 1 Arnaud Martel
* Double-click *Add Network Place*.
136 1 Arnaud Martel
* Click Next twice, then type *http://myserver/redmine/webdav*
137 1 Arnaud Martel
* Click Next
138 1 Arnaud Martel
* enter your credentials (login/password)
139 1 Arnaud Martel
* Click Finish
140 1 Arnaud Martel
141 1 Arnaud Martel
142 1 Arnaud Martel
143 1 Arnaud Martel
144 1 Arnaud Martel
h1. Original author's README:
145 1 Arnaud Martel
146 1 Arnaud Martel
Railsdav (WebDAV for Ruby On Rails)
147 1 Arnaud Martel
===================================
148 1 Arnaud Martel
149 1 Arnaud Martel
THIS IS A MODIFIED VERSION OF THE ORIGINAL Railsdav, created by Marcello Nuccio.  I have done it because I was not able to make to use the original one.
150 1 Arnaud Martel
151 1 Arnaud Martel
152 1 Arnaud Martel
READ COMMENTS IN lib/acts_as_webdav.rb TO START!
153 1 Arnaud Martel
154 1 Arnaud Martel
155 1 Arnaud Martel
Railsdav is a plugin which allows for custom WebDAV controllers to be added to a Ruby On Rails application to expose functionality as filesystems to WebDAV clients such as Mac OS X Finder, Windows Network Places, Dreamweaver etc.
156 1 Arnaud Martel
157 1 Arnaud Martel
Railsdav requires the following gems in addition to rails
158 1 Arnaud Martel
159 1 Arnaud Martel
* unicode (gem install unicode)
160 1 Arnaud Martel
* shared-mime-info (gem install shared-mime-info)
161 1 Arnaud Martel
162 1 Arnaud Martel
Railsdav was created by Stuart Eccles (http://www.liverail.net/). I'd like to thank the following people for assisting with Railsdav
163 1 Arnaud Martel
164 1 Arnaud Martel
*   Albert Ramstedt who contributed bug fixes for a variety of code issues and helped with re-structuring the plugin
165 1 Arnaud Martel
*   Alex MacCaw
166 1 Arnaud Martel
*   Fabien Franzen
167 3 Arnaud Martel
168 3 Arnaud Martel
h1. History
169 3 Arnaud Martel
170 3 Arnaud Martel
0.1.1 : 2010-08-03
171 3 Arnaud Martel
* new: support WRITE operations for filesystem SCM
172 3 Arnaud Martel
173 3 Arnaud Martel
0.1.0 : 2010-07-23
174 3 Arnaud Martel
Minor evolution with refactoring...
175 3 Arnaud Martel
176 3 Arnaud Martel
* new: add repository access through WEBDAV (Read/Write for subversion if repositories are on the redmine server, Read only for all others supported SCM)
177 3 Arnaud Martel
* new: settings per project with new permission (manage WEBDAV)
178 3 Arnaud Martel
179 3 Arnaud Martel
0.0.1 : 2010-07-06
180 3 Arnaud Martel
Initial release