Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: Loguithat1955 on November 23, 2017, 03:31:22 AM

Title: New Plugin: CalDAVZap
Post by: Loguithat1955 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
Title: Re: New Plugin: CalDAVZap
Post by: dase on December 21, 2017, 02:34:23 AM
Hi,

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

D.
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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.
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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).
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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 !!!
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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...
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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"...
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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.
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 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/;
}
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 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 ?
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 on January 17, 2018, 02:14:01 PM
I didn't understand what you have changed now... Have you changed the CORS headers of "external" NextCloud servers, or have you changed the local nginx to serve the external Nextcloud URL as local path? If you setup the local proxy setup, you didn't need to change the CORS headers, because its served now as a local path and this isn't any more a crossdomain setup... which makes everything a lot easier.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on January 18, 2018, 03:23:29 PM
I changed headers of Nextcloud server., which uses nginx..

For information :

I downloaded and installed the quite last version (0.13.1) but that does not work yet.
Worse even: the plugins does not appear.
Before, I had the icon "calendar". Now, nothing more, or even in the parameters of roundcube (list of plugins)...

?????????
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 on January 19, 2018, 03:04:00 AM
As i mentioned before, i don't know if a crossdomain setup does really work with CalDAVZap. When you only changed the headers of the nextcloud server, you have now also a crossdomain setup. But you see this in the webconsole. the should be a note, if it is detected as crossdomain or not. You should really try the proxy setup. It's a lot easier to deal with non-crossdomain-setups.

When you say, you installed a version 0.13.1, i assume, you mean CalDAVZap? How have you installed it? Just overwrite the 0.13.2 folder? Or a new folder? Have you changed the path in the config? Are there error messages? Have you any logfiles? Any output in Webconsole? Have you disabled all other plugins to test if the problem comes from other plugins? What plugins are activated currently?
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on January 19, 2018, 01:01:52 PM
As i mentioned before, i don't know if a crossdomain setup does really work with CalDAVZap. When you only changed the headers of the nextcloud server, you have now also a crossdomain setup. But you see this in the webconsole. the should be a note, if it is detected as crossdomain or not. You should really try the proxy setup. It's a lot easier to deal with non-crossdomain-setups.

I don't see any note in the webconsole.

Quote
When you say, you installed a version 0.13.1, i assume, you mean CalDAVZap? How have you installed it? Just overwrite the 0.13.2 folder? Or a new folder? Have you changed the path in the config? Are there error messages? Have you any logfiles? Any output in Webconsole? Have you disabled all other plugins to test if the problem comes from other plugins? What plugins are activated currently?

Yes, it's CalDAVZap that I installed the last version.
I deleted old folder and place the new folder.
In webmail erros log I found "AH01382: Request header read timeout", but with our without caldavzap plugin activate.
I tried without all plugins activate : same error...
I tried without all plugins except caldavzap : same error and no calendar icon ==> no problem with other plugins...

But I saw that I have say you bad explain...  ::)
Sorry...
I retry ton explain how roundcube works :
- roundcube folder is on a NAS folder, mounted with NFS on my Raspberry
BUT...
- roundcube URL goes to my Raspberry, and not to my NAS...
SO...
Roundcube works with apache and not nginx... Only Nextcloud works with nginx on my NAS...
I modified vhost configuration to put good headers...

But that changes anything !!!

I would like trying use proxy but I don't know how to do.
I must modify apache configuration but how ?
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 on January 20, 2018, 02:50:47 PM
Personally, i use also a Raspberry Pi. But in my case for both: Roundcube and the calendar. But Nextcloud is so slow on a Raspberry Pi... they make some unneeded I/O things and some SQL requests which are really complicated. This slows down the whole process. But since Nextcloud is completely based on SabreDAV, i use the pure SabreDAV which is a lot faster. However, both are on the Raspberry Pi. SabreDAV and Roundcube are delivered only in different directories. The Webserver on the Pi is Nginx, since Apache is not the best solution for the Pi, because the memory management is meant more for bigger machines.

It's a long time since i last used Apache. However you should search for "reverse proxy apache" at Google, to get the right tips to set this up. on apache. Or you change Apache against Nginx / PHP7.0-FPM on the Raspberry Pi.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on January 21, 2018, 05:00:03 AM
I began my architecture with Roundcube and Nextcloud on distinct Raspberry.
Then, I bought a Synology NAS and I installed Nextcloud above.

As I have only little greedy sites on my Raspberrys, Apache is widely sufficient. But is especially less complicated to configure that Nginx.

So I don't want to change Apache for Nginx on my Raspberry.

I searched "reverse proxy apache" and I found how to. I tried to configure Apache but it doesn't work. But I'm not sure that I have the good configuration.
Title: Re: New Plugin: CalDAVZap
Post by: Loguithat1955 on January 21, 2018, 06:35:13 AM
Yes, that was my first opinion to, after switching from Apache to Nginx years ago. In the meantime I find Nginx a lot easier, even if one or two options are missing. But most of the time there are simple workarounds and again things that Nginx can do more and better than Apache. Anyway, that's certainly a matter of personal habit.

Unfortunately, I've been out of practice at Apache for a long time now. I would therefore recommend that you check in a special server forum or Apache forum.

BTW: For Plugin questions, i think its better to report Issues at the Github. I do not read really often here.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on January 21, 2018, 07:36:09 AM
I created a issue.

Wait and see !!!
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on January 24, 2018, 04:00:52 PM
Hi,

No more help by github issue.
He tells me that it is a nginx problem, not plugin problem. He does'nt help me more. Thank's guy !!! And he closed the issue !!!  :o :o

So, I searched a lot of informations to have a good configuration for reverse proxy with Apache, to have a good configuration with Nginx for receiving proxy request AND I have resolved my reverse proxy problem. It's works now !!!

So, happy, I tried the plugin....
==> Don't work !!!

But I don't know how configure the plugin. The readme isn't rather explicit. It explain than we can use differents variables but don't show an example.

The question is : which variable I have to use, and how I must configure it !!!
 ??? ???
Title: Re: New Plugin: CalDAVZap
Post by: telecom2k3 on February 16, 2018, 01:50:58 PM
1) This is a Javascript application.  So, the calendar data transfer occurs between the user's web browser, and the calendar server itself; in your case, between whatever web browser you use, and your Nextcloud server.  When an application on one server wants your browser to access resources on another server, this presents a major security problem.  This is known as XSS, or Cross-Site Scripting.  All major web browsers prohibit this today.  Firefox has a Developer under Settings -> Web Developer -> Web Console.  Chrome has the same thing under Tools -> Developer Tools.  These consoles will display XSS, and any other, errors.
2) A Proxy Server is just another potential work-around around for this problem.   In the plugin configuration, you would program in your local webserver address  for the CalDAV server address.  Your proxy server forwards the requests to the actual CalDAV (NextCloud) server.   So to your end-user Web Browser, everything looks like its coming and going to the same server (Roundcube).
3) If you wish to post a question here requesting configuration information, then do so.  But as you can see, this is a new plugin that doesn't have a lot of active installations yet.  You will probably get better support from Synology.   Synology is a commercial product; you should expect to get good service from them.
4) Your expectations are unreasonable.  The developer's job is to make a working plugin with Roundcube.  That is all.  It is not his/her job to tell you how to configure it for OwnCloud, PureCloud, NextCloud, or WhoEversCloud.  It is not his/her job to tell you how to configure it for Apache 2.2, Apache 2.4, Apache Whatever, NGINX, LightHTTP, Node.js, IIS, or anything else.  The plug-in works fine.  It is very good.  There is no reason to insult the developer.
Title: Re: New Plugin: CalDAVZap
Post by: rebeldu31 on February 16, 2018, 02:43:12 PM

Guy,

When and where have I say that I had asked for help to configure Nextcloud or other?  :o
When we do not know the volume of an exchange (on Github) we do not make remarks, thank you.  ;)

I had simply asked him how to configure HIS PLUGINS, nothing more!!!
Then, this kind of answer, in others, thank you well!!!

Anyway, problem settled for me: I uninstalled this plugin because I had no help to its configuration on behalf of the developer.
Thus closed subject!!!
 8)