dengste / org-caldav

Caldav sync for Emacs orgmode
GNU General Public License v3.0
724 stars 105 forks source link

Connecting to Etesync-Dav #228

Closed pauljamesharper closed 3 years ago

pauljamesharper commented 3 years ago

I am unable to get Org-Caldav to work with etesync-dav. https://github.com/etesync/etesync-dav

I have etesync-dav working correctly in Thunderbird as per instruction on github.

Unsure of how to proceed to troubleshoot what the URL should be. I tried:

~ $ curl -D OPTIONS --basic -u user:secretpassword  http://localhost:37358/user/5E18WvJazTPygkhZTF7HpUUs9XXN5Hu2/

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//PYVOBJECT//NONSGML Version 1//EN
X-WR-CALNAME;VALUE=TEXT:Calendar
BEGIN:VTIMEZONE
TZID:Africa/Cairo
BEGIN:STANDARD
DTSTART:19700101T000000
TZNAME:EET
TZOFFSETFROM:+0200
TZOFFSETTO:+0200
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:9201b950-f023-494b-9c09-be31eaffb77d
DTSTART;TZID=Africa/Cairo:20210226T213000
DTEND;TZID=Africa/Cairo:20210226T223000
CREATED:20210224T074520Z
DTSTAMP:20210224T074601Z
LAST-MODIFIED:20210224T074601Z
SEQUENCE:1
SUMMARY:Test
X-MOZ-GENERATION:1
END:VEVENT
END:VCALENDAR

When I go to that link in a browser I put in my password and it launches an .ics file.

pauljamesharper commented 3 years ago

Got this working finally. Looking at the calendar link for Etesync-Dav in the format:

http://localhost:37358/username goes in the (setq org-caldav-url "http://localhost:37358/username")

And the Calender ID is not MyCalendar but you use the UUID 5E18WvJazTPygkhZTF7HpUUs9XXN5Hu2 in

'((:calendar-id "5E18WvJazTPygkhZTF7HpUUs9XXN5Hu2"

My working ~/.emacs:

`

+begin_src emacs-lisp

(use-package org-caldav :init ;; This is the sync on close function; it also prompts for save after syncing so ;; no late changes get lost (defun org-caldav-sync-at-close () (org-caldav-sync) (save-some-buffers))

;; This is the delayed sync function; it waits until emacs has been idle for ;; "secs" seconds before syncing. The delay is important because the caldav-sync ;; can take five or ten seconds, which would be painful if it did that right at save.
;; This way it just waits until you've been idle for a while to avoid disturbing ;; the user. (defvar org-caldav-sync-timer nil "Timer that `org-caldav-push-timer' used to reschedule itself, or nil.") (defun org-caldav-sync-with-delay (secs) (when org-caldav-sync-timer (cancel-timer org-caldav-sync-timer)) (setq org-caldav-sync-timer (run-with-idle-timer (* 1 secs) nil 'org-caldav-sync)))

;; Actual calendar configuration edit this to meet your specific needs (setq org-caldav-url "http://localhost:37358/username") (setq org-caldav-calendars '((:calendar-id "5E18WvJazTPygkhZTF7HpUUs9XXN5Hu2" :files ("~/Dropbox/org/Tasks.org" "~/Dropbox/org/Habits.org""~/Dropbox/org/Birthdays.org") :inbox "~/Dropbox/org/org-caldav-inbox.org"))) (setq org-caldav-backup-file "~/Dropbox/org/org-caldav-backup.org") (setq org-caldav-save-directory "~/Dropbox/org/")

:config (setq org-icalendar-alarm-time 1) ;; This makes sure to-do items as a category can show up on the calendar (setq org-icalendar-include-todo t) ;; This ensures all org "deadlines" show up, and show up as due dates (setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo todo-due)) ;; This ensures "scheduled" org items show up, and show up as start times (setq org-icalendar-use-scheduled '(todo-start event-if-todo event-if-not-todo)) ;; Add the delayed save hook with a five minute idle timer (add-hook 'after-save-hook (lambda () (when (eq major-mode 'org-mode) (org-caldav-sync-with-delay 300)))) ;; Add the close emacs hook (add-hook 'kill-emacs-hook 'org-caldav-sync-at-close))

+end_src`