Ruby, WebDAV, and Mozilla Sunbird inquiry

J

James Britt

I recently downloaded Sunbird [0], the calendar application from the
Mozilla team. It looks OK, seems to do what I want, even at version 0.2.

It has a facility for sharing or exchanging calendar data. This
requires WebDAV [1], though. I'd rather not have to run Apache with
mod_webdav on every machine where I want to share a calendar. I'd
prefer to run a lighter Ruby process that handles the WebDAV requests.

A bigger reason for wanting to have a custom Ruby process handle the
calender sharing is that I want to be able to hook Sunbird into my wikis
and blogs. It would be sweet if could add a page to a wiki, use some
special markup to indicate that something has a deadline or an
associated calendar date, and have that info appear in all my calendars.
and vice versa.

I looked around but have not seen any Ruby WebDAV server code. Does
anyone know if any such thing exists? Something for WEBrick? Has anyone
looked into using Ruby to interact with Sunbird?

Thanks,


James


[0] http://www.mozilla.org/projects/calendar/sunbird.html
[1] http://www.webdav.org/
 
L

Lennon Day-Reynolds

There are actually relatively few open source WebDAV server
implementations, aside from mod_dav. In fact, I have yet to see a full
WebDAV client implementation for Ruby, which could complicate the Wiki
side of the equation, as well.

It's an area that would be nice to support for a number of potential
applications, most notably calendaring (both Sunbird and iCal use
WebDAV and vCard) and network backups and file transfers (ala "Web
Folders" on Windows).

Lennon
 
A

Andreas Schwarz

James said:
I recently downloaded Sunbird [0], the calendar application from the
Mozilla team. It looks OK, seems to do what I want, even at version 0.2.

It has a facility for sharing or exchanging calendar data. This
requires WebDAV [1], though. I'd rather not have to run Apache with
mod_webdav on every machine where I want to share a calendar.

The user sharing the calendar just needs access to a WebDAV server, he
doesn't have to run one himself.
I looked around but have not seen any Ruby WebDAV server code.

A WebDAV server seems to be a rather big project.
 
K

Kirk Haines

There are actually relatively few open source WebDAV server
implementations, aside from mod_dav. In fact, I have yet to see a
full WebDAV client implementation for Ruby, which could complicate
the Wiki side of the equation, as well.

It's an area that would be nice to support for a number of potential
applications, most notably calendaring (both Sunbird and iCal use
WebDAV and vCard) and network backups and file transfers (ala "Web
Folders" on Windows).

WebDAV doesn't look like a particularly difficult protocol to support. A
few months ago there was a little talk about using Iowa to support
applications to use other HTTP methods than GET and POST. Now that Iowa can
be easily integrated with WEBrick, it doesn't seem like it would be too hard
to extend WEBrick to allow the WebDAV HTTP methods to be accepted, and then
write an Iowa component that can handle them.

Anyone interested in lending me a hand or two in investigating this further
and in implementing a proof of concept?


Kirk Haines
 
K

Kirk Haines

On Wed, 25 Aug 2004 02:40:45 +0900, Andreas Schwarz wrote
A WebDAV server seems to be a rather big project.

For a full server implementing the entire protocol, maybe. However, it
doesn't look like it's a huge deal to implement partial support. Of course,
I could be terribly, horribly wrong about that, too. :)


Kirk Haines
 
J

James Britt

Kirk said:
On Wed, 25 Aug 2004 02:40:45 +0900, Andreas Schwarz wrote




For a full server implementing the entire protocol, maybe. However, it
doesn't look like it's a huge deal to implement partial support. Of course,
I could be terribly, horribly wrong about that, too. :)


I've only glanced through the WebDAV spec. For calendar sharing, it may
not be necessary to implement the entire spec. Just those commands
Sunbird uses to exchange iCal data.

Integration with wikis, blog, and whatever other Ruby apps sitting on
the server need not use WebDAV.

James
 
B

Brad T. Sliger

Kirk said:
WebDAV doesn't look like a particularly difficult protocol to support. A
few months ago there was a little talk about using Iowa to support
applications to use other HTTP methods than GET and POST. Now that Iowa
can be easily integrated with WEBrick, it doesn't seem like it would be
too hard to extend WEBrick to allow the WebDAV HTTP methods to be
accepted, and then write an Iowa component that can handle them.

Anyone interested in lending me a hand or two in investigating this
further and in implementing a proof of concept?

I'm interested and have some time. I'm toying with a project that'll
eventually want a WebDAV interface.

WEBrick should make a good framework, but I'm not at all familiar with Iowa.

So yeah, this sounds fun.

-- BTS
 
D

Dick Davies

* James Britt said:
I recently downloaded Sunbird [0], the calendar application from the
Mozilla team. It looks OK, seems to do what I want, even at version 0.2.

It has a facility for sharing or exchanging calendar data. This
requires WebDAV [1], though. I'd rather not have to run Apache with
mod_webdav on every machine where I want to share a calendar. I'd
prefer to run a lighter Ruby process that handles the WebDAV requests.

Surely you just want one webdav server to host the calendar?
A bigger reason for wanting to have a custom Ruby process handle the
calender sharing is that I want to be able to hook Sunbird into my wikis
and blogs. It would be sweet if could add a page to a wiki, use some
special markup to indicate that something has a deadline or an
associated calendar date, and have that info appear in all my calendars.
and vice versa.

That would be excellent. I think a ruby webdav *client* would be more useful
than a server for a lot of reasons:

* DAV is still a moving target
* all DAV clients suck

:)

--
"Would you tell me, please, which way I ought to go from here?"

"That depends a good deal on where you want to get to," said the Cat.
-- Lewis Carroll
Rasputin :: Jack of All Trades - Master of Nuns
 
J

James Britt

Dick said:
* James Britt said:
I recently downloaded Sunbird [0], the calendar application from the
Mozilla team. It looks OK, seems to do what I want, even at version 0.2.

It has a facility for sharing or exchanging calendar data. This
requires WebDAV [1], though. I'd rather not have to run Apache with
mod_webdav on every machine where I want to share a calendar. I'd
prefer to run a lighter Ruby process that handles the WebDAV requests.


Surely you just want one webdav server to host the calendar?

Here's a use case: I have three PCs in my house. I'd like to run
Sunbird on all of them. When I use Sunbird on my laptop, I want it to be
able to go exchange calendar data with the other 2 machines. Sunbird
speaks WebDAV, so something on the remote boxes must speak WebDAV, too.
(Actually, the may be other ways to do this by reading/writing Sunbird
calendars using another process, but using the built-in Sunbird stuff
seems simpler to start with.)

When search a server gets a request, I want it to serve up the calendars
info, but also have it go check other files/processes on the same
machine (such as wikis and blogs) to see if there is anything that
should be sent over as calendar data.

So I need a server process of some sort on each machine where I want to
serve up or accept calendar data.

Another scenario: A conference is listed on ruby-doc.org. I want
people to be able to point Sunbird at some ruby-doc.org URL and have it
fetch calendar events, so that the conference appears in their
calendars. But, I don't want to have to store an iCal file up on
ruby-doc.org. Just the blog/web site. The calendar-server code needs
to know how to accept WebDAV requests go grab calendar data from the
blog entries. Sort of a virtual iCal file proxy.
That would be excellent. I think a ruby webdav *client* would be more useful
than a server for a lot of reasons:

* DAV is still a moving target
* all DAV clients suck

I could be handy to have blogs, wikis, etc. speak WebDAV so that they
could interact with shared calendars. I believe there is some WebDAV
client code listed on the RAA.

James
 
L

Lennon Day-Reynolds

In your "home LAN" example, you really do only need one WebDAV server.
Each client (aka copy of Sunbird) then publishes a copy of its
calendar data to that server. When they exchange data, it's through
the server, not directly from client to client.

Looking at the Sunbird docs, it also appears that you can use FTP to
publish and subscribe to calendars. You'd lose iCal compatibility, but
it could be an effective stopgap until someone has a pure Ruby WebDAV
server ready to go.

FTP also lacks the one major weakness I've encountered with mod_dav:
it maintains its own permissions database, and files are all owned by
the apache process UID. That means that, if you're using mod_dav, you
can't offer WebDAV and direct (i.e., shell of FTP) access to the same
files. Very un-UNIX-y, IMHO.
 
M

Mark Hubbart

FTP also lacks the one major weakness I've encountered with mod_dav:
it maintains its own permissions database, and files are all owned by
the apache process UID. That means that, if you're using mod_dav, you
can't offer WebDAV and direct (i.e., shell of FTP) access to the same
files. Very un-UNIX-y, IMHO.

Yes, this is a major problem. All the more reason for a WebDAV server
written in Ruby! If there is a framework available for handling the
requests, it appears it would be simple to write a server that handles
permissions in an appropriate unix-y way :) If I can find any extra
time, this would certainly be a project I would want to work on. I find
the mod_dav implementation to be somewhat lacking.

I've been on the lookout for a good webdav server for a long time now
(ever since I moved to MacOS X, which treats it as a first-class
filesystem). I have toyed with the idea of building my own, but never
actually tackled it full force to see how much work it would really be.

cheers,
Mark
 
J

James Britt

Lennon said:
In your "home LAN" example, you really do only need one WebDAV server.
Each client (aka copy of Sunbird) then publishes a copy of its
calendar data to that server. When they exchange data, it's through
the server, not directly from client to client.

There's no assurance that any given machine will be running. I'd prefer
if I could just point to the machine (or URL) that has the data I want,
and pull it back. I also want to yank calendar info from applications
that are not aware they are providing ical data.

For example, I use a wiki as a PIM. It has names, addresss, birth
dates, project plans, and who knows what else.

If I add a wiki page to hold personal data about a friend, and that page
has a birthday date in it, I would like some process to magically
recognize that and add publish it as calendar data.

(Another way might be to write a wiki plugin such that a request to a
special wiki URL returns an ical response. Hmm ... )
Looking at the Sunbird docs, it also appears that you can use FTP to
publish and subscribe to calendars. You'd lose iCal compatibility, but
it could be an effective stopgap until someone has a pure Ruby WebDAV
server ready to go.


I did a simple experiment, and it appears that when Sunbird fetches a
remote calendar it does a simple GET. I was able to have WEBrick spit
back a text file with calendar data, and Sunbird added the events to my
calendar.

When I asked Sunbird to publish its calendar to WEBrick, it did a PUT.
I have to go examine the headers to see just what it was trying to send.

It may be that true WebDAV is not needed for Sunbird-specific interaction.


James
 
L

Lennon Day-Reynolds

A local "mini-DAV" server for calendaring would be great, especially
if it could advertise via Rendezvous. That could make Sunbird (and
likely iCal, if it worked with the server, as well) a "killer app" --
instead of using Exchange or another big centralized scheduling
system, just let everyone maintain their own calendar, and locate
other peoples' on demand with mDNS.

Of course, there would be disadvantages -- namely, as you suggest,
that individual machines may not be running 24/7, which means that the
calendar data they publish would be unavailable. I suppose that the
local client (or WebDAV server, if it functioned as a proxy) could
cache the latest calendar, though.
 
A

Aredridel

Another scenario: A conference is listed on ruby-doc.org. I want
people to be able to point Sunbird at some ruby-doc.org URL and have it
fetch calendar events, so that the conference appears in their
calendars. But, I don't want to have to store an iCal file up on
ruby-doc.org. Just the blog/web site. The calendar-server code needs
to know how to accept WebDAV requests go grab calendar data from the
blog entries. Sort of a virtual iCal file proxy.

That part of DAV is called HTTP GET ;-)

Seriously, one doesn't have to implement any of DAV for read-only
access. Just a CGI script would do for that.

Ari
 
A

Aredridel

FTP also lacks the one major weakness I've encountered with mod_dav:
Yes, this is a major problem. All the more reason for a WebDAV server
written in Ruby! If there is a framework available for handling the
requests, it appears it would be simple to write a server that handles
permissions in an appropriate unix-y way :) If I can find any extra
time, this would certainly be a project I would want to work on. I find
the mod_dav implementation to be somewhat lacking.

I, too, don't find joy in mod_dav. Its lack of unixy goodness is painful
to me, too.
I've been on the lookout for a good webdav server for a long time now
(ever since I moved to MacOS X, which treats it as a first-class
filesystem). I have toyed with the idea of building my own, but never
actually tackled it full force to see how much work it would really be.

It'd be quite a bit of work, but perfectly doable (especially with good
tools like REXML -- thanks Sean!)

It's something I'd be quite willing to help with. I rather think that
WEBrick is a good place to start -- the basic method handling is there,
and a DAV implementation could just start life as a servlet. (In fact, a
servlet would make a great place to start in implementing custom
services with a DAV interface)

If someones else would want to pass some code around, I'd be more than
willing to work on the project, too. It's something I see as having a
long-term benefit to my business.

Ari
 
J

James Britt

Aredridel said:
Seriously, one doesn't have to implement any of DAV for read-only
access. Just a CGI script would do for that.

Quite true, and what I've seen from Sunbird, all one needs to handle are
GET and PUT. Odd, though, that on the PUT no authentication info seems
to be passed form Sunbird.

But adding iCal export to blogs and wikis would be easy.

James
 
A

Aredridel

Quite true, and what I've seen from Sunbird, all one needs to handle are
GET and PUT. Odd, though, that on the PUT no authentication info seems
to be passed form Sunbird.

That would be challenge style. It will only send it if sent "403
Unauthenticated" with a WWW-Authenticate header. It will then retry with
credentials.

Ari
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top