Archive for November 2007

She’s Here!

Sofia Dawn Rush, born 14 November 2007 at 6:29 pm via Caesarean section — 8 lbs, 12 oz., and 21 1/4 inches long.
I’m home for just a minute to pick up a thing or two and load up these pictures… we’ll be back home from the hospital tomorrow sometime, and I can post more pictures and information. Mother and baby are doing very well!


Dummies Guide to Darwin Calendar Server

I just realized a long-time dream of synchronizing iCal across multiple computers without a .Mac account, and so I thought I’d share the joy with anyone else who is interested.

Mac OS X 10.5 Leopard includes a new version of iCal that can connect to a CalDAV server, and so it’s simply a matter of setting up a CalDAV server. Leopard Server includes iCal Server, which I’m sure works just fine, but we haven’t upgraded our servers, and I don’t know when (or if) we’re planning to do so. However, iCal Server is available in an open source version, Darwin Calendar Server, which doesn’t include the Graphic Interface that I’m sure iCal Server includes.
Turns out that Darwin Calendar Server can be installed onto a Mac running Leopard (not necessarily Leopard Server) by a somewhat ordinary Joe like me without too much fuss. Here’s the skinny:

1. The first step is downloading the Calendar Server source, which is actually accomplished using Subversion, which is installed with the Leopard Developer Tools. (You can also get Subversion elsewhere, as mentioned on Mac OS Forge.) Once you have Subversion installed, open the Terminal, and type the following:

svn checkout http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk /Library/CalendarServer

This can apparently be done using XCode (also part of Leopard’s Developer Tools) but it wasn’t immediately obvious to me, since I’m not familiar with XCode.


2. Building the application from the source code is mercifully easy: move to the CalendarServer directory (cd /Library/CalendarServer) and run the following:
./run -s
The -s flag causes it to download the necessary supporting software and set up the service; this takes a little while, but it is verbose in its description, so it will be obvious when the process is complete.

3. Next, you’ll need to create a configuration file, which involves making a copy of the included configuration template:
cp ./conf/caldavd-test.plist ./conf/caldavd-dev.plist

4. This is the part that I was stuck on for a while: in order to access the server from another computer (which is the whole point of doing this), you need to edit this configuration file you just created (/Library/CalendarServer/conf/caldavd-dev.plist). In that file, find the BindAddresses entry and change the 127.0.0.1 to the IP address or DNS name of the machine you’re on. You can do this with Leopard’s Property List Editor, as shown below.
5. Next, read through the QuickStart page on Mac OS Forge regarding directory services… I just used the XMLDirectoryService, which is on by default; you might want to edit /Library/CalendarServer/conf/accounts-test.xml to add a login for yourself.

6. You can then test things out by running the server:

./run
Open iCal and go to the Accounts pane of the Preferences window. Add a new account and fill out the login information you added to the accounts-test.xml file. Click the disclosure arrow, and enter your server address followed by “:8008″ (i.e., myserver.com:8008) and leave the Kerberos checkbox unchecked. It should connect to the server and supply you with a default calendar (more can be added using the File > New Calendar submenu).

7. If things are working, you can quit the server by pressing Control-C in the terminal and run it as a background process by entering the following:

./run -d
This will run fine, but you’d have to remember to run it each time you restart the machine, so it’s better to make a startup item. There is a bit of a trick to this, because it requires fixing a little bug in the “run” script, but here’s how to do it:

8. To simplify the process of creating a launchd script (which is what will launch the server at system startup for you), download the latest OS X build of Lingon. Once you have downloaded it, open it up.

9. Click the “New” button to create a new service, and select “User Daemon” in the dialog that appears. Then enter the following information:
Name: com.apple.calendarserver
What: /Library/CalendarServer/run -d
When: Select “Run it when it is loaded by the system (at startup or login)”

10. Click “Save.” Now for the nitty-gritty part:

11. Navigate to /Library/CalendarServer/ and make a backup copy of the “run” script. Open the original in a text editor (I used TextEdit) and search for these lines (they’re toward the bottom of the script):
case “${USER}” in
  wsanchez)
    proto=”svn+ssh”;
    ;;
  *)
  proto=”svn”;
    ;;
esac;
svn_uri=”${proto}://svn.twistedmatrix.com/svn/Twisted/branches/dav-acl-1608-4″;
svn_get “Twisted” “${twisted}” “${svn_uri}” 19773;

Remove the necessary lines so that only these remain:
proto=”svn”;
svn_uri=”${proto}://svn.twistedmatrix.com/svn/Twisted/branches/dav-acl-1608-4″;
svn_get “Twisted” “${twisted}” “${svn_uri}” 19773;
Then find these:
case “${USER}” in

  cyrusdaboo)
    base=”svn+ssh://cdaboo@svn.osafoundation.org/svn”;
    ;;
  *)
  base=”http://svn.osafoundation.org”;
    ;;
esac;
svn_uri=”${base}/vobject/branches/users/cdaboo/vavailability-173″;
svn_get “vObject” “${vobject}” “${svn_uri}” 178;
put_setuptools “${vobject}”;


And replace them with these:

base=”http://svn.osafoundation.org”;
svn_uri=”${base}/vobject/branches/users/cdaboo/vavailability-173″;
svn_get “vObject” “${vobject}” “${svn_uri}” 178;
put_setuptools “${vobject}”;

12. Save your modified script and restart. iCal should now see the server running in the background.
This setup seems to have worked for me, and I’ve moved all my events from my regular iCal calendars into calendars that reside on my server (which can be done by dragging them to the new calendar in the Calendar list on the left). To do items are also managed this way, and the CalDAV server even synchronizes colors of calendars from machine to machine.