Turns Contacts form a LDAP-Server into VCards and uploads them to a Baikal CardDav-Server.
- Install Baikal
- Install and configure MySQL
- Go to "YOUR_BAIKAL_SERVER.com/ and setup Baikal with the Installation Wizard
- In the Baikal Web Admin under Database settings connect your MySQL with your credentials
- Create the upload_contacts.sh, delete_contacts.sh, sync_contacts.sh and LDAP-to-VCard.py scripts and adjust the paths
- Connect to the Server with your set credentials
System Update
sudo apt update && sudo apt upgrade -y
Dependencies
sudo apt install apache2 php php-mysql libapache2-mod-php unzip wget curl
Baikal Download https://github.com/sabre-io/Baikal/releases
wget https://github.com/sabre-io/Baikal/releases/download/0.10.1/baikal-0.10.1.zip
unzip Baikal.zip -d /var/www/baikal
sudo chown -R www-data:www-data /var/www/baikal
sudo chmod -R 755 /var/www/baikal
Edit apache2 Configuration
sudo nano /etc/apache2/sites-available/baikal.conf
<VirtualHost *:80>
DocumentRoot /var/www/baikal/baikal/html
ServerName YOUR_BAIKAL_SERVER.com
RewriteEngine on
RewriteRule /.well-known/carddav /dav.php [R=308,L]
RewriteRule /.well-known/caldav /dav.php [R=308,L]
<Directory "/var/www/baikal/baikal/html">
Options None
AllowOverride None
Require all granted
</Directory>
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
</VirtualHost>
Starting Baikal
sudo a2ensite baikal.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo chmod -R 700 /var/www/baikal/baikal/Specific
sudo chmod -R 700 /var/www/baikal/baikal/config
Dependencies
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
Start MySQL
sudo systemctl start mysql
sudo systemctl enable mysql
Configure MySQL
sudo mysql -u root -p
CREATE DATABASE baikal_db;
CREATE USER 'baikal_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON baikal_db.* TO 'baikal_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Create the scripts, adjust the paths and make them executable:
sudo LDAP-to_VCard.py
sudo nano upload_contacts.sh
sudo nano delete_contacts.sh
sudo nano sync_contacts.sh
chmod +x SCRIPT_NAME.sh
Running the Sync once a day with:
crontab -e
0 0 * * * path/to/sync_contacts.sh