#!/bin/bash -l [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@" # davdroid setup instructions at the bottom # main docs: # http://radicale.org/user_documentation/ # https://davdroid.bitfire.at/configuration/ # note on debugging: if radicale can't bind to the address, # in the log it just says "Starting Radicale". If you run # it in the foreground, it will give more info. Background # plus debug does not help. # sudo -u radicale radicale -D -f # created password file with: # htpasswd -c /etc/davpass dav d=/etc/systemd/system/radicale.service.d mkdir -p $d sudo dd of=$d/override.conf <<'EOF' [Unit] # this unit is configured to start and stop whenever openvpn-client@mail.service # does After=network.target BindsTo=openvpn-client@mail.service After=openvpn-client@mail.service [Install] RequiredBy=openvpn-client@mail.service EOF pi radicale # I moved /var/lib/radicale after it's initialization. # I did a sudo -u radicale git init in the collections subfolder # after it gets created, per the git docs. lnf -T /o/radicale /var/lib/radicale # from https://www.williamjbowman.com/blog/2015/07/24/setting-up-webdav-caldav-and-carddav-servers/ # more config is for li in distro-end # coment in this file says this is needed for it to run on startup sed -ri 's/^\s*#+\s*(ENABLE_RADICALE\s*=\s*yes\s*)/\1/' /etc/default/radicale setini() { key="$1" value="$2" section="$3" file="/etc/radicale/config" sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key = $value" "$file" } # comments say default is 0.0.0.0:5232 setini hosts 10.8.0.4:5232 server if [[ $HOSTNAME == $MAIL_HOST ]]; then sgo radicale fi # disable power management feature, set to 240 min sync interval, # so it shouldn't be bad. # davdroid from f-druid. # login with url and user name # username ian, # url https://cal.iankelling.org # username ian # pass, see password manager # # add account dialog: # # set account name as ian@iankelling.org, per help text below the # field. # # switch to groups are per-contact categories, # per https://davdroid.bitfire.at/configuration/radicale/ # # # After setting up account, I added one address book, named # ianaddr. calender was already created, named ian. checked boxes under # both. synced. # # To restore from old phone to new phone, I wiped all data out, then copied over the newly created files. I think # # ignorable background info: # # opentasks uses the calendar file. # # The address book I created got a uuid as a name for the file. Note # the .props file says if it's a calendar or addressbook. # # When debugging, tailed /var/log/radicale/radicale.log and apache log, # both show the requests happening. Without creating the address book, # after creating a contact, a sync would delete it. # # Address books correspond to .props files in the radicale dir. # # Some background is here, # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/ # which shows separate vcard option is from rfc 6350, the other is 2426, # radicale page says it implements the former not the latter, # which conflicts with the documentation of which to select, but whatever. # http://radicale.org/technical_choices/ # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/ # # Note, url above says only cayanogenmod 13+ and omnirom can manage groups. # Note, radicale had built-in git support to track changes, but they # removed it in 2.0.