mrusme / caldr

A lightweight CLI / TUI calendar that supports CalDAV
https://xn--gckvb8fzb.com
GNU General Public License v3.0
33 stars 1 forks source link

wrong principal-url used, get "404 Not Found" #1

Open Junker opened 1 year ago

Junker commented 1 year ago

When i'm trying to start caldr -r i get error 404 Not Found. I'm using NextCloud as a CalDav server, i looked in the access.log in the server and see this request: GET /remote.php/dav/principals/myuser HTTP/1.1" 404 31 "-" "HTTPie/3.2.1. NextCloud uses this principal-url: /remote.php/dav/principals/users/myuser.

You should request principal-url first as described in RFC 6764.

e.g. request: <d:propfind xmlns:d="DAV:"><d:prop><d:current-user-principal /></d:prop></d:propfind>

mrusme commented 1 year ago

Hey there, thanks for reporting and pointing out the URL that might work! While I could implement a fix with the URL you mentioned I couldn't really test it as I'm not running a NextCloud CalDav server. If you're able to, feel free to draft a PR, test it on your instance and push it when you have a version that's working for your use case!

tdpeuter commented 1 year ago

I am encountering the same issue.

After some digging around, I believe it's actually not the applications responsibility to request principal-url, but rather the responsibility of emersion/go-webdav, which is used to connect to the DAV server. More specifically, RFC: only support a single path layout? #100 describes what is still under development and what it would take to get there.

Hope this helps to clarify things.

Specifically for Nextcloud endpoints If you like, though I am sure that this is purely specific to Nextcloud and/or other iOS/macOS CalDav addresses, you can use that url (instead of your primary address - see picture below) and just search for the calendar homeset at the endpoint, without appending 'principals/username' to it here. Very much not what you would like to do in the actual application, though might be nice for those who build from source :) ![Nextcloud: Difference between primary and iOS address](https://github.com/mrusme/caldr/assets/26653057/a09c67f6-9ae5-4175-b551-b8de8b2cc248)
ehmry commented 7 months ago

I also had problems with nextcloud, but I think the best fix is to replace nextcloud with something else.