Recently I had a need to publish a calendar in more than one location. Simple, right? Just use Google calendar, Boxes, or one of the other free services. Not quite. I don’t want to manage any users, nor give anyone direct access to an account that is hosting the calendar. I want to publish, not provide direct access to, the calendar.
The options for doing this seemed to boil down to using some form of iCal calendar (or similar), maintaining the master on a private system and publishing it to another system. This sounded promising, as I develop on OSX and have easy access to iCal to create and maintain the master calendar.
Publishing an iCal calendar is pretty straight-forward, but one of the constraints caused me some heartburn. Publishing iCal to a private server, as opposed to a .Mac account (which I don’t use) requires a password-protected WEBDav folder on the target server. No problem so far, as I have been WEBDav for quite some time and quickly and easily setup a folder on the target server.
Publishing the calendar directly from iCal to the new WEBDav folder worked flawlessly. But I need to publish it to another location, in this case a Netvibes desktop. No problem, right? Wrong. Netvibes today does not support a password-challenge in their (very cool) new calendar widget. So, it appeared for a moment that I would be unable to publish the iCal calendar on the private server and on the Netvibs desktop, getting live updates in each location.
And then I realized that the iCal calendar file is *just a file*. There’s nothing magic about it, and all Netvibes needed was a file in a non-password protected web-resolvable folder. So I simply created a new folder (plain folder) on the server and placed in it a single symlink to the original, live ics file that would be updated directly – and securely – from iCal.
Briefly, you create a new , plain folder (non-webdav) on the server where you are currently publishing your iCal ics file.
Place a single link in that folder to the password-protected, live ics file that exists in the webdav folder. Now, each time you publish a change in your calendar, it will get reflected in the live file and the link.
But what if you don’t want to make your clandar public? By placing it in a resolvable URL, a read-only version will indeed become public. Fortunately, password-protecting this is pretty easy.
Create two files in that same plain folder – .htaccess and .htusers. In .htaccess, list the name & type of auth you are using, point to the user files, and finally limit access to valid users. A sample .htaccess file looks like this:
AuthName "Work Area"<br />
AuthType Basic<br />
AuthUserFile /plain/folder/.htusers<br />
Now for the cool part. Create the above referenced .htusers file (with htpasswd) so it includes your Netvibes username and password.
For example, if your Netvibes username is “firstname.lastname@example.org” and your password is “secret”, then create the file like this:
htpasswd -bc .htusers email@example.com secret
Note that you must use the “” to escape the @ sign. You will now have a simple .htaccess protected folder that will always be satisfied with user credentials so long as you are logged in to Netvibes. If anyone else stumbles across that URL, they will be challenged for a username & password. And unless you give them your Netvibes username & password, the calendar will remain private.
In Netvibes, edit your calendar widget to point to the linked ics file. Oh, and be sure that that new URL is http only, as Netvibes seems not to be able to handle (yet) an https link in this widget.