nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.15k stars 3.94k forks source link

Propagate subscribed calendars to CalDAV clients #17754

Open Sesivany opened 4 years ago

Sesivany commented 4 years ago

Is your feature request related to a problem? Please describe. I'm using the Nextcloud Calendar mostly in desktop/mobile clients. I'm subscribed to several remote calendars via ical. I can see them in the web interface, but I can't in the clients.

Describe the solution you'd like It would be great if the calendars I'm subscribed to got propagated to CalDAV clients just like calendars that are located in my Nextcloud.

Describe alternatives you've considered The alternative is to subscribe to the calendars in each client, but that's additional work in the initial setup and maintenance. I'd rather set them up in one location for all clients.

Additional context Proprietary competition (Google Calendar, iCloud) supports it.

tcitworld commented 4 years ago

DAVx5 can automatically fetch subscriptions from Nextcloud, if you have ICSx5 installed.

Anyway subscriptions are now cached by Nextcloud server, we just need to expose them to clients. @georgehrke do we transfer and keep this issue in server?

georgehrke commented 4 years ago

Yes, let's move it to the server.

It's basically about filling this array: https://github.com/nextcloud/server/blob/master/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php#L42

BernieO commented 4 years ago

I just wondered, because if I subscribe to an external webcal calendar in the webinterface of Nextcloud, it is shown (including all events) on my iOS devices. But on a closer look, it looks like iOS fetches the webcal link from Nextcloud via caldav and then directly loads the calendar events from the external resource.

A change in a subscribed calendar is shown in iOS while the Nextcloud calendar-app still shows old data. Obviously the Nextcloud calendar-app doesn‘t refresh the calendar as often as my iOS devices.

So it looks like Nextcloud pushes the webcal link to the clients instead of the cached events.

Nextcloud 16.0.5 iOS 13.2

tcitworld commented 4 years ago

A change in a subscribed calendar is shown in iOS while the Nextcloud calendar-app still shows old data. Obviously the Nextcloud calendar-app doesn‘t refresh the calendar as often as my iOS devices.

Subscribed calendars are currently cached in your browser for two hours when you're using the Calendar app.

akoyaxd commented 4 years ago

I would love this to be implemented. This would improve the experience on Gnome pretty well, especially when you use multiple computers!

msrn commented 3 years ago

Has there any work been done on this? Would love to have this.

tcitworld commented 3 years ago

This feature is a fix for CalDAV clients that doesn't support discovering subscriptions from the endpoint (like DAVx⁵ does for instance). We can only allow some clients (based on their user-agent) if we know what they are, so please post the clients you use (and if you can, their user-agent).

msrn commented 3 years ago

Currently I'm using Nextcloud Contacts and Calendar with Windows 10 Contacts/Calendar app. When initiating sync, these are the request made to server by the application.

"PROPFIND /remote.php/dav/principals/users/{USER}/ HTTP/1.1" 207 1976 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/addressbooks/users/{USER}/ HTTP/1.1" 207 1363 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/principals/users/{USER}/ HTTP/1.1" 207 1217 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/addressbooks/users/{USER}/ HTTP/1.1" 207 1363 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/principals/users/{USER}/ HTTP/1.1" 207 1341 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/calendars/{USER}/ HTTP/1.1" 207 1772 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/principals/users/{USER}/ HTTP/1.1" 207 1210 "-" "MSFT-WIN-3/10.0.19041 (gzip)" "PROPFIND /remote.php/dav/calendars/{USER}/ HTTP/1.1" 207 1772 "-" "MSFT-WIN-3/10.0.19041 (gzip)"

User-agent being MSFT-WIN-3/10.0.19041 My current Windows version is 2004. Build 19041.985 Windows 10 contacts app version: 10.1909.12456.0 Windows 10 calendar app version: 16005.13426.20920.0

It seems that the user-agent string is tied to the build version of Windows 10. Would be it appropriate to just match MSFT-WIN-3 with regex?

tcitworld commented 3 years ago

Would be it appropriate to just match MSFT-WIN-3 with regex?

Seems fine. It would be nice to make sure that it's different for the Outlook Caldav Synchronizer. https://caldavsynchronizer.org

msrn commented 3 years ago

Would be it appropriate to just match MSFT-WIN-3 with regex?

Seems fine. It would be nice to make sure that it's different for the Outlook Caldav Synchronizer. https://caldavsynchronizer.org

CalDavSynchronizer has the following UserAgent CalDavSynchronizer/4.1

msrn commented 3 years ago

Would be it appropriate to just match MSFT-WIN-3 with regex?

Tested this to working with expression /^MSFT-WIN-3/. During sync now Windows 10 Calendar shows subscribed calendars from Nextcloud.

Should I submit PR with the addition of this to Plugin-php? @tcitworld

tcitworld commented 3 years ago

Please do.

stif commented 2 years ago

Not sure if it fits here..

I was able to automatically get subscribed calendars from NC in Gnome Calendar 3.38. But after a upgrade to Gnome 40 and a fresh user home (cleaned all dot-folders and files), and adding Nextcloud to the "Online Accounts" of Gnome, the externally subscribed ical calendars are not showing up any more (they also do not appear after hitting "synchronize calendars").

This is what nextcloud webserver receives when hitting "synchronize calendars": PROPFIND /remote.php/caldav/calendars/<user>/personal/ HTTP/1.1" 207 410 "-" "Evolution/3.40.3"

tcitworld commented 2 years ago

Gnome Calendar or Evolution doesn't have support for discovering CalDAV subscriptions, so I guess you manually added the subscription in Gnome Calendar at some point (which is better than having the subscription exposed as a calendar anyway, since it will refresh the subscription more frequently).

stif commented 2 years ago

Hm i am quite sure the ical calendars added to NC show up in Gnome Calendar 3.38 after hitting "synchronize calendars". Also after manually deleting them and then hitting synchronize calendars, they appeared again with their standard name..

Anyway, thanks for answering, i will add them manually..

msrn commented 2 years ago

For Akonadi (KIO) based clients on KDE apps.

Mozilla/5.0 (X11; Linux x86_64) KIO/5.86 akonadi_davgroupware_resource_1/5.18.2 (21.08.2)

Filling ENABLE_FOR_CLIENTS with this useragent allows the client to see subscribed calendars.

I can make a PR of this, but should we match only the KIO part with regex?

msrn commented 2 years ago

Not sure if it fits here..

I was able to automatically get subscribed calendars from NC in Gnome Calendar 3.38. But after a upgrade to Gnome 40 and a fresh user home (cleaned all dot-folders and files), and adding Nextcloud to the "Online Accounts" of Gnome, the externally subscribed ical calendars are not showing up any more (they also do not appear after hitting "synchronize calendars").

This is what nextcloud webserver receives when hitting "synchronize calendars": PROPFIND /remote.php/caldav/calendars/<user>/personal/ HTTP/1.1" 207 410 "-" "Evolution/3.40.3"

Evolution was discussed some time ago in other issue https://github.com/nextcloud/server/issues/1497#issuecomment-453237892

fuzzy7k commented 1 year ago

This feature is a fix for CalDAV clients that doesn't support discovering subscriptions from the endpoint (like DAVx⁵ does for instance). We can only allow some clients (based on their user-agent) if we know what they are, so please post the clients you use (and if you can, their user-agent).

It is more than that. It is a feature in it's own right. If I had 20 subscriptions that means my mobile would need to contact 20 different servers, and depending on the update frequency of the client in use, that could mean a lot of data and unnecessary polling.

fuzzy7k commented 1 year ago

I see why this issue has gone nowhere. Developers have implemented a conflicting, legitimate function that accomplished one desired end goal, getting the calendar onto a client app.

Unfortunately people have other use cases that require the method originally asked for in https://github.com/nextcloud/server/issues/1497.

There is an elegant way to implement this feature as to not conflict with the one developers initially chose. Why not add a new "import" option to an already created calendar, right next to the "export" option. This would implicitly add the remote calendar to the target calendar so that when a user syncs the target calendar, they will be getting cached data from all remote calendars that have been added under the target.

Going one step further, it would be nice to be able to name the calendars, as is done now, but with the alteration that events that show up on the target calendar do so with the calendar name prepended to the event title. No name, no alteration to the event title.

For instance, I have various jobs that expose my work schedules and I would like to be able to share my "work schedule" with family. That work schedule would have all of my jobs combined on one calendar. One job names events with a location, another with my name, etc. thus the desire for prepending a calendar name to the event title.