3 [[ $EUID == 0 ]] ||
exec sudo
-E "$BASH_SOURCE" "$@"
6 # davdroid setup instructions at the bottom
9 # http://radicale.org/user_documentation/
10 # https://davdroid.bitfire.at/configuration/
12 # note on debugging: if radicale can't bind to the address,
13 # in the log it just says "Starting Radicale". If you run
14 # it in the foreground, it will give more info. Background
15 # plus debug does not help.
16 # sudo -u radicale radicale -D -f
18 # created password file with:
19 # htpasswd -c /etc/davpass dav
21 d
=/etc
/systemd
/system
/radicale.service.d
23 sudo
dd of
=$d/override.conf
<<'EOF'
25 # this unit is configured to start and stop whenever openvpn-client@mail.service
28 BindsTo=openvpn-client@mail.service
29 After=openvpn-client@mail.service
32 RequiredBy=openvpn-client@mail.service
37 # I moved /var/lib/radicale after it's initialization.
38 # I did a sudo -u radicale git init in the collections subfolder
39 # after it gets created, per the git docs.
40 lnf
-T /o
/radicale
/var
/lib
/radicale
42 # from https://www.williamjbowman.com/blog/2015/07/24/setting-up-webdav-caldav-and-carddav-servers/
44 # more config is for li in distro-end
46 # coment in this file says this is needed for it to run on startup
47 sed -ri 's/^\s*#+\s*(ENABLE_RADICALE\s*=\s*yes\s*)/\1/' /etc
/default
/radicale
50 key
="$1" value
="$2" section
="$3"
51 file="/etc/radicale/config"
52 sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key = $value" "$file"
55 # comments say default is 0.0.0.0:5232
56 setini hosts
10.8.0.4:5232 server
58 if [[ $HOSTNAME == $MAIL_HOST ]]; then
62 # disable power management feature, set to 240 min sync interval,
63 # so it shouldn't be bad.
65 # davdroid from f-druid.
66 # login with url and user name
68 # url https://cal.iankelling.org
70 # pass, see password manager
74 # set account name as ian@iankelling.org, per help text below the
77 # switch to groups are per-contact categories,
78 # per https://davdroid.bitfire.at/configuration/radicale/
81 # After setting up account, I added one address book, named
82 # ianaddr. calender was already created, named ian. checked boxes under
85 # To restore from old phone to new phone, I wiped all data out, then copied over the newly created files. I think
87 # ignorable background info:
89 # opentasks uses the calendar file.
91 # The address book I created got a uuid as a name for the file. Note
92 # the .props file says if it's a calendar or addressbook.
94 # When debugging, tailed /var/log/radicale/radicale.log and apache log,
95 # both show the requests happening. Without creating the address book,
96 # after creating a contact, a sync would delete it.
98 # Address books correspond to .props files in the radicale dir.
100 # Some background is here,
101 # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/
102 # which shows separate vcard option is from rfc 6350, the other is 2426,
103 # radicale page says it implements the former not the latter,
104 # which conflicts with the documentation of which to select, but whatever.
105 # http://radicale.org/technical_choices/
106 # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/
108 # Note, url above says only cayanogenmod 13+ and omnirom can manage groups.
110 # Note, radicale had built-in git support to track changes, but they