sabre-io / Baikal

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

Contacts on MacOS High Sierra #714

Closed yanngdev closed 5 years ago

yanngdev commented 7 years ago

Hi Baikal users,

I can't sync Baikal CardDav on MacOS High Sierra Contacts app. It works like a charm with Calendar app and on iOS 11 (both Contacts and Calendar), but MacOS Contacts just does not sync. Any idea ? Any help ?

haribert commented 6 years ago

I switched from OSX 10.11 to 10.13. After some problems in the beginning, I could get it working!

I removed my older config in .htaccess i found back then (OSX 10.11) in issue #401:

Redirect /.well-known/carddav /card.php
Redirect /.well-known/caldav /cal.php

and added the following lines in my apache.conf:

RewriteEngine on
RewriteRule /.well-known/carddav /dav.php [R,L]
RewriteRule /.well-known/caldav /dav.php [R,L]

I used following account settings:

Account Type:    manual
User Name:       <baikal user>
Password:        <user password>
Server Address:  https://<baikal address>

But the user/password verification did not work the first time, I had to try several times (around 4 times clicking the button Sign In) until it signed in.

I hope someone can reproduce and verify this!

oakbrad commented 6 years ago

I have just set up Baikal with the Apache redirects from the installation instructions, and I can login (iOS device and OS X Contacts) but it does not seem to sync. I tried importing a few hundred vcards, and creating a few manually, but they do not show up on the server.

I tried leaving the Server Path to the default, and /dav.php/principals/username/ and neither of those worked.

haribert commented 6 years ago

I have to admit, my comment was a little bit too fast. The initial synchronisation worked only to a certain point and stopped working afterwards (but the majority of the contacts were synced). New contacts on the server were not synchronised to macOS contacts anymore. If someone knows another way to sync the contacts to macOS, please let me know.

With my Android devices everything works perfectly.

ghoss commented 6 years ago

Reviving this old thread with a solution for those who happen to encounter the same problem, like me…

The following settings worked for me with Contacts on Mac OS High Sierra 10.13.5:

Account Type: Advanced
User Name: <Baikal username>
Password: <Baikal password>
Server Address: https://your.baikal.server
-or- http://your.baikal.server (if you don't use SSL)
Server Path: /baikal/html/dav.php/principals/<Baikal username>/
(assuming your Baikal installation is at http://your.baikal.server/baikal)

This may seem non-intuitive, but it is crucial to specify https://your.baikal.server instead of just your.baikal.server in the server address field!

Also, the server redirects previously suggested are not sufficient. If you look at the server logs, you'll notice that the Contacts app also tries to access /principals/<username> regardless of the other .well-knownredirects, therefore a rewrite must be added to handle that. So the complete list of required redirects/rewrites is:

(REDIRECT) ^/.well-known/carddav ==> https://your.baikal.server/baikal/html/dav.php
(REDIRECT) ^/.well-known/caldav ==> https://your.baikal.server/baikal/html/dav.php

(REWRITE) ^/principals/(.*) ==> /baikal/html/dav.php/principals/$1

I'm using lighttpd instead of Apache, so this is my lighttpd configuration. Apache users, you get the idea:

# Baikal CardDAV/CalDAV
#
$SERVER["socket"] == ":80" {
    $HTTP["host"] =~ ".*" {
            url.redirect = ( 
                    "^/.well-known/carddav" => "http://%0/baikal/html/dav.php",
                    "^/.well-known/caldav"  => "http://%0/baikal/html/dav.php",
            )
            url.rewrite-once = (
                    "^/principals/(.*)"     => "/baikal/html/dav.php/principals/$1"
            )
    }
}
evert commented 5 years ago

The new version does have some of these redirects by default now! Hopefully it's better. If not, re-open this ticket

derwok commented 5 years ago

@evert Big Thanks!!!

Using Baikal since 5 years now for my whole family. Just upgraded to Mac OSX Mojave (10.14) just to find out that Apple Contacts again got broken to sync. Then found out: there is a Baikal update!

Yeaha! Download, Unzip, copy over ' Specific', surfed to /admin/ pressed Migrate. Guess what: everything there, and Mac works again. Big Thanks for keeping this precious project alive! (By the way: Is there a donation page?)

evert commented 5 years ago

I can't really take credit for this anymore. A bunch of great people have taken over =). We don't have a real donation page, but if you feel inclined send something to doctors without borders!

stinggithub commented 5 years ago

I can't really take credit for this anymore. A bunch of great people have taken over =). We don't have a real donation page, but if you feel inclined send something to doctors without borders!

Hi Evert, I also using Baikal since 5 years ... then I upgrade Mac and OS ... I have High Sierra 10.13 and cannot sync and access to my calendars ... I read that with High Sierra 10.13 I have to use an SSL connection! I update to 0.60 but nothing! May you help me?! Obvious everything works well with Android mobile

prologic commented 3 years ago

For me using the Docker installation the correct Server Path(s) were:

atarixle commented 2 years ago

Can anybody talk clearly and tell me what to do?

I do not know, what .htaccess file you're talking about. I do not know, what .well-known is.

What exactly do I have to do to make baikal work in macOS again?

derwok commented 2 years ago

Don't know what server you have, so cannot tell you "exactly" what to do. But my nginx worked well again with MacOS when I put this into the default config of nginx:

    rewrite ^/.well-known/caldav /baikaldir/dav.php redirect;
    rewrite ^/.well-known/carddav /baikaldir/dav.php redirect;

then on MacOS I use this server URL for the Contacts App:

https://www.myserver.com/baikaldir/card.php/principals/myuser

and this server URL for the Calendar App:

https://www.myserver.de/baikaldir/cal.php/principals/myuser
atarixle commented 2 years ago

The long URL for Calendar and Addressbook did work in Lion, without any addition of .well-known or Re-Directs on my RPi4 (which runs web services on Apache2). It is confusing to me that from El Capitan to Big Sur this long URL shall work, just by adding those rules. Why should I add the whole old URL if I just redirected it to shorten it (because macOS just refuses the long URL). And when I ask for the .htaccess, I ask, which one, I got billions on my whole system. Admittedly I only got exactly one in the whole baikal-regular folder (old name, current version).