Nextcloud and CalDAV

SoGO and Webtop use “Redirect” too for caldav/carddav but I never tested macOS calendar.

According to the Nextcloud docs it should work.

Yep, and those are the instructions I’m following. Caveat that on a Neth installation, the “username” in the server path will be the UUID, but you can get that out of the Nextcloud web GUI. But this is what I get when I try it:

image

access_log isn’t very helpful:

172.69.210.24 - - [11/Apr/2019:18:47:44 -0400] "PROPFIND /remote.php/dav/principals/users/9ea222d8-a9c4-1037-923c-01a044b2ff54/ HTTP/1.1" 404 16 "-" "Mac+OS+X/10.12.6 (16G1918) CalendarAgent/386"

OTOH, error_log has an interesting-looking entry:

[Thu Apr 11 18:47:44.717204 2019] [proxy_fcgi:error] [pid 4397] [client 172.69.210.24:44302] AH01071: Got error 'Primary script unknown\n'

Makes it look like some kind of PHP error, but I don’t see any separate log files for PHP–would they be somewhere other than /var/log/?

I don’t use macOS but I tested with Thunderbird now and I had to enter a specific calendar url like the personal calendar for admin:

https://testserver.domain.local/nextcloud/remote.php/dav/calendars/admin/personal/

Are you sure you need the UUID? In browser it works with usernames.

Thunderbird works just fine, but (according to the Nextcloud docs), the URL/path is different for the macOS calendar. Fortunately, that path is exposed through the Nextcloud UI:
image

The Nextcloud calendar works just fine with iOS without any redirects at all, but I haven’t yet been able to get it working with macOS.

You’re right, I only tried with Nextcloud admin and for admin the username is used, users have the UUID in the url.

From your screenshot server path “/nextcloud” could be missing before “/remote.php…” like /nextcloud/remote.php/dav/calendars/16aaa022-f0fd-1038-84e1-a75662eb7fc8/personal/

2 Likes

Bingo. I had it in the “server address” box, and /remote.php... in the “server path” box. Changing the “server path” to /nextcloud/remote.php/... lets it log in, and the calendar items appear on the macOS calendar. Perfect.

So, how to write this up? I’m thinking a custom template fragment (maybe 15dav for zz_nextcloud.conf) with logic adding those redirects if ${nextcloud}{Dav} = “enabled”. Better would be to make sure that ${webtop}{Dav} or ${sogod}{Dav} aren’t also enabled.

1 Like

Did you test if it works without the redirect?

If not a custom template should do it. I don’t think you need to respect webtop and sogo in a custom template.

Not as such, but it’d be a good stepping stone to a PR for the nethserver-nextcloud package.

Yes, and it doesn’t unfortunately. iOS calendar works just fine, but macOS doesn’t. I don’t know why macOS needs the .well-known paths to work if you’re entering the full path to Nextcloud, but it appears that it does.

1 Like

That’s true.

Ready for testing: https://github.com/NethServer/dev/issues/5753

Hello

I’m running Nextcloud/Nethservers on about 10-15 Servers for my clients, and one for myself.
All have at least one Mac, I myself use also a few Macs.

All have no problems with NextCloud CalDAV Calendar on Mac or Thunderbird with Lightning.

However, I do have problems with newer Macs and CardDAV (Adressbook).
Mavericks works without any problems using CalDAV and CardDAV. Anything newer will get errors on CardDAV, while CalDAV (Calendar) works great!

CardDAV does work well with iOS, Mac Mavericks, and Thunderbird with the SoGo PlugIn.
CalDAV works well with iOS, Mac OS from Mavericks to the latest and Thunderbird with Lightning.

This is a bit of a problem I’d like to see solved asap… :slight_smile:

My 2 cents
Andy

Unless this is a problem of server configuration, I think you should ask directly to Nextcloud forum for such thing.

For make you fell less lonely, I couldn’t get Gnome to work nor with DAV nor with ActiveSync :smiley:

@giacomo

Hi

The problem here is ONLY about Nextcloud on Nethserver and CardDAV with OSX after Mavericks. (Sierra, High Sierra and Mojave).

It seems to work on other Nextcloud implementations. There are quite a few hosters out there who provide a Nextcloud instance - and most I’ve tested seem to work.

On other Distros Nextcloud also seems to work out of the box with CardDAV.

I also have one client who insists on using Outlook, both PlugIns there work quite well (CalDAV and CardDAV). This client is using Nethserver / Nextcloud.

Andy

Fine, so we need all info to debug the problem, please provide logs and errors.

OK, but will take a day or two (Got to install a Nethserver at a Dr’s place tomorrow…).

1 Like

@giacomo
I didn’t try Gnome, but the KDE Version of Kalendar / Contacts worked well - and was setup without issues…

:slight_smile:
Andy

1 Like

@danb35

I have the same issue with my Macs, but only on the newer OS. Mavericks does the Calendar and Adressbook without any issues for initial connect and afterwards.

Apple changed some inside stuff on the CardDAV of OSX after Mavericks.
Mavericks works out of the box with both (CardDAV & CalDAV).

But not anything newer for OSX.

iPhones and iPads work without any hassle, except copying the link into the config.
I mail the URL from my Mac to an iOS, then I can copy and paste it into iOS Settings for a new CalDAV or CardDAV connection.
I can’t open Nextcloud, copy the link and paste it into the iOS, it just opens up the link in a browser window.

For those wondering why such an old OSX:
Mavericks is already quite old, but still works ok - and is the last OSX Version where Lightscribe still works. The Mavericks Box (An old iMac 20") is basically my CD/DVD Lightscribe burner… :slight_smile:

My 2 cents
Andy

replacing
RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L]
by
RewriteRule /.well-known/carddav /nextcloud/remote.php/dav/
RewriteRule /.well-known/caldav /nextcloud/remote.php/dav/

worked for me too

The R part is for the redirection and the L marks the last rule.

In your case there’s no similar rule so it’s just rewritten which works too.

if the redirect is permanent, 301 is best for SEO. If the redirect is temporary , then sending a 301 header could be disastrous once you go back to using the original URL.

For more information about rewriting:

https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule

2 Likes

thanks for pointing out
my rules are
RewriteRule /.well-known/carddav /owncloud/remote.php/dav/ [R=301,L]
RewriteRule /.well-known/caldav /owncloud/remote.php/dav/ [R=301,L]
there was a copy paste problem