lots of stuff lumped together
[distro-setup] / radicale-setup
1 #!/bin/bash -l
2
3 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
4
5
6 # davdroid setup instructions at the bottom
7
8 # main docs:
9 # http://radicale.org/user_documentation/
10 # https://davdroid.bitfire.at/configuration/
11
12
13 # created password file with:
14 # htpasswd -c /etc/davpass dav
15
16
17 pi radicale
18
19 # I moved /var/lib/radicale after it's initialization.
20 # I did a sudo -u radicale git init in the collections subfolder
21 # after it gets created, per the git docs.
22 lnf -T /o/radicale /var/lib/radicale
23
24 # from https://www.williamjbowman.com/blog/2015/07/24/setting-up-webdav-caldav-and-carddav-servers/
25
26 # more config is for li in distro-end
27
28 # coment in this file says this is needed for it to run on startup
29 sed -ri 's/^\s*#+\s*(ENABLE_RADICALE\s*=\s*yes\s*)/\1/' /etc/default/radicale
30
31 setini() {
32 key="$1" value="$2" section="$3"
33 file="/etc/radicale/config"
34 sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key = $value" "$file"
35 }
36
37 # comments say default is 0.0.0.0:5232
38 setini hosts 10.8.0.4:5232 server
39 sgo radicale
40
41 # davdroid from f-droid.
42 # login with url and user name
43 # username ian,
44 # url https://cal.iankelling.org
45 # username ian
46 # pass, see password manager
47 # I disabled power management feature, it's got 240 min sync interval,
48 # so it shouldn't be bad.
49 #
50
51 # when setting up davdroid, switch to groups are per-contact categories,
52 # per https://davdroid.bitfire.at/configuration/radicale/
53 #
54 # set account name as ian@iankelling.org, per help text below the
55 # field.
56 #
57 # After setting up account, I added one address book, named
58 # ian. calender was already created, named ian. checked boxes under
59 # both. synced.
60 #
61 # ignorable background info:
62 #
63 # When debugging, tailed /var/log/radicale/radicale.log and nginx log,
64 # both show the requests happening. Without creating the address book,
65 # after creating a contact, a sync would delete it.
66 #
67 # Address books correspond to .props files in the radicale dir.
68 #
69 # Some background is here,
70 # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/
71 # which shows separate vcard option is from rfc 6350, the other is 2426,
72 # radicale page says it implements the former not the latter,
73 # which conflicts with the documentation of which to select, but whatever.
74 # http://radicale.org/technical_choices/
75 # https://davdroid.bitfire.at/faq/entry/cant-manage-groups-on-device/
76 #
77 # Note, url above says only cayanogenmod 13+ and omnirom can manage groups.
78
79 # Note, radicale had built-in git support to track changes, but they
80 # removed it in 2.0.