Content-space.de

The WikiBlog of Michael Hamann about changing technologies and more

User Tools

Site Tools


projekte:dokufs

DokuFS

DokuFS is a filesystem that allows, with the help of Fuse, to mount a DokuWiki over XML-RPC into you local filesystem on Linux.

You are then able to browse the filesystem and to create, edit or delete files, that means to create, edit or delete pages or media files on the Wiki you have mounted. Deleting, moving and copying of whole namespaces should work, too (however the history of pages is not moved).

All pages have the extension .dw so you can easily handle syntax highlighting (syntax highlighting for vim is included in the unfortunately discontinued DokuVimKi project, though you don't need the rest of DokuVimKi when using DokuFS).

DokuFS supports two modes – one for pages and one for media files. In the mode for pages the creation of other files but those with the extension .dw isn't allowed (temporary files of VIM and Emacs are handled in memory). In the mode for media files every file is simply uploaded to the DokuWiki, so basically all file types are allowed that are supported by your DokuWiki installation.

Every 5 minutes, the recent changes of the Wiki are pulled and the directory structure is updated. Once a page is downloaded it will be in a cache (with a memory limit) so that only the first read/size-request will be slow.

Some notes on the current version

The current version has to be considered as alpha version as nobody besides me has ever used DokuFS. Known issues are:

  • There is no recognition if a file was saved correctly or not. When you are admin this might not be an issue, but when you are not sure if you have permission to write/create the page, you should better see if the page was really saved (just reading it's content again should be sufficient).
  • When the file/pagename wasn't accepted/changed by DokuWiki there might be undefined stages, including the appearance under the original and the corrected filename in the directory-structure.

License

Copyright (C) 2009 Michael Hamann

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The idea of this program and some of the recursive functions here are adapted versions of MetaFS which was written by Greg Millam and distributed with FuseFS.

Installation

DokuFS runs on Linux, it might work on Mac OS X and from all I know it doesn't work on Windows.

First of all you need a working Ruby-installation and of course DokuWiki with enabled XML-RPC-backend (note that you need to enable it and set a user that can access the wiki over XML-RPC, allowing access for all users is not recommended).

You need FuseFS in order to use DokuFS. In Debian and Ubuntu (and derivates of them) it is provided in a package named libfusefs-ruby. In Gentoo there is a package named fusefs and in ArchLinux it is in the AUR. In all other cases there are instructions in README.txt which is distributed with FuseFS.

You can download the latest version of DokuFS from its git repository. You just need the file dokufs.rb and then you should make it executable with

chmod +x dokufs.rb

. You might want to put DokuFS in one of your directories in $PATH, this might be ~/bin/.

Usage

Usage: dokufs.rb [options] directory
    -u, --user USER                  The username
    -p, --password PASSWORD          The password
    -s, --server SERVER              The server to use (default: localhost)
        --path PATH                  The path to XMLRPC (default: /lib/exe/xmlrpc.php)
        --[no-]ssl                   Use (no) ssl (default: use ssl)
    -m, --media                      Display media files instead of wiki pages
        --update-interval INTERVAL   The update interval in seconds
    -n, --no-cache                   Don't use the cache - this will cause a significantly higher load on the server. (default: use cache)
    -h, --help                       Show this message

Some notes on that: Server is the domain name of the server the DokuWiki you want to mount is on. Don't include a protocol (e.g. http) here. You only need to specify the path when you DokuWiki-installation is not in the root directory of your domain. Using SSL is highly recommended, only use disable ssl when you don't have any other option.

Creating new directories allows you to create new pages in new namespaces, but this creation itself has no effect on the Wiki.

When the first line of a file begins with %, everything after this % (and an optional whitespace) up to the end of the line is considered as commit message. When saving an empty file or a file that contains only a line beginning with %, the page is deleted. So you can delete a page playground:test with the message “foo bar” by calling

echo "% foo bar" > playground/test.dw

Unmounting the filesystem is bit tricky. You have to call

fusermount -u path/to/dokuwiki/

and at least on my system DokuFS doesn't terminate itself, you have to kill it, e.g. by pressing [ctrl]+[c].

If there are any further questions or requests, you may contact me using comments here or you can send me an email at michael <at> content-space.de. Jabber is available, too, the address is the same as my email-address.

Comments

juhu! genau danach habe ich gerade gesucht! damit könnte die migration eine oddmuse wikis einfacher vonstatten gehen. werde berichten…

1 |
igor
| 2008/06/05 21:19 | reply

great project, any idea on how to port this to MacFUSE?

2 | | 2008/09/25 18:44 | reply

There is an article on using fusefs on mac, that means exactly the fusefs I am using, so there are chances it will work. I would be happy to hear if it did work.

3 | | 2008/10/11 22:52 | reply

Great project! thx!

Works good for already existings wiki pages, however i'm not able to create any new wiki pages or namespaces. Do i have to set special ACL settings? I'm conecting with the superuser.

The second problem i have is with the media view. i can mount it and see everything but i can not change here anything, not even existing files.

The last thing i noticed is, that the filesystem doesn't return any information how much space is left. Not even a fake information. Is this only a problem on my side?

I'm testing here with the latest ubuntu and on mac os x. I have the latest dokuwiki installed.

greets max

4 |
max
| 2009/03/03 12:46 | reply

Hi max,

is it possible that the user or the password you specified is wrong? Unfortunately in the current release there isn't any way to see if the login was successful or not. Could you please create a page anonymous users can't see and test if it appears in the filesystem?

Concerning left space: There isn't any way to return such information in the API of FuseFS, that's part of the limitations I described in the blog article recently.

5 | | 2009/03/05 21:09 | reply
R I P N K
projekte/dokufs.txt · Last modified: by michitux