lfos / calcurse

A text-based calendar and scheduling application
https://calcurse.org
BSD 2-Clause "Simplified" License
962 stars 94 forks source link

Empty calendar using SOGo #402

Open chmanie opened 2 years ago

chmanie commented 2 years ago

I am using mailcow which comes with the SOGo web frontend.

It supports CalDAV and can show individual calendar URLs that look like so:

https://yourdomain.com/SOGo/dav/[username]/Calendar/5F-61816800-19-3ACA1140/

I am already using it do sync my phone via CalDAV and that works perfectly.

But when I try to use it with calcurse-caldav it does not seem to find any calendar data.

Here's the debug output of the initialisation call (I replaced my actual domain and username):

$ calcurse-caldav --init=keep-remote --debug -v
Loading configuration from /home/chris/.config/calcurse/caldav/config...
Running command: ['calcurse', '--version']
Connecting to yourdomain.com:443...
Removing all local calcurse objects...
Running command: ['calcurse', '-F', '--filter-hash=XXX']
> REPORT https://yourdomain.com/SOGo/dav/[username]/Calendar/CEDCD7FA-5C29-4D88-873B-C9BF00010695/
> Headers: {'Content-Type': 'application/xml; charset=utf-8', 'Depth': '1'}
> <?xml version="1.0" encoding="utf-8" ?><C:calendar-query xmlns:D="DAV:"                   xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:getetag /></D:prop><C:filter><C:comp-filter name="VCALENDAR" /></C:filter></C:calendar-query>

< Status: 207 (Multi-Status)
< Headers: {'server': 'nginx', 'date': 'Tue, 02 Nov 2021 17:06:16 GMT', 'content-type': 'text/xml; charset=utf-8', 'content-length': '126', 'connection': 'keep-alive', 'cache-control': 'no-cache', 'pragma': 'no-cache', 'x-frame-options': 'SAMEORIGIN', 'status': '207'}
< <?xml version="1.0" encoding="utf-8"?>
< <D:multistatus xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"></D:multistatus>

Running command: ['calcurse', '-G', '--filter-type', 'cal,event,todo', '--format-apt=%(hash)\\n', '--format-recur-apt=%(hash)\\n', '--format-event=%(hash)\\n', '--format-recur-event=%(hash)\\n', '--format-todo=%(hash)\\n']
Saving synchronization database to /home/chris/.local/share/calcurse/caldav/sync.db...
0 items imported, 0 items removed locally.
0 items exported, 0 items removed from the server.

I know there are definitely items that should be synced.

Here's the config I'm using:

# If you want to synchronize calcurse with a CalDAV server using
# calcurse-caldav, create a new directory at $XDG_CONFIG_HOME/calcurse/caldav/
# (~/.config/calcurse/caldav/) and $XDG_DATA_HOME/calcurse/caldav/
# (~/.local/share/calcurse/caldav/) and copy this file to
# $XDG_CONFIG_HOME/calcurse/caldav/config and adjust the configuration below.
# Alternatively, if using ~/.calcurse, create a new directory at
# ~/.calcurse/caldav/ and copy this file to ~/.calcurse/caldav/config and adjust
# the configuration file below.

[General]
# Path to the calcurse binary that is used for importing/exporting items.
Binary = calcurse

# Host name of the server that hosts CalDAV. Do NOT prepend a protocol prefix,
# such as http:// or https://. Append :<port> for a port other than 80.
Hostname = yourdomain.com

# Path to the CalDAV calendar on the host specified above. This is the base
# path following your host name in the URL.
Path = /SOGo/dav/[username]/Calendar/5F-61816800-19-3ACA1140/

# Type of authentication to use. Must be "basic" or "oauth2"
AuthMethod = basic

# Enable this if you want to skip SSL certificate checks.
InsecureSSL = No

# Disable this if you want to use HTTP instead of HTTPS.
# Using plain HTTP is highly discouraged.
HTTPS = Yes

# This option allows you to filter the types of tasks synced. To this end, the
# value of this option should be a comma-separated list of item types, where
# each item type is either "event", "apt", "recur-event", "recur-apt", "todo",
# "recur" or "cal". Note that the comma-separated list must not contain any
# spaces. Refer to the documentation of the --filter-type command line argument
# of calcurse for more details. Set this option to "cal" if the configured
# CalDAV server doesn't support tasks, such as is the case with Google
# Calendar.
SyncFilter = cal,event,todo

# Disable this option to actually enable synchronization. If it is enabled,
# nothing is actually written to the server or to the local data files. If you
# combine DryRun = Yes with Verbose = Yes, you get a log of what would have
# happened with this option disabled.
DryRun = No

# Enable this if you want detailed logs written to stdout.
Verbose = Yes

# Credentials for HTTP Basic Authentication. Leave this commented out if you do
# not want to use authentication.
[Auth]
Username = [username]
Password = [password]

# Optionally specify additional HTTP headers here.
#[CustomHeaders]
#User-Agent = Mac_OS_X/10.9.2 (13C64) CalendarAgent/176

# Use the following to synchronize with an OAuth2-based service
# such as Google Calendar.
#[OAuth2]
#ClientID = your_client_id
#ClientSecret = your_client_secret

# Scope of access for API calls. Synchronization requires read/write.
#Scope = https://example.com/resource/scope

# Change the redirect URI if you receive errors, but ensure that it is identical
# to the redirect URI you specified in the API settings.
#RedirectURI = http://127.0.0.1

Is there anything I could be missing? I'd be happy to debug it more, just don't know where to start looking...

lfos commented 2 years ago

Thanks for the bug report. My best guess is that the URL is incorrect, given that the server returns no events. Have you confirmed it's correct and tried some variations?