Author Topic: New Plugin: CalDAVZap  (Read 7942 times)

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
New Plugin: CalDAVZap
« on: November 23, 2017, 03:31:22 AM »
Since no one of the calendar plugins do successfully sync with Roundcube or have problems with recurring events or duplicate events, i have written a small plugin which includes the wonderful CalDAVZap directly in to Roundcube. SSO is working, as long, as you use the same credentials for Roundcube and your CalDAV source. You must have a working instance of CalDAVZap first on the same server.

Currently only Larry Skin is supported, since this plugin was designed only as a workaround for my personal need, but i would like to share it with the community. You can find the plugin at https://plugins.roundcube.net/packages/offerel/caldavzap

Offline dase

  • Newbie
  • *
  • Posts: 1
Re: New Plugin: CalDAVZap
« Reply #1 on: December 21, 2017, 02:34:23 AM »
Hi,

did you try your plugin with ownClod/nextCloud implementation of CalDAV?

D.

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #2 on: December 21, 2017, 03:11:39 AM »
At my personal server, it works with SabreDAV 3.20. But it should work with all CalDAV servers, because it uses a only standard CalDAVZap package. It works also with the CarDAV plug-in from Benjamin Schieder, because it uses only JavaScript. No ancient SabreDAV vobject implementation. Nextcloud uses SabreDAV 3.2.2 as DAV base for calendar, contact and file operations. Maybe you must config the path to your needs in config.js but tjhas all.

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #3 on: January 14, 2018, 10:40:14 AM »
Hi,

I tried to use it with Nextcloud calendar but I have a white screen. But I am not sure to have put the information in a right way.

And, in the config.js file you specify "For shared calendars see the delegation option in globalAccountSettings, globalNetworkCheckSettings and globalNetworkAccountSettings" but the option "globalAccountSettings" not exist in this file.

It would be necessary as well to have examples in your configuration file.

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #4 on: January 15, 2018, 06:06:35 AM »
config.js isnt used for this plugin. Instead it uses config_rc.js with its on setup type. This should be the default case, when you haven't changed something. If there is a white screen, something is missconfigured. Could you please tell me more? At least errors in the browsers console.log and the logfiles of your webserver (if the problem is a server problem).

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #5 on: January 15, 2018, 04:46:28 PM »
When I want to go to calendar, a box tells me to enter login+password.
I enter their, but I have a white screen...
I have nothing in roundcube/logs/errors...
In webmail log, I can see that :
"File does not exist: /roundcube/plugins/libcalendaring/skins/classic/libcal.css, referer: https://my_webmail/?_task=caldavzap"

I use "classic" skin, it's perhaps THE problem.
But when I try with "larry" skin, it don't work anymore !!!
« Last Edit: January 15, 2018, 04:59:23 PM by rebeldu31 »

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #6 on: January 15, 2018, 05:01:59 PM »
Are you sure you have the latest version of my calendar plugin installed and not mixed something with another calendar plugin? The libcalendaring plugin is required by the calendar plugin from kolab and some forks of them to sync a CalDAV calendar. But there should be no reference from my plug-in to libcalendaring in the latest version.

Please remove other calendar plugins to make sure that no other calendar plugin interfere with CalDAVZap and re-download and install the latest version.

There should be also no login-box for logging in, since this plugin uses the Roundcube session only to login. This was changed in one of the last versions.

Please make also sure that you don't load old date from the browser cache. CalDAVZap makes heavy use of the caching mechanism in the browser and/or proxy's. Reloading or force reloading isnt enough to load new files. You can try to use a really independent session, if you use a new browser window in private mode.
« Last Edit: January 15, 2018, 05:06:46 PM by Loguithat1955 »

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #7 on: January 15, 2018, 05:07:44 PM »
I haven't other calendar plugin installed...
The plugin "libcalendaring" is from kolab...

If it's only roundcube session to be need, that would not work... My Nextcloud account IS NOT my roundcube account...
Nextcloud account is a cloud account, roundcube account is my mail...
So...

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #8 on: January 15, 2018, 05:25:23 PM »
If you're server is configured to allow such crossdomain configuations, the login should work also with a crossdomain Nextcloud account. The problem can be CalDAVZap since this uses JavaScript to work with the CalDAV source. JavaScript and crossdomain setups are a really bad idea. Sure, technically this could work but it's nothing what I would recommend.

You can try to get a normal CalDAVZap installation to work on your server via crossdomain setup and if this works, i could try to adopt your working setup for the Roundcube plugin in CalDAVZap itself. Please follow in this case the instructions for CalDAVZap. The process is very good explained in their readme file.

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #9 on: January 16, 2018, 01:28:30 PM »
Sorry but I don't understand all...

I'm french...

Nextcloud is accessible with my private domain "www.mydomain.fr".

I use Nextcloud calendar with caldav in my phone.

And I use carddav on roundcube to acces to my contacts.

At home, I access to roundcube with "name_server:port", to Nextcloud with "name_server:port", roundcube and nextcloud aren't on the same server. This ports are redirected to the good URL.

I never access to roundcube with its URL nowhere else that from home.

So, I think that is just the caldavzap configuration which is bad.

In config_rc.js I have juste change "language" to "fr_FR" and "timezone" to "Europe/Paris".

If you can help me ton put a good configuration.... Perhaps with option "globalSubscribedCalendars"...
« Last Edit: January 16, 2018, 01:32:38 PM by rebeldu31 »

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #10 on: January 17, 2018, 08:11:50 AM »
OK, let me try to explain. I hope I can put it in simple terms. You say Nextcloud is installed under "www.mydomain.fr". But your Roundcube installation is on a different server. I therefore assume that you will reach your Roundcube for example under "roundcube.yourserver. fr". This is a crossdomain setup because both URLs come from different servers.

If Roundcube were under "roundcube.mydomain.fr", this would still be crossdomain. If Nextcloud is under "www.mydomain.fr:443" and Roundcube under "www.mydomain.fr:80" this is also crossdomain.

If it were "www.mydomain.fr/nextcloud/" for NextCloud and "www.mydomain.fr/roundcube/" for Roundcube, this would NOT be a cross domain setup.

Crossdomain setups have a security problem. At least in relation to Javascript. Therefore, these should be avoided as far as possible. There are also ways to implement cross domain setups with Javascripts, but the HTTP headers of the server, in this case of the next cloud server, have to be adapted. The Nextcloud server should be configured to send the following headers correctly:

Access-Control-Allow-Origin: *
Access Control Allow Allow Methods: GET, POST, OPTIONS, PROPFIND, PROPPATCH, REPORT, PUT, MOVE, DELETE, LOCK, UNLOCK
Access Control Allow Headers: User-Agent, Authorization, Content-type, Depth, If-match, If-None-Match, Lock-Token, Timeout, Destination, Overwrite, Prefer, X-client, X-Requested-With
Access-Control-Expose-Headers: Etag, Preference-Applied

For information on how to set these headers, see the server documentation. For a little bit more detailed information, you can have a look at https://www.inf-it.com/caldavzap/readme.txt

Concerning the globalSubscribedCalendars: For the reasons mentioned above, these also only work if the CalDAV server sends the correct CORS headers. Google, for example, does not send them. Thus a subscription of Google calendars is only possible via workarounds. Keyword: nginx proxying

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #11 on: January 17, 2018, 12:53:32 PM »
OK, I understand more now !!!

So...

ONLY at home, my Rouncube is accessible with "https://server_name_1:XX" and Nextcloud with "https://server_name_2:YY"... So this is crossdomain...
But Nextcloud can be accessible with "https://nextcloud.my_domain.fr" which is just a redirection to "https://www.my_domain.fr:YY"... From home... But useless because I'm at home...

I must search how to verify/modify headers. Nextcloud is on my Synology NAS, so it turn with nginx, and not apache.

Offline Loguithat1955

  • Jr. Member
  • **
  • Posts: 47
Re: New Plugin: CalDAVZap
« Reply #12 on: January 17, 2018, 01:04:47 PM »
If your roundcube server uses also nginx and you configure your server, you can try

Code: [Select]
location /local/calendar/path/ {
proxy_pass https://www.my_domain.fr/nextcloud/calendar/;
}

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #13 on: January 17, 2018, 01:26:41 PM »
Rouncube server uses apache, is on a Raspberry Pi...
Nextcloud server uses nginx, is on a Synology NAS...

I search how modify nginx headers on a Synology NAS, but I found nothing at the moment.

Offline rebeldu31

  • Jr. Member
  • **
  • Posts: 26
Re: New Plugin: CalDAVZap
« Reply #14 on: January 17, 2018, 02:07:46 PM »
It's OK...
I found how to modify nginx headers and I modifed like you have specifie...
 8)

Now, how must I modify caldavzap configuration ?