Baikal: Share calendar between Baikal users

Created on 20 Apr 2016  路  31Comments  路  Source: sabre-io/Baikal

Is it possible to share calendar or the only option is to use 3rd account and gave both user access to it so they both access same calendar ?

enhancement

Most helpful comment

Next few weeks I'd say. But after release I'll wait a few more weeks until I also do a baikal release.

All 31 comments

Hi,
the SabreDAV library has the posibility to share the calendar too different users
http://sabre.io/dav/caldav-sharing/

But, you have to do it in the database by adding calendar-proxy-write / calendar-proxy-read
for the users.

See http://publications.jbfavre.org/web/online-calendars-sabredav-php-fpm-nginx.en for the complete setup.

Go to paragraph _test_ and look at the sql setup for:

_Delegating read rights: "foo" must read "bar" calendar_
_Delegating write rights: "bar" must write into "foo" calendar_

It's working very well for my setup with nginx and baikal.
clients: Thunderbird and CalDAV-Sync on Android

mfG Matthias

Oh wow! good we can do this - to bad that without ui.
Will this somehow break in upcoming updates? or the upcoming update with this is far in future ?;)

There's two main ways to do 'sharing':

  1. Delegation
  2. Sharing

Delegation is what @schmimat describes. It works today, but no UI. If you use apple iCal or BusyCal you can manage delegates from the client. Delegation does not work for every client. Delegation is for entire accounts.

"Sharing" is something being worked on in sabre/dav. It will be released as sabre/dav 3.2 and after that release there will also be a baikal update. Sharing is per-calendar, not per-account. Sharing works for every caldav client out of the box, but can only be managed by some clients (again iCal and BusyCal).

One day there will be a web UI for this, but not sure yet when. Keeping this ticket open until baikal has integrated sabre/dav 3.2.

Is there any ETA for sabre/dav 3.2 ?

Next few weeks I'd say. But after release I'll wait a few more weeks until I also do a baikal release.

Could you recommended any solution for android phone to 'sharing' for upcoming sabre/dav - im using DavDroid to be able to sync calendar - but not sure about where to share it

This app will at one point in the future: http://dmfs.org/caldav/ I don't know what DavDroid supports.

But even if they don't "support" sharing, they will still see shared calendars. That's the nice thing about the sharing spec.

Any news on this topic? I am looking forward to his feature...

sabre/dav 3.2 has been released this week, which has this feature... but I want that version to be out there for people to test for a few months before I upgrade baikal. Baikal users are usually less savvy than sabre/dav users, so it's important that it gets some real-word usage first as the changes are pretty major.

@evert so we can expect that somewhere in Q4 2016?

Yes I think that would be a realistic timeline. Sorry for being so conservative, but this project needs stability first

hey @evert - I just read about the new sharing options sabre/dav 3.2 introduced and they are so much promising. Really wanted to try that out and test the share feature, but with Baikal.

I changed sabre/dav inside composer.json to ~3.2.0 and added

$this->server->addPlugin(new \Sabre\DAV\Sharing\Plugin());
$this->server->addPlugin(new \Sabre\CalDAV\SharingPlugin());

inside Baikal\Core\Server class after line 170.

As release notes point out DB changes, I used: php migrateto32.php "mysql:host=localhost;dbname=baikal" baikal xxx inside vendor/sabre/dav/bin - this logs:

Connecting to database: mysql:host=localhost;dbname=baikal
Detected MySQL.
Creating 'calendarinstances'
calendarinstances does not yet exist. Creating table and migrating data.
The calendars table has 11 columns.
Backing up 'calendars' to 'calendars_3_1_1468529593'
Creating new calendars table.
Migrating data from old to new table
Upgrade to 3.2 schema completed.

using the dav.php GUI I already saw under Pluginsbutton both added plugins and after searching the issues I found the info about Action -> Share this resource at the bottom of calendar view. And voila, that worked quite well.

I fired up iCal and added two test accounts on that baikal test server. Both accounts showed that sharing icon known from iCloud. I could share the calendars by using the email address of the other user and after refreshing I saw that shared calendar. Wow. Fantastic. Inside db I see the added rows inside calendarinstances table.

Creation of dates worked, fetching the changes, too. I did not check more, but it seems like baikal is doing quite fine with only some minor changes..

Final question: would it be a option to send my changes as starting point inside as PR and get that included as a official branch, so that people can already start trying out that feature based on baikal? Would be really great!

I would offer to try my best to get a deeper integration of that feature into baikal (like a button/view to see/edit shares inside calendars view). But diving into internals of baikal needs more time, need to understand more about the internals of the used framework, db adapter and so on. If you would like a bounty support (https://www.bountysource.com/teams/fruux) for working on that, I would be open, too.

I totally respect and love your comment about being conservative related to stability. As stability comes with people who test, I would offer to test that feature, even with real world data. But would want to do it based on baikal, as that is the product I want to use in general.

Thanks for the testing @Mischosch . I'd say that the biggest thing that you didn't test but is a problem, is that creating/managing calendars from the web interface won't work.

The Model system in Baikal is a bit clunky and really to release this, I just want to overhaul this part of the source so it uses the sabre/dav backends, instead of directly writing to the database.

The real blocker here is "Moving to silex" and some work has been done in #558 for this.

@evert I already expected that part to fail because of schema changes. I wondered already, that Baikal kept working fine in many places.

So you want to move to silex first, get that model system of baikal refactored and then having sharing feature ready to launch on top of that, I see. Seems like the best place to get things rolling on would be working on that silex switch, then? Is there any organization happening around that refactor or is dennisdegreef the only one working on that topic?

Currently he's the only one. I've been meaning to review his work so far and get it to the next level, but I haven't really been able to focus on Baikal as much as I'd like recently.

will checkout his changes and ask him then for helping out without standing in the way.

Thanks for your fast answers, much appreciated!

(you might add a bounty for silex/sharing stuff :moneybag:)

Maybe not a bad idea.

@evert as it been few more weeks for stable sabre/dav is there a chance that it will bump to 3.2 so the shearing functionality will be available for supported clients or are we still wait for moving to silex?

@Mischosch is the instruction you posted full ? or are there any commands that are so obvious that you didn't include them ? like one after composer or that baikal migration 'xxx' ?

@bigretromike if I remember right, this was all, what was needed to get it running, yes. But did not test it really heavily. The admin gui was having some problems with the changed db setup, if I remember correct. Stopped there and switched to silex branch to follow development there - but did not have much time since then to support others. Think we should wait with that feature integration until silex app setup is cleaned up.

Yeah I know. I resolve my problem with just making another account (that is now shared) and export + import calendar from mine. I will stick with stable build. Just wanted to bump this issue ;-) because I love baikal/sabre so much!

If we can get baikal 0.5 out the door, which is based on silex, that would make it very easy for me to take the next step and get sabre/dav 3.2 in here. The big problem for me is time constraints, even if the project were funded I still wouldn't be able to complete it quickly.

I need help basically with this branch: https://github.com/fruux/Baikal/pull/568

@evert thanks for information on current situation. I would be happy to be able to help you with silex but don't use PHP and any of php framework sadly. But I wish you the best and hope that your project will grow strong.

I would be happy to back a bounty regarding the blocker :)

Great! I had some problems with bountysource, so I opened a ticket for that:

https://github.com/bountysource/core/issues/1057

After that I should be able to re-enable bounties for the baikal project.

Hey Evert, where do I find the link to the bounty?

@bigretromike sure, but this issue is not there .. I am not familiar with bountysource so far. The silex rewrite seems backed and I see no bounty for this issue there %)

Hi!

Here it is: https://www.bountysource.com/issues/33145013-share-calendar-between-baikal-users

Bountysource has been pretty buggy lately.

Keep in mind that the main thing that needs to happen before calendar sharing can be added, is the move for silex. I'm pausing everything else until then because any work done before it would be double work.

I changed sabre/dav inside composer.json

Which composer.json?

/var/baikal/vendor/twig/twig/composer.json
/var/baikal/vendor/sabre/xml/composer.json
/var/baikal/vendor/sabre/dav/composer.json
/var/baikal/vendor/sabre/uri/composer.json
/var/baikal/vendor/sabre/http/composer.json
/var/baikal/vendor/sabre/vobject/composer.json
/var/baikal/vendor/sabre/event/composer.json

Which entry?

"require": {
    "php": ">=5.5.0",
    "sabre/vobject": "~4.0",
    "sabre/event" : ">=2.0.0, <4.0.0",
    "sabre/xml"  : "~1.0",
    "sabre/http" : "^4.2.1",
    "sabre/uri" : "~1.0",
    "ext-dom": "*",
    "ext-pcre": "*",
    "ext-spl": "*",
    "ext-simplexml": "*",
    "ext-mbstring" : "*",
    "ext-ctype" : "*",
    "ext-date" : "*",
    "ext-iconv" : "*",
    "lib-libxml" : ">=2.7.0"
},
"require-dev" : {
    "phpunit/phpunit" : "> 4.8, <=6.0.0",
    "evert/phpdoc-md" : "~0.1.0",
    "sabre/cs"        : "~0.0.5"
},

using the dav.php GUI

which (URL) dav.php GUI

Was this page helpful?
0 / 5 - 0 ratings