in ,

Rediscovering CardDAV, Hacker News

I can no longer sync iOS ’Contacts with my macOS Catalina’s Finder; the OS insists I’ve iCloud configured for Contacts which I do not. I’ve gone through all the steps Apple recommends, done the upgrades and the reboots, but there’s nothing doing. All the swearing and threatening of moving to a different operating system aren’t really helping. This started sometime after I wrote about setting up macOS to “dial” a number using a shell script , but it cannot be related.

I was spilling my sorrows on Christoph who simply said he avoids all those issues by using CardDAV . I slapped my forehead: I’ve been using CalDAV for years, for synchronizing two calendars across devices: my own calendar across two Macs, an iPad , and an iPhone, and the family calendar across the family’s devices. How could I have forgotten about CardDAV ?

Baïkal has served us well for many years (the modification timestamp on the configuration reads August 2019. Before looking at using it for CardDAV I thought I’d put it on my little FreeBSD system in a BastilleBSD jail. The calendar migration was easy enough but produced a liter or two of adrenalin when I watched one calendar after the other disappear from iCal. Anyway, I got the data imported and our small family was back in sync.

I then created a Baïkal address book for myself, set up macOS and an iPhone to use that, and created a pseudo person’s entry on the Mac and another on iOS, and experimented a bit with how long it takes either side to sync, etc. As soon as I was satisfied I copy / pasted all contacts from macOS ’internal address book to its CardDAV store. When my contacts showed up on the iPhone, I knew I was half in business. After an additional backup I cleared out all the local contacts on the Mac.

Android

I recently had to purchase a new old phone for testing OwnTracks on Android and settled for a used Samsung Galaxy S8, a device which vastly exceeded my expectations. A really nice piece of kit, if only it weren’t for Android … #halfkidding

I went the whole hog and decided to see how well I could work with the S8 and purchased a copy of screenshot of contact on Galaxy S8 DAVx5 which is a really good and well thought-out bit of software. There’s an Open Source but I decided to pay for the software – developers must live off something other than applause and fresh air.

I can create, edit, and delete contacts on the S8 and DAVx5 will synchronize them back via CardDAV to my server. Just the way it ought to be.

screenshot of contact on Galaxy S8 CLI FreeBSD / Linux

I mostly use

Mutt as an email client which means I want to be able to integrate whichever solution I come up with with these tools. A quick search led me to install vdirsyncer which enables me to synchronize my CardDAV server with a local directory of VCard files on the file system. If I change any of these files the utility can then synchronize the changes back to the server. (Source code: vdirsyncer .) The program’s configuration file reminds me of OfflineIMAP’s and its operating principles are similar: I configure a local and a remote store which are kept in sync.

   (export  (REQUESTS_CA_BUNDLE)  
=mensCA.crt 
 $  

vdirsyncer discover
 $  vdirsyncer  sync 
      

Now that I have a set of VCard files in a directory, I can use

khard , an address book for the Unix command line, which reads, creates, and modifies these files, and which can also be (integrated with other programs , suitable for my use with Mutt .

  khard new .. 
 $  

khard edit ..
   ($)  vdirsyncer 
 - v  WARNING  sync  
 $  

khard list jolie
 Address book: jpm-ab Index Name Phone Email 1 Jolie, Jane work, pref:    work, pref: [email protected]    ($)  khard show jolie 
 Name: Jane Jolie Full name: Jane Jolie Address book: jpm-ab General:     Birthday: 2020 - 12 - 23     Nickname: jj Phone     work, pref:    E-Mail     work, pref: [email protected] Private:     OwnTracks: owntracks / jjolie / s8 Miscellaneous     UID: 6302547 cfe6 -  (f - (d3-aabf-b3bab)      Webpage:    - _ $  
! 

 ($ _) : jj.example.org 
 Note: Actress    

Khard is just an example; Any program able to read or manipulate VCard files would be suitable.

Thunderbird

Thunderbird isn't a client I use, but if I moved to FreeBSD or one of its desktop siblings, I likely would (in addition to Mutt), so I thought I'd do you the favor and see how well it supports CardDAV. It doesn't really, because it lacks built-in support for CardDAV , but I found TBsync

which, with Dav-4-TbSync

, allow me to synchronize my CardDAV and CalDAV stores to it. I tested this on FreeBSD , and it seems to work well enough at a first glance.

I can edit address book entries on Thunderbird and thanks to a builtin scheduler can automatically (or on-demand) synchronize changes back to the server. TbSync is open source

and there's a short
getting started

page.

The Coronavirus isolation and my speaking more with friends inspired this blog post. Thank you, Christoph, for the heads up.

        

(Read More)

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Coronavirus latest: UK prime minister Boris Johnson discharged from hospital – Financial Times, Financial Times

Labels on beta, hacker news

Labels on beta, hacker news