Using a Raspberry Pi to synchronize data
Installing Baikal
The easiest way to install Baikal is by using the script from Listing 3, which loads the package into the /var/www/baikal
directory of the web server and activates the initial configuration. Line 10 creates an empty file for this process that then disappears after the first configuration.
Listing 3
Installing Baikal
01 #!/bin/bash 02 03 VERSION="0.2.6" 04 05 # Download and unpack 06 wget "http://baikal-server.com/get/baikal-flat-$VERSION.zip" 07 if [ -f "baikal-flat-$VERSION.zip" ]; then 08 unzip "baikal-flat-$VERSION.zip" -d /var/www 09 mv /var/www/baikal-flat /var/www/baikal 10 touch /var/www/baikal/Specific/ENABLE_INSTALL 11 chown -R www-data:www-data /var/www/baikal 12 rm -f "baikal-flat-$VERSION.zip" 13 fi
You can access the web-based initial configuration via the browser at http://<RasPi-IP>/baikal/. The configuration is limited to the entry of the time zone and administrative password. Thereafter, you should log in as Admin under http://<RasPi-IP>/baikal/admin/ and define users and the calendar (Figure 4)
Using Baikal
Aside from the admin user interface, Baikal does not offer any additional capabilities for administering users and calendars. You can view the calendar itself with all clients that support the CalDAV protocol (e.g., the lightening plugin for Thunderbird).
If you want a web front end for your calendar, you should install CalDavZAP [7] on the Raspberry Pi. Listing 4 displays the commands you will need for installation. You can adapt these to your requirements by entering the hostname, port, and version number at the top. The script also automatically edits a few lines of the configuration file config.js
, which is well commented but nonetheless poorly structured. After the installation, you will be able to comfortably access the calendar by browsing http://<RasPi-IP>/cal.
Listing 4
Installing CalDavZAP
01 #!/bin/bash 02 03 VERSION="0.10.0.1" 04 HOST="localhost" 05 PORT="8080" 06 07 # Download and unpack 08 wget "http://www.inf-it.com/CalDavZAP_$VERSION.zip" 09 if [ -f "CalDavZAP_$VERSION.zip" ]; then 10 unzip "CalDavZAP_$VERSION.zip" -d /var/www 11 mv /var/www/caldavzap /var/www/cal 12 sed -i -e "s%var globalInterfaceLanguage='en_US';%var \ globalInterfaceLanguage='de_DE';%" \ -e "s%//var globalUseJqueryAuth=false;%var \ globalUseJqueryAuth=true;%" \ -e "s%^var globalNetworkCheckSettings%//var \ globalNetworkCheckSettings%" \ -e "/http:\/\/lion/s%^//var \ globalNetworkCheckSettings%var \ globalNetworkCheckSettings%" -e "s%lion.server.com:8008/principals/\ users/%$HOST:$PORT/baikal/cal.php/principals/%" \ "/var/www/cal/config.js" 13 chown -R www-data:www-data /var/www/cal 14 rm -f "CalDavZAP_$VERSION.zip" 15 fi
The tool CardDavMATE [8] is similarly available for address data. It has an almost identical installation and configuration process, but there still appear to be problems once the user logs in.
More important than access via the browser is connecting mobile devices. Users of Apple products have no problems here because the programs from Apple are native speakers of the CalDAV and CardDAV protocols.
Android users have to install so-called sync adapters. The CalDAV-Sync and CardDAV-Sync applications are stable but not (yet) free of charge. Those users who want to go all open source can use Caldav Sync Free Beta or DAVdroid. You can download both of these from the Google Play store. Additionally, F-Droid is available for download as source code [9]. The first application ran for months for me without any problems, but DAVDroid still has stability and error issues.
Regardless of the software you select, the addresses for access to the Baikal server for a user having the ID tux and a work calendar and addressbook, each with the ID work, are: http://<RasPi-IP>/baikal/cal.php/calendars/tux/work and http://<RasPi-IP>/baikal/card.php/addressbooks/tux/work.
Buy this article as PDF
Pages: 8
(incl. VAT)