sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.53k stars 290 forks source link

Not getting any calendar on iOS 16.3 #1168

Open NoProsNoNoobs opened 1 year ago

NoProsNoNoobs commented 1 year ago

Baikal version: 0.9.3

Expected behaviour: My calendars show up in the calender app.

Current behaviour: My Baikal CalDAV account shows up in the calendar app but my calendars don't show up.

I am using Baikal with MySQL and using a shared calendar within Baikal if that matters.

Steps to reproduce:

  1. Add the Baikal CalDAV account in iOS.
  2. Go to the calendar app and click on Calendar's.
  3. See that the Baikal CalDAV account shows up but no calendars.
MediaStudies commented 1 year ago

Running 16.3 and would be happy to comment, but just getting up on Baikal today.

A question for you: I have the CalDAV account set up in Calendar and my calendars show in the side bar, but the calendars are not populating on the screen...is there some I need to do here?

Can't find an install manual anywhere for how to set up on the Apple side of things.

Thanks.

NoProsNoNoobs commented 1 year ago

I have no idea, i mean i can't even get my calendars to show up. But documentation is indeed lacking for Apple devices. I am running Nextcloud now as a CalDAV server, which works perfectly with iOS. But Nextcloud is quite bloated if you only use it for a calendar, which why i want to use Baikal instead.

MediaStudies commented 1 year ago

Thanks NoPros. I'll check out Nextcloud—it looks like I can do a self-host.

jools-r commented 1 year ago

I have Baikal 0.9.3 working with Apple Calendar, and also with Fantastical on the Mac.

  1. Left-click Calendar in the Mac menu bar
  2. Left-click "Add Account"
  3. Left-click the drop-down that says "Automatic", and left-click to select "Advanced"
  4. Type in a valid Baikal username in the "Username" text field.
  5. Type in the corresponding password in the "Password" text field.
  6. Type in your.server.com in the "Server Address" text field (I have it without https:// etc.)
  7. Type in /dav.php/principals/USERNAME/ in the "Server Path" text field. Use the same username as you entered above.
  8. Port on automatic and tick the Use SSL checkbox.
  9. Left-click "OK".

This is using a self-installed (non-docker) version on a subdomain of my server with a corresponding SSL certificate. If you don't have a certificate, untick SSL and use port 80.

With Fantastical I needed to provide a more explicit server path: /dav.php/calendars/USERNAME/CALENDARNAME/

I have simple one-word user name set up in Baikal rather than a complete email address. In Apple Calendar I have it set to update every 5 minutes. Note therefore that changes to the calendar aren't synced instantly.

Also, see this issue where a user reported having success after deleting the account, rebooting and setting up the account anew.

MediaStudies commented 1 year ago

Thanks Jools. No problem setting up the accounts. Calendars show in left column of Calendar app.

However, no events are populating in my calendar (I have four calendars being shared).

Do I need to manually upload the data or similar first?

NoProsNoNoobs commented 1 year ago

Even after deleting the account and rebooting my iPhone, and following your steps i can't get any calendar to actually show up in the calendar app. I tried both using /dav.php/principals/MY_USERNAME/ and /dav.php/calendars/MY_USERNAME/MY_CALENDAR/ .

MediaStudies commented 1 year ago

This allows me to connect to my databases (which are displayed under the Calendars Tab): http://domain.com/html/dav.php/principals/user/

If you want SSL, select it and use port 443.

Data in calendars, however, is not populating.

My iPhones are running 16.3

NoProsNoNoobs commented 1 year ago

If i try your url, it says "Check CalDAV-account failed".

MediaStudies commented 1 year ago

I also initially had a problem connecting using user names over 3 characters.

NoProsNoNoobs commented 1 year ago

I tried connecting with a username of 3 characters, but for some reason it is still not pulling in my calendar's.

MediaStudies commented 1 year ago

Also, port 80 seemed to work for non-SSL.

jools-r commented 1 year ago

On the iPhone I only need to enter the server (without http/s) and user + pass in the settings. The rest was autodetected. Under Advanced I see the path: https://sub.domain.com/dav.php/principals/USERNAME/ with Use SSL checked and Port 443.

Try adding, changing and removing events in that calendar to check syncing. Depending on your settings and when your various devices last polled the caldav server, your data may take a few minutes to sync between devices.

FWIW: my user name has 5 letters.

MediaStudies commented 1 year ago

In my case, there is no need to check syncing—no data is displayed at all.

MediaStudies commented 1 year ago

BTW, I would also try non-SSL as well as SSL. Two of my iPhones took SSL. The third could only be connected using non-SSL.

All are running 16.3.

MediaStudies commented 1 year ago

I also "Share this resource" for all of my accounts for all of the databases.

Is there another step here I need to do?

MediaStudies commented 1 year ago

Another thing you can check is the configuration settings by clicking on the "i" button next to each calendar within the Baïkal CalDAV dashboard.

jools-r commented 1 year ago

Hmm, I can't think of anything else other than that you have a checkmark for "This account is active" (my translation so the name may be similar) in the account information about the calendar (ctrl-click on the calendar in the sidebar, then choose "Calendar Info") and that you have a tick mark next to the calendar in the sidebar so that it's displayed on your calendar.

In Baikal you can't see the calendar itself but if you log in as admin and check “Users and Resources”, then click on your user, you can double-check if Baikal does indeed have events logged for a specific calendar (note: they may be in the past).

I haven't additionally shared my calendar publicly. It's being used by several users (using the same baikal username) across various devices and platforms including Macs, iPhones, Windows and android phones. Some clients on the windows side need additional caldav calendar plugins.

MediaStudies commented 1 year ago

"Enable this account" is checked (when it is unchecked, the calendars disappear from the sidebar).

When I ctrl-click on the calendar in the sidebar, I only get: Get Info; Share Calendar...; Delete; Custom Color...

User is showing in Users and Resources, but no events are logged.

I still don't understand how the Calendar data from my computer gets into Baikal.

NoProsNoNoobs commented 1 year ago

Baikal shows no events logged in my case too.

jools-r commented 1 year ago

If under "Users and Resources" › User › Calendars, there are 0 events in the Events column, it looks like you have nothing to sync.

Try first adding something to your calendar on your phone or mac to see if it gets picked up by Baikal, and in turn then by any other devices.

If that's successful, you can then can set about transferring any existing calendar entries to that calendar and they should sync to Baikal, and on to other people / devices.

Tntdruid commented 1 year ago

I'm using https:/dav.me.tls/dav.php/

I use the DNS SRV records from https://sabre.io/dav/service-discovery/

Works on Android and iOS.

MediaStudies commented 1 year ago

Added three separate events. None were picked up.

jools-r commented 1 year ago

Sorry, no further ideas except perhaps: what do you have set for “WebDAV authentication type” in Baikal's admin area. I have basic. Some have described having problems with other settings.

NoProsNoNoobs commented 1 year ago

When i set WebDAV authentication type to basic, it gives me the "check CalDAV-account failed" error. Same for if i set it to Apache, it wil only connect using Digest.

MediaStudies commented 1 year ago

Thanks. I tried all three options. Digest allows an error-free connection.

MediaStudies commented 1 year ago

After sleeping on this, the issue seems to be that Baikal (in my case) isn't accessing the calendar data on any of my devices, which may mean that I not only need to create calendars in Baikal, but all must populate them, i.e., import my data.

Did anyone go through a procedure like this?

TCB13 commented 1 year ago

I came to the conclusion that there are multiple aspects to this and that one fix might break other dav clients. So, my final working setup with nginx is:

server {
    listen 80;
    server_name dav.example.org;
    root /web/public/dav.example.org/html;
    charset utf-8;

    index index.php;
    # Redirect to the root with HTTPS - iOS clients require secure connections
    location = /.well-known/caldav {
        return 302 https://$server_name/dav.php;
    }
    location = /.well-known/carddav {
        return 302 https://$server_name/dav.php;
     }

    # Disable Baikal index.php
    location = /index.php {
     deny all;
     return 404;
     }

}

/.well-known/caldav and /.well-known/carddav are redirected (HTTP 302) to the /dav.php and it is very important to FORCE HTTPS - without this iOS clients will not follow your redirect and end up doing a request to the root of the webserver that fails.

NoProsNoNoobs commented 1 year ago

So if I understand this correctly, this fixes it for iOS but breaks it for other clients?

NoProsNoNoobs commented 1 year ago

I will try it out soon when I have the time, but thank you already.

TCB13 commented 1 year ago

I will try it out soon when I have the time, but thank you already.

If you plan to have autoconfig working really well, don't forget to add the SRV entries to your domains like:

_caldavs._tcp SRV 0 1 443 dav.example.org
_carddavs._tcp SRV 0 1 443 dav.example.org
n-rodriguez commented 1 year ago

I've run into the same issue and to be more precise it's not only a matter of https or not.

    # Redirect to the root with HTTPS - iOS clients require secure connections
    location = /.well-known/caldav {
        return 302 https://$server_name/dav.php;
    }
    location = /.well-known/carddav {
        return 302 https://$server_name/dav.php;
     }

Actually the MacOS Calendar app does first a propfind on /.well-known/caldav to know the root url :

172.27.0.1 - - [17/Sep/2023:22:56:50 +0000] "PROPFIND /.well-known/caldav HTTP/1.1" 302 145 "-" "macOS/13.5.2 (22G91) dataaccessd/1.0" "myip"
172.27.0.1 - - [17/Sep/2023:22:56:50 +0000] "PROPFIND / HTTP/1.1" 405 157 "-" "macOS/13.5.2 (22G91) dataaccessd/1.0" "myip"

Here the connection is HTTPS but it redirects to / which is wrong. I fixed it by redirecting to /dav.php and everything works well 😃

TCB13 commented 1 year ago

I've run into the same issue and to be more precise it's not only a matter of https or not.

    # Redirect to the root with HTTPS - iOS clients require secure connections
    location = /.well-known/caldav {
      return 302 https://$server_name/dav.php;
  }
    location = /.well-known/carddav {
      return 302 https://$server_name/dav.php;
     }

Actually the MacOS Calendar app does first a propfind on /.well-known/caldav to know the root url :

172.27.0.1 - - [17/Sep/2023:22:56:50 +0000] "PROPFIND /.well-known/caldav HTTP/1.1" 302 145 "-" "macOS/13.5.2 (22G91) dataaccessd/1.0" "myip"
172.27.0.1 - - [17/Sep/2023:22:56:50 +0000] "PROPFIND / HTTP/1.1" 405 157 "-" "macOS/13.5.2 (22G91) dataaccessd/1.0" "myip"

Here the connection is HTTPS but it redirects to / which is wrong. I fixed it by redirecting to /dav.php and everything works well 😃

I tried this once and I remember it caused issues with some other DAV client... not sure what or why.

fabioromeo commented 1 year ago

Just a heads up for those with shared hosting: I created a dav.mydomain.com domain with cPanel and it added tons of unecessary Zone Record entries on my Zone Editor, specially ones related to autodiscovery. I deleted all but the essential ones (A Records and TXT records) and added the _carddavs._tcp and _caldavs._tcp settings from this guide: https://sabre.io/dav/service-discovery/

After a couple minutes for it to propagate I was able to login flawlessly on iOS and macOS.

TCB13 commented 1 year ago

After a couple minutes for it to propagate I was able to login flawlessly on iOS and macOS.

For those clients I also followed that guide and I'm using the DNS SRV records + the .well-known URLs.

CDeLeon94 commented 10 months ago

If anyone else is having this issue and is using Nginx Proxy Manager (NPM) one or both of these added to the 'advanced' tab of my proxy solved it for me:

location = /.well-known/caldav {
    return 302 https://$server_name/dav.php;
}
location = / {
    return 302 https://$server_name/dav.php;
}
highergao commented 5 months ago

I came to the conclusion that there are multiple aspects to this and that one fix might break other dav clients. So, my final working setup with nginx is:

server {
    listen 80;
    server_name dav.example.org;
    root /web/public/dav.example.org/html;
    charset utf-8;

    index index.php;
    # Redirect to the root with HTTPS - iOS clients require secure connections
    location = /.well-known/caldav {
      return 302 https://$server_name/dav.php;
  }
    location = /.well-known/carddav {
      return 302 https://$server_name/dav.php;
     }

    # Disable Baikal index.php
    location = /index.php {
   deny all;
   return 404;
     }

}

/.well-known/caldav and /.well-known/carddav are redirected (HTTP 302) to the /dav.php and it is very important to FORCE HTTPS - without this iOS clients will not follow your redirect and end up doing a request to the root of the webserver that fails.

very helpfull,thank you very much

ocean-haiyang commented 2 months ago

Just a heads up for those with shared hosting: I created a dav.mydomain.com domain with cPanel and it added tons of unecessary Zone Record entries on my Zone Editor, specially ones related to autodiscovery. I deleted all but the essential ones (A Records and TXT records) and added the _carddavs._tcp and _caldavs._tcp settings from this guide: https://sabre.io/dav/service-discovery/

After a couple minutes for it to propagate I was able to login flawlessly on iOS and macOS.

Doing this on cloudflare plus adding this worked for me. Thank you!

location = /.well-known/caldav {
    return 302 https://$server_name/dav.php;
}
location = / {
    return 302 https://$server_name/dav.php;
}