pimutils / vdirsyncer

📇 Synchronize calendars and contacts.
https://vdirsyncer.pimutils.org/
Other
1.57k stars 163 forks source link

Question: Sample config file for Radicale #980

Open lamyergeier opened 2 years ago

lamyergeier commented 2 years ago

I checked: vdirsyncer/config.example at master · pimutils/vdirsyncer, but I am still confused about customizing it for my Radicale server, which has files as follows

$ cd ~/Radicale/collections/collection-root
$ tree

└── anish
    ├── 6229e809-b885-b85b-d83a-a799bfa7040e
    │   ├── 00120af9-a3d0-4044-90ef-1d5fa2366284.ics
    │   ├── 00b3014e-4a23-42bd-a3a7-ee759d5522bb.ics
    │   └── ffc953b7-09f6-4725-9c44-1969fde1a25a.ics
    ├── d994d01f-7150-c6d0-6d3d-b6c4d9ff8b30
    ├── e5b93e12-3aa4-b252-4bfe-ad683ec3bbd3
    ├── e8747b12-ac9d-d3f1-9ba6-2c71b8c2dd08
    └── f69ef521-c33a-43bd-eb2c-86e14d0fa447

So, I have 5 calendars, out of which 4 of them are empty and one of them has 3 events. Each one of these calendar has file .Radicale.props that describes the metadata of the calendar:

$ cat  6229e809-b885-b85b-d83a-a799bfa7040e/.Radicale.props | jq
{
  "C:supported-calendar-component-set": "VEVENT",
  "D:displayname": "Q1 People",
  "ICAL:calendar-color": "#ffababff",
  "tag": "VCALENDAR"
}

How to include all the calendars into vdirsync, so that I( can access it with khal?

WhyNotHugo commented 2 years ago

Something like this should work:

[general]
status_path = "~/.local/share/vdirsyncer/status/"

##### Calendars ######

[pair calendars]
a = "calendars_local"
b = "calendars_fastmail"
collections = ["from b"]
metadata = ["color", "displayname"]
conflict_resolution = ["command", "vimdiff"]

[storage calendars_local]
type = "filesystem"
path = "~/.local/share/calendars/"
fileext = ".ics"

[storage calendars_fastmail]
type = "caldav"
url = "https://example.com/some-path/"
username = "me@example.com"
password.fetch = ["command", "keyring", "get", "vdirsyncer", "me@example.com"]
# Using `password = "123"` also works.

If it doesn't, please post your whole config (without the password!!) and any output.

Sponge5 commented 2 years ago

This worked for me after using the value of username as some-path in the url. In this case url = "https://example.com/me@example.com" which of course isn't a valid URL.

WhyNotHugo commented 2 years ago

Using @ in a URL is perfectly valid: https://datatracker.ietf.org/doc/html/rfc3986#section-3.3

Off the top of my head, medium.com uses it for the URL of articles (using @username). Fastmail also uses @ in the URL for carddav collections.

WhyNotHugo commented 2 years ago

Note that @ is not valid for the domain part.

Sponge5 commented 2 years ago

Oops, sorry, you're right. Well you learn something everyday :)