nextcloud / deck

🗂 Kanban-style project & personal management tool for Nextcloud, similar to Trello
https://apps.nextcloud.com/apps/deck
GNU Affero General Public License v3.0
1.19k stars 273 forks source link

Deck calendars cannot be shared #3293

Open rdlab-upc opened 3 years ago

rdlab-upc commented 3 years ago

Steps to reproduce

  1. Nextcloud 21.0.4 (up-to-date) but seams the same in any version
  2. Web interface
  3. Deck + Calendar App enabled (lastest version)
  4. Create a new deck board
  5. Add a card to the new board and put a date on in

Expected behaviour

Any new deck board add a calendar entry with other "regular" Calendars (personal, birthday...). All deck calendars have the same default name:

Deck:

All existing calendars must have the "share" propierty in order to allow this calendar to be reachable outside nextcloud environment (iCal URL).

Actual behaviour

Deck calendars cannot be shared. The share icon is not showed like regular calendars.

Calendar app

Calendar app version: 2.3.3 (latest)

Thank you! Deck_Calendar

ChristophWurst commented 3 years ago

This is something to debug. I suspect that either permissions are not sufficient or there are other props necessary to make a calendar shareable. https://github.com/nextcloud/deck/tree/7b647d34c593615b418434705e9528b11c3b43c1/lib/DAV handles the Deck part of the Calendars if you want to check it yourself.

rdlab-upc commented 3 years ago

@ChristophWurst AFAIK, the Deck calendar entries are "automatically" created and added by the system itself when a new deck board is created. The user has nothing to do with it, at least directly.

Do you think it could be a deck App related problem (deck creates calendars with wrong/insufficient permissions)? or a Calendar App issue that cannot access properly to this new entry?

I am not much a programmer, but I will try to take a look. Any help will be appreciated :)


UPDATE => I have made some tests and "Deck: Board_name" Calendars are not present in the oc_calendars table (or any other related table). Maybe this is the reason....

I could not find any table (oc_deck_XX or oc_calendar_YY) where the Deck calendars are stored, but they exist and are available through the calendar tab.

I could not find how the Deck calendars are retrieved and showed.... I will check your link for any tips in the code.


Thank you!

ChristophWurst commented 3 years ago

UPDATE => I have made some tests and "Deck: Board_name" Calendars are not present in the oc_calendars table (or any other related table). Maybe this is the reason....

This is not a surprise. Deck creates the calendars on the fly, with the code that I linked to.

tcitworld commented 3 years ago

We can move this to Deck.

rdlab-upc commented 3 years ago

@tcitworld Thank you!!!

If you need any more info/whatever, let me know.

szimszon commented 3 years ago

On server version 22, deck 1.5.1, calendar 2.3.3:

Even it is impossible to me to publicly share any other calendar with Deck enabled:

OCA\Deck\NoPermissionException: Must be logged in to get the group limit/srv/nextcloud/nextcloud/nextcloud/apps/deck/lib/DAV/CalendarPlugin.php - line 44:OCA\Deck\Service\ConfigService->get("calendar")<<closure>>OCA\Deck\DAV\CalendarPlugin->__construct(OCA\Deck\DAV ... {}, OCA\Deck\Ser ... {})/srv/nextcloud/nextcloud/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 106:ReflectionClass->newInstanceArgs([ OCA\Deck\D ... }])/srv/nextcloud/nextcloud/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 114:OC\AppFramework\Utility\SimpleContainer->buildClass(ReflectionCl ... "})/srv/nextcloud/nextcloud/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 131:OC\AppFramework\Utility\SimpleContainer->resolve("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 460:OC\AppFramework\Utility\SimpleContainer->query("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/lib/private/ServerContainer.php - line 145:OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/AppInfo/PluginManager.php - line 256:OC\ServerContainer->query("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/AppInfo/PluginManager.php - line 316:OCA\DAV\AppInfo\PluginManager->createClass("*** sensiti ... *")<<closure>>OCA\DAV\AppInfo\PluginManager->OCA\DAV\AppInfo\{closure}("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/AppInfo/PluginManager.php - line 321:array_map(Closure {}, [ "*** sensi ... "])/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/AppInfo/PluginManager.php - line 168:OCA\DAV\AppInfo\PluginManager->loadSabreCalendarPluginsFromInfoXml([ "*** sensi ... "])/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/AppInfo/PluginManager.php - line 106:OCA\DAV\AppInfo\PluginManager->populate()/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/Server.php - line 319:OCA\DAV\AppInfo\PluginManager->getAppPlugins()/srv/nextcloud/nextcloud/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:OCA\DAV\Server->OCA\DAV\{closure}("*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 456:Sabre\DAV\Server->emit("beforeMethod:PROPFIND", [ "*** sensi ... "])/srv/nextcloud/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:Sabre\DAV\Server->invokeMethod("*** sensiti ... *", "*** sensiti ... *")/srv/nextcloud/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:Sabre\DAV\Server->start()/srv/nextcloud/nextcloud/nextcloud/apps/dav/lib/Server.php - line 333:Sabre\DAV\Server->exec()/srv/nextcloud/nextcloud/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:OCA\DAV\Server->exec()/srv/nextcloud/nextcloud/nextcloud/remote.php - line 166:require_once("/srv/nextcl ... p")
--

If I just disable the Deck app with the very same link I can see my public calendar.

(public link is working if I'm logged in:)

Edit: Just fixed in a pull request: https://github.com/nextcloud/deck/pull/3299

rdlab-upc commented 2 years ago

FYI. Still cannot be shared under latest upgrade:

-NC: 21.0.5 -Deck App: 1.4.5

Thank you.

juliushaertl commented 2 years ago

The CalDAV implementation is currently implemented for read only access. Sharing is an enhancement that is related to write access which is tracked in #2399

rdlab-upc commented 2 years ago

The CalDAV implementation is currently implemented for read only access. Sharing is an enhancement that is related to write access which is tracked in #2399

@juliushaertl OK, thank you for the update and the tracking!

magikmw commented 2 years ago

The CalDAV implementation is currently implemented for read only access. Sharing is an enhancement that is related to write access which is tracked in #2399

Is there any way we could get a quick access to iCal read-only implementation?

My use case is I'd like to see the deadlines on Deck tasks in my google calendar that syncs to the phone. Currently it's impossible, unless this gets done or I fix something up using the API on my own. #2399 seems stuck.

Edit: Oh, and also - Google Calendar doesn't support authentication, so the only wait it'd work is with a public iCal link, same way the Calendar app allows us to use.
To be fair I'd settle for even just periodical syncing of board's deadlines with any other Calendar app calendar and using that link to share to Google, seeing that Deck calendars right now are transient.

rdlab-upc commented 2 years ago

@magikmw @juliushaertl

AFAIK this issue is not about to have a read-only deck related calendar. The problem is that NextCloud-Deck-Calendar does not provide a public share link for a deck-calendar, regardless r/o, r/w or anything.

That means you cannot add your deck calendar (iCal url link) to any third-party service (Google calendar, Apple Cal...whatever) so it cannot be checked outside Nextcloud platform.

The read-only feature only means that you cannot update events from outside NextCloud Platform, but that's OK if at least can be added to a external service that manages all your calendars.

At this time, only non-deck calendars provide a public URL to be seen from outside.

Thank you!

djzwerg commented 11 months ago

Hi. Is there any update on this? It seems that CalDavSynchronizer is not able to get the deck calendar, too.

andrinheusser commented 1 week ago

Here's a workaround for getting a read-only calendar subscription working for eg. google calendar

  1. Create a user with just enough permissions to access the deck you're interested in.
  2. Using the web ui, navigate to the deck you're interested in and note the id from the url.
  3. Create a cloud function / zapier / n8n / whatever using the code below and for GET requests, return the VEVENTS as an ical file (text/calendar)

You can get the VTODOS using http basic auth from the url: https://<username>:<password>@<host>/remote.php/dav/calendars/calendar-user/app-generated--deck--board-<id>/?export

Most calendars do not support VTODOS, so they need to be converted to VEVENTS

// example typescript
function vTodoToVevent(icalString: string) {
  const [start, ...events] = icalString.split('\nBEGIN:VTODO');
  return [
    start,
    events
      // Remove the DESCRIPTION field from the VTODO
      .map((event) => event.split('\nDESCRIPTION:')[0])
      // Filter out events that don't have a DUE date
      .filter((event) => event?.includes('\nDUE'))
      .map((event) =>
        [
          '\nBEGIN:VEVENT',
          event
            ? event
                // VTODO uses DUE, VEVENT uses DTSTART
                .replace('DUE:', 'DTSTART:')
                .split('\n')
                // Remove STATUS and CATEGORIES fields, they are not supported in VEVENT
                .filter(
                  (line) =>
                    !line.startsWith('STATUS') && !line.startsWith('CATEGORIES')
                )
                .join('\n')
            : '',
          '\nEND:VEVENT',
        ].join('')
      ).join(''),
    '\nEND:VCALENDAR',
  ].join('');
}

You could of course extend this to return a single calendar subscription link for multiple boards.