Difference between revisions of "DAViCal"

From dmfswiki
Jump to: navigation, search
(Created page with "[www.davical.org DAViCal]")
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[www.davical.org DAViCal]
+
[http://www.davical.org DAViCal] is an Open-Source CalDAV and CardDAV server.
 +
 
 +
== Setup ==
 +
 
 +
=== CalDAV-Sync ===
 +
* '''Server URL''': <nowiki><servername>:<port></nowiki>
 +
* '''Use SSL''': check accordingly
 +
* '''Username''': your login name
 +
* '''Password''': your password
 +
 
 +
If you run DAViCal in a subdirectory enter the path to your caldav.php
 +
 
 +
Example:
 +
 
 +
* '''Server URL''': <nowiki><servername>:<port>/davical/caldav.php/</nowiki>
 +
 
 +
To sync a shared resource of another user you have to enter the full path to this resource (optionally, see below to learn how to bind those resources)
 +
 
 +
Example:
 +
 
 +
* '''Server URL''': <nowiki><servername>:<port>/caldav.php/<username>/<calendarname>/</nowiki>
 +
 
 +
 
 +
=== CardDAV-Sync ===
 +
 
 +
The CardDAV setup is exactly like the CalDAV setup.
 +
 
 +
 
 +
== Sync shared resources ==
 +
 
 +
By default neither of the apps will find resources of another user you have access to. Luckily DAViCal supports the '''BIND''' request. You can use it to bind other resources to your own principal home. Here is a small script that makes it easy to send that request:
 +
 
 +
<pre>
 +
#!/bin/bash
 +
 
 +
BASE="$1"
 +
USER="$2"
 +
RESOURCE="$3"
 +
NAME="${4:-${3##*/}}"
 +
 
 +
URL="$BASE/caldav.php/$USER/"
 +
 
 +
 
 +
REQUEST=`cat <<EOF
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<bind xmlns="DAV:">
 +
    <segment>$NAME</segment>
 +
    <href>$RESOURCE</href>
 +
</bind>
 +
EOF`
 +
 
 +
echo $REQUEST | curl -k -d @- -X BIND -u $USER -H "content-type: text/xml charset=\"UTF-8\"" -H "user-agent: bind-script" $URL
 +
</pre>
 +
 
 +
Just save it to '''BIND.sh''' and call it like (don't forget to make it executable):
 +
 
 +
<pre>
 +
./BIND.sh https://SERVERBASE USERNAME SHARED_RESOURCE SEGMENT_NAME
 +
</pre>
 +
 
 +
'''SERVERBASE''' is the path to your caldav.php (without caldav.php and without trailing slash), use http:// instead of https:// if your server doesn't support SSL
 +
 
 +
'''USERNAME''' is the name of the user where to bind the resource to
 +
 
 +
'''SHARED_RESOURCE''' is the path to the resource you want to bind
 +
 
 +
'''SEGMENT_NAME''' is optional and the name of the new path segment, by default the script uses the last segment of '''SHARED_RESOURCE''' (Note: if that name already exists in your principal home you'll have to specify an other name)
 +
 
 +
Here is an example:
 +
 
 +
 
 +
Bind Bob's work calendar to Alice's principal home as bob_work:
 +
<pre>
 +
./BIND.sh https://example.com alice /caldav.php/bob/work bob_work
 +
</pre>
 +
 
 +
 
 +
If your DAViCal is not located in the server root, this should work (however, this is not tested):
 +
<pre>
 +
./BIND.sh https://example.com:8443/davical alice /davical/caldav.php/bob/work bob_work
 +
</pre>
 +
 
 +
Once you bound a resource CalDAV-Sync and CardDAV-Sync should find and sync it properly.
 +
 
 +
You can remove bindings in the DAViCal admin site.
 +
 
 +
 
 +
== Troubleshooting ==
 +
 
 +
If CardDAV-Sync doesn't sync or you can not set up an account, make sure you didn't change the DAV headers.
 +
Go to your DAViCal configuration file and look for a line beginning with
 +
 
 +
<pre>
 +
$c->override_dav_header = "..."
 +
</pre>
 +
 
 +
If that line exists comment it out (there should be no need for this line in recent DAViCal releases) or make sure it contains "addressbook" and "calendar-access". CalDAV-Sync and CardDAV-Sync won't sync if a collection is not advertised as calendar or address book by those headers.

Latest revision as of 10:44, 22 June 2012

DAViCal is an Open-Source CalDAV and CardDAV server.

Setup

CalDAV-Sync

  • Server URL: <servername>:<port>
  • Use SSL: check accordingly
  • Username: your login name
  • Password: your password

If you run DAViCal in a subdirectory enter the path to your caldav.php

Example:

  • Server URL: <servername>:<port>/davical/caldav.php/

To sync a shared resource of another user you have to enter the full path to this resource (optionally, see below to learn how to bind those resources)

Example:

  • Server URL: <servername>:<port>/caldav.php/<username>/<calendarname>/


CardDAV-Sync

The CardDAV setup is exactly like the CalDAV setup.


Sync shared resources

By default neither of the apps will find resources of another user you have access to. Luckily DAViCal supports the BIND request. You can use it to bind other resources to your own principal home. Here is a small script that makes it easy to send that request:

#!/bin/bash

BASE="$1"
USER="$2"
RESOURCE="$3"
NAME="${4:-${3##*/}}"

URL="$BASE/caldav.php/$USER/"


REQUEST=`cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<bind xmlns="DAV:">
    <segment>$NAME</segment>
    <href>$RESOURCE</href>
</bind>
EOF`

echo $REQUEST | curl -k -d @- -X BIND -u $USER -H "content-type: text/xml charset=\"UTF-8\"" -H "user-agent: bind-script" $URL

Just save it to BIND.sh and call it like (don't forget to make it executable):

./BIND.sh https://SERVERBASE USERNAME SHARED_RESOURCE SEGMENT_NAME

SERVERBASE is the path to your caldav.php (without caldav.php and without trailing slash), use http:// instead of https:// if your server doesn't support SSL

USERNAME is the name of the user where to bind the resource to

SHARED_RESOURCE is the path to the resource you want to bind

SEGMENT_NAME is optional and the name of the new path segment, by default the script uses the last segment of SHARED_RESOURCE (Note: if that name already exists in your principal home you'll have to specify an other name)

Here is an example:


Bind Bob's work calendar to Alice's principal home as bob_work:

./BIND.sh https://example.com alice /caldav.php/bob/work bob_work


If your DAViCal is not located in the server root, this should work (however, this is not tested):

./BIND.sh https://example.com:8443/davical alice /davical/caldav.php/bob/work bob_work

Once you bound a resource CalDAV-Sync and CardDAV-Sync should find and sync it properly.

You can remove bindings in the DAViCal admin site.


Troubleshooting

If CardDAV-Sync doesn't sync or you can not set up an account, make sure you didn't change the DAV headers. Go to your DAViCal configuration file and look for a line beginning with

$c->override_dav_header = "..."

If that line exists comment it out (there should be no need for this line in recent DAViCal releases) or make sure it contains "addressbook" and "calendar-access". CalDAV-Sync and CardDAV-Sync won't sync if a collection is not advertised as calendar or address book by those headers.